Closed GoogleCodeExporter closed 9 years ago
It's not finding the netcdf libs. Since you did not include the full output
produced by setup.py build, it's hard to say why. I do suspect the setting
DYLD_LIBRARY_PATH may be a problem - in general this is a bad idea. Try
starting a new shell (without setting DYLD_LIBRARY_PATH) and save the entire
output produced by 'USE_NCCONFIG=1 python setup.py build'. If you still get
that error, post the output here.
Original comment by whitaker.jeffrey@gmail.com
on 9 Apr 2013 at 1:34
Thanks for the advice. I started a new shell and set the DYLD_LIBRARY_PATH to
nothing; For good measure I tried it as /usr/local, and /usr/local/mysql/lib
with the same result as before. It seems to be finding the NC and HDF libs in
their default locs.
rodchenko:test $ echo $DYLD_LIBRARY_PATH
rodchenko:netCDF4-1.0.4 $ USE_NCCONFIG=1 python setup.py build
using nc-config ...
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building py_modules sources
building extension "netCDF4" sources
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
running scons
running build_scripts
rodchenko:netCDF4-1.0.4 $ sudo python setup.py install
HDF5_DIR environment variable not set, checking some standard locations ..
checking /Users/adamwolf ...
checking /usr/local ...
HDF5 found in /usr/local
NETCDF4_DIR environment variable not set, checking standard locations..
checking /Users/adamwolf ...
checking /usr/local ...
netCDF4 found in /usr/local
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building py_modules sources
building extension "netCDF4" sources
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
running scons
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/nc3tonc4 to 755
changing mode of /usr/local/bin/nc4tonc3 to 755
running install_egg_info
Removing /Library/Python/2.7/site-packages/netCDF4-1.0.4-py2.7.egg-info
Writing /Library/Python/2.7/site-packages/netCDF4-1.0.4-py2.7.egg-info
running install_clib
customize UnixCCompiler
rodchenko:netCDF4-1.0.4 $ cd test; python run_all.py
Traceback (most recent call last):
File "run_all.py", line 1, in <module>
import glob, os, sys, unittest, netCDF4
File "build/bdist.macosx-10.7-intel/egg/netCDF4.py", line 7, in <module>
File "build/bdist.macosx-10.7-intel/egg/netCDF4.py", line 6, in __bootstrap__
ImportError:
dlopen(/Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tm
p/netCDF4.so, 2): Symbol not found: _nc_close
Referenced from: /Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tmp/netCDF4.so
Expected in: flat namespace
in /Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tmp/netCDF4.so
For completeness' sake, here is the output of otool as you suggested in a prior
post. It does not appear to be linked against any of zlib/hdf/netcdf:
rodchenko:test $ otool -L
/Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tmp/netCD
F4.so
/Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tmp/netCD
F4.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
Original comment by Adam.von...@gmail.com
on 9 Apr 2013 at 2:27
I suspect that setup.py is not finding the nc-config script, and is falling
back on using the NETCDF4_DIR and HDF5_DIR env vars (which are not set). Is
nc-config in your path? Was it installed in /usr/local/bin?
Also, you did not delete the build directory before re-running setup.py build,
so it didn't actually rebuild anything.
Original comment by whitaker.jeffrey@gmail.com
on 9 Apr 2013 at 4:03
I tried a couple variants . . nc-config is easy enough to find:
rodchenko:~ $ which nc-config
/usr/local/bin/nc-config
I get similar messages if I use nc-config or define the NC and HDF directories
in setup.cfg. Here is the output. Most intriguing is the linker warning for
incorrect architecture; I'm not sure why that is because those libraries are
built for X86_64, and the compile options here also for X86_64. Is the arch
-i386 flag causing the warning?
rodchenko:netCDF4-1.0.4 $ rm -rf build/
rodchenko:netCDF4-1.0.4 $ python setup.py build
reading from setup.cfg...
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building py_modules sources
building extension "netCDF4" sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.macosx-10.7-intel-2.7
copying netcdftime.py -> build/lib.macosx-10.7-intel-2.7
copying netCDF4_utils.py -> build/lib.macosx-10.7-intel-2.7
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'netCDF4' extension
compiling C sources
C compiler: llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe
-fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE
-DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g
-fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64
-pipe
creating build/temp.macosx-10.7-intel-2.7
compile options: '-I/usr/local/include -I/usr/local/include
-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/num
py/core/include
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
llvm-gcc-4.2: netCDF4.c
netCDF4.c: In function '__pyx_f_7netCDF4__set_att':
netCDF4.c:15677: warning: implicit conversion shortens 64-bit value into a
32-bit value
netCDF4.c:15866: warning: implicit conversion shortens 64-bit value into a
32-bit value
netCDF4.c: In function '__pyx_pf_7netCDF4_8Variable___init__':
netCDF4.c:26874: warning: implicit conversion shortens 64-bit value into a
32-bit value
netCDF4.c: In function '__pyx_pf_7netCDF4_8Variable_52_put':
netCDF4.c:36814: warning: implicit conversion shortens 64-bit value into a
32-bit value
netCDF4.c: In function '__pyx_pf_7netCDF4_8Variable_54_get':
netCDF4.c:38099: warning: implicit conversion shortens 64-bit value into a
32-bit value
netCDF4.c: In function '__pyx_f_7netCDF4__def_compound':
netCDF4.c:41439: warning: implicit conversion shortens 64-bit value into a
32-bit value
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch
x86_64 build/temp.macosx-10.7-intel-2.7/netCDF4.o -L/usr/local/lib
-L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -lnetcdf -lhdf5_hl -lhdf5
-lz -o build/lib.macosx-10.7-intel-2.7/netCDF4.so
ld: warning: in /usr/local/lib/libnetcdf.dylib, file is not of required
architecture
ld: warning: in /usr/local/lib/libhdf5_hl.dylib, file is not of required
architecture
ld: warning: in /usr/local/lib/libhdf5.dylib, file is not of required
architecture
ld: warning: in /usr/local/lib/libz.dylib, file is not of required architecture
running scons
running build_scripts
creating build/scripts.macosx-10.7-intel-2.7
copying utils/nc3tonc4 -> build/scripts.macosx-10.7-intel-2.7
copying and adjusting utils/nc4tonc3 -> build/scripts.macosx-10.7-intel-2.7
changing mode of build/scripts.macosx-10.7-intel-2.7/nc4tonc3 from 644 to 755
rodchenko:netCDF4-1.0.4 $ cd test; python run_all.py
Traceback (most recent call last):
File "run_all.py", line 1, in <module>
import glob, os, sys, unittest, netCDF4
File "build/bdist.macosx-10.7-intel/egg/netCDF4.py", line 7, in <module>
File "build/bdist.macosx-10.7-intel/egg/netCDF4.py", line 6, in __bootstrap__
ImportError:
dlopen(/Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tm
p/netCDF4.so, 2): Symbol not found: _nc_close
Referenced from: /Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tmp/netCDF4.so
Expected in: flat namespace
in /Users/adamwolf/.python-eggs/netCDF4-1.0.4-py2.7-macosx-10.7-intel.egg-tmp/netCDF4.so
rodchenko:test $ file /usr/local/lib/libnetcdf.dylib
/usr/local/lib/libnetcdf.dylib: Mach-O 64-bit dynamically linked shared library
x86_64
Original comment by Adam.von...@gmail.com
on 9 Apr 2013 at 12:45
This is your problem
ld: warning: in /usr/local/lib/libnetcdf.dylib, file is not of required
architecture
ld: warning: in /usr/local/lib/libhdf5_hl.dylib, file is not of required
architecture
ld: warning: in /usr/local/lib/libhdf5.dylib, file is not of required
architecture
ld: warning: in /usr/local/lib/libz.dylib, file is not of required architecture
I'm not a macos expert, so I don't know what to tell you other than to install
hdf5 and netcdf via macports (that's always worked fine for me).
Original comment by whitaker.jeffrey@gmail.com
on 9 Apr 2013 at 2:15
BTW: It looks like the libs were built 64 bit (x86_64) but your python is 32
bit (i386). I think you can tell by doing 'file /usr/local/lib/libnetcdf.dylib'.
Original comment by whitaker.jeffrey@gmail.com
on 9 Apr 2013 at 2:25
Original comment by whitaker.jeffrey@gmail.com
on 26 Feb 2014 at 2:04
Original issue reported on code.google.com by
Adam.von...@gmail.com
on 9 Apr 2013 at 12:44