Re: PyNIO install and libjpeg

From: David B. Reusch <dreusch_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 09 2011 - 17:11:38 MDT

Hi,

I can't say I was *intentionally* trying to build a universal binary.
Just trying to get it to go on my Intel-based MacPro. But I see now
that the system's trying to do it without being explictly asked. That's
potentially all kinds of (never before seen) problems since fink only
has x86_64 versions of these (and other) libraries (whereas my
system-installed python is 3-way universal).

After much searching, I still haven't found a way to keep the compiler
from adding the unwanted arch flags. Plenty of help for adding them,
nothing for excluding them. Also seems as though this is coming from
somewhere outside of the PyNIO setup?

I tried installing libjpeg outside of fink. Had to add LDFLAGS. That
actually worked -- but then it broke on libpng! Haven't been able to
fix that yet. It's starting to look like the whole reason for having
fink is being subverted.

If there was just a way to tell g++ that all I want is x86_64 and not a
universal???

Thanks,
Dave

David Brown said the following on 9/9/11 2:28 PM:
> Hi Dave,
>
> We have not had much luck building MAC OS universal binaries here and we don't supply them for NCL or PyNGL/PyNIO as far as I know. Note that all your libraries (NetCDF, HDF5, jpeg, etc.) need to be built as universal for it to work. Before I noticed that about your output, I tried to simulate your situation by temporarily moving the jpeg library that I usually rely on in /usr/local/lib out of the way and using the macports installed version in /opt/local/lib/. As you did, I set F2CLIBS_PREFIX, but to /opt/local/lib. It worked for me, producing the following output:
>
> c++ -bundle -undefined dynamic_lookup build/temp.macosx-10.4-x86_64-2.7/niomodule.o -Llibsrc -L/usr/local/lib -L/usr/local/lib -L/Users/dbrown/local/lib -L/opt/local/lib -Lbuild/temp.macosx-10.4-x86_64-2.7 -lnio -ljpeg -lpng -lz -lnetcdf -lmfhdf -ldf -lhdf5_hl -lhdf5 -lcurl -lssl -lcrypto -lldap -lz -lhdfeos -lGctp -lgrib2c -ljasper -lpng -lhe5_hdfeos -lGctp -lgdal -lproj -lsz -lgfortran -o build/lib.macosx-10.4-x86_64-2.7/PyNIO/nio.so
>
> and not giving any error. Prior to setting F2CLIBS_PREFIX I got the same error you did:
>
> ld: library not found for -ljpeg
> collect2: ld returned 1 exit status
> ld: library not found for -ljpeg
>
> So your F2CLIBS_PREFIX should have worked, and I am speculating that perhaps it didn't because your libjpeg.a is not "universal". Are you using the MAC OS system python? If so, you may want to consider getting another version, from fink or macports perhaps, or maybe building it yourself from source.
> I will end with the caveat that Mary Haley knows a lot more about these build and install issues than I do. She is out at the moment but will be back next week.
> -dave
>
>
> On Sep 9, 2011, at 1:15 PM, David B. Reusch wrote:
>
>> Hello,
>>
>> I'm trying to install PyNIO from source for the first time on a 64-but
>> Mac 10.6.8 system. I have libjpeg installed under fink (in /sw64/lib)
>> but have not been able to get the setup.py script to find it. The key
>> error output appears to be:
>>> g++-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc
>>> -arch x86_64 build/temp.macosx-10.6-universal-2.6/niomodule.o
>>> -Llibsrc -Lbuild/temp.macosx-10.6-universal-2.6 -lnio -ljpeg -lpng -lz
>>> -lnetcdf -o build/lib.macosx-10.6-universal-2.6/PyNIO/nio.so
>>> ld: library not found for -ljpeg
>> The script I'm using to drive my install (to keep things simpler) is:
>>> #!/bin/tcsh
>>> setenv HAS_GRIB2 0
>>> setenv HAS_HDFEOS 1
>>> setenv HAS_NETCDF4 1
>>> setenv NETCDF4_PREFIX /usr/local/netcdf-4.1.1
>>> setenv HDFEOS_PREFIX /usr/local/hdf5
>>>
>>> setenv F2CLIBS gfortran
>>> setenv F2CLIBS_PREFIX /sw64/lib
>>>
>>> sudo python setup.py install
>> Note that the lines with F2CLIBS didn't change anything after I added
>> them (presumably because gfortran wasn't having any problems...).
>>
>> I tried using setenv LDFLAGS "-L/sw64/lib -ljpeg" but that hasn't helped
>> either.
>>
>> In short, my guess is I need another setenv so that the script finds
>> /sw64/lib but I haven't been able to find the right one.
>>
>> Thanks,
>> Dave
>>
>> --
>> Associate Research Professor of Climatology
>> Dept of Earth and Environmental Science
>> MSEC 304; 801 Leroy Place
>> New Mexico Tech
>> Socorro, NM 87801
>>
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>

-- 
Associate Research Professor of Climatology
Dept of Earth and Environmental Science
MSEC 304; 801 Leroy Place
New Mexico Tech
Socorro, NM 87801
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Sep 9 17:11:44 2011

This archive was generated by hypermail 2.1.8 : Mon Sep 12 2011 - 16:03:35 MDT