Re: PyNIO install and libjpeg

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 09 2011 - 14:28:53 MDT

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

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Sep 9 14:28:58 2011

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