Closed GoogleCodeExporter closed 8 years ago
Looks like your netcdf lib was built with hdf4 support (which requires linking
the jpeg library).
Try running
nc-config --libs
and
nc-config --has-hdf4
If the jpeg libs show up and has-hdf4 is 'yes', then trying setting the env var
USE_NCCONFIG to 1 before running setup.py build. This should link the jpeg
libs when building the extension.
Original comment by whitaker.jeffrey@gmail.com
on 7 Nov 2013 at 8:41
Another possibility is to use the env var SZIP_DIR to point to the location of
the jpeg installation, and then edit setup.py replacing
libs.append('sz')
with
libs.append('jpeg')
This will force python to link the jpeg lib when building the C extension. If
a shared version of the jpeg lib was linked when the netcdf lib was built, this
should not be necessary.
Original comment by whitaker.jeffrey@gmail.com
on 7 Nov 2013 at 9:01
'nc-config --has-hdf4' returned 'yes', so indeed the netcdf libs were built
with hdf4 support. However, 'nc-config --libs' returned the following libraries:
-lnetcdf -lm -lz -lmpi -lmfhdf -ldf -lhdf5_hl -lhdf5 -lsz
i.e., no jpeg. Also, I had set 'use_ncconfig=True' and the proper path to
nc-config in setup.cfg. During build (of python-netcdf), it used that nc-config
to find netcdf4 and hdf5 libs successfully.
I also tried adding a '-ljpeg' to the final linker line which produces
netCDF4.so. It did not complain, but did not solve the issue either.
Original comment by sourish....@gmail.com
on 7 Nov 2013 at 9:06
'libs.append('jpeg')' would have the same effect as adding a '-ljpeg' to the
linker line, no? I already tried that, and that didn't solve the problem (I
also tried the libs.append('jpeg') in setup.py before that).
I did an nm on the netcdf library
nm /apps/netcdf/4.2-intel-12.0.4.191-mpt-2.05/lib/libnetcdf.a | grep jpeg
There were no *jpeg* symbols.
Original comment by sourish....@gmail.com
on 7 Nov 2013 at 9:17
There are no jpeg symbols defined in netcdf, but netcdf is using hdf4 (mfhdf)
which is calling the jpeg lib. Try editing nc-config and adding -ljpeg to
libs="-lnetcdf -lm -lz -lmpi -lmfhdf -ldf -lhdf5_hl -lhdf5 -lsz"
This is really a bug in nc-config.
Then, rebuild with USE_NCCONFIG=1.
I also think this would not be happening if netcdf (and hdf) were built as a
shared libs - the linker would then know to pull in the other libs.
Original comment by whitaker.jeffrey@gmail.com
on 7 Nov 2013 at 10:14
This presumes that the jpeg lib that hdf linked lives in the same place as
mfhdf. It may not - you may need to locate it, i.e. with
locate libjpeg
Original comment by whitaker.jeffrey@gmail.com
on 7 Nov 2013 at 10:17
I built custom netcdf libraries without HDF4, and that solved the problem.
Original comment by sourish....@gmail.com
on 14 Nov 2013 at 5:46
I've added the ability to specify the locations of the hdf4, jpeg and curl libs
as env vars, or in setup.cfg in svn.
Original comment by whitaker.jeffrey@gmail.com
on 14 Nov 2013 at 4:33
Original comment by whitaker.jeffrey@gmail.com
on 26 Feb 2014 at 2:04
Original issue reported on code.google.com by
sourish....@gmail.com
on 7 Nov 2013 at 7:55