Opened 16 years ago
Closed 16 years ago
#2068 closed defect (invalid)
Strange Python dependency to libNCSCnet
Reported by: | Mateusz Łoskot | Owned by: | hobu |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | PythonBindings | Version: | svn-trunk |
Severity: | normal | Keywords: | ecw libecwj python |
Cc: |
Description (last modified by )
I'm building GDAL with ECW support on Mac OS X 10.4 using ./configure --with-ecw and linking against libecwj2-3.3 binaries.
~/dev/gdal/_svn/trunk/gdal $ otool -L /Users/mloskot/dev/gdal/_svn/trunk/gdal/libgdal.dylib |grep NCS /usr/local/lib/libNCSEcw.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/lib/libNCSCnet.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/lib/libNCSUtil.0.dylib (compatibility version 1.0.0, current version 1.0.0)
I also request Python bindings using --without-ogpython --with-python.
Everything have worked well for long time. As I remember it worked well also in last Thursday (Now 29). Today, I updated GDAL from SVN and tried to rebuild & test but loading Python bindings fail with strange error:
~/dev/gdal/_svn/trunk/gdal $ python Python 2.3.5 (#1, Dec 7 2006, 14:50:51) [GCC 4.0.1 (Apple Computer, Inc. build 5363) (+4864187)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import gdal Traceback (most recent call last): File "<stdin>", line 1, in ? File "/Users/mloskot/dev/gdal/_svn/trunk/gdal/swig/python/build/lib.darwin-8.11.1-i386-2.3/gdal.py", line 2, in ? from osgeo.gdal import deprecation_warn File "/Users/mloskot/dev/gdal/_svn/trunk/gdal/swig/python/build/lib.darwin-8.11.1-i386-2.3/osgeo/gdal.py", line 7, in ? import _gdal ImportError: dlopen(/Users/mloskot/dev/gdal/_svn/trunk/gdal/swig/python/build/lib.darwin-8.11.1-i386-2.3/osgeo/_gdal.so, 2): Symbol not found: _GetControlByID Referenced from: /usr/local/lib/libNCSCnet.0.dylib Expected in: flat namespace >>>
The reported libNCSCnet library belongs to libecwj2-3.3 SDK:
$ nm /usr/local/lib/libNCSCnet.0.dylib |grep ID U _GetControlByID U _GetControlID ...
Here is where I suck the GDAL Python bindings from:
~/dev/gdal/_svn $ echo $DYLD_LIBRARY_PATH /Users/mloskot/dev/gdal/_svn/trunk/gdal ~/dev/gdal/_svn/trunk/gdal $ echo $PYTHONPATH /Users/mloskot/dev/gdal/_svn/trunk/gdal/swig/python/build/lib.darwin-8.11.1-i386-2.3 ~/dev/gdal/_svn/trunk/gdal $ ls swig/python/build/lib.darwin-8.11.1-i386-2.3/osgeo/ __init__.py _gdalconst.so _osr.so gdal_array.py gdalnumeric.py osr.py _gdal.so _ogr.so gdal.py gdalconst.py ogr.py
I'm wondering if it is a bug or something specific to my environment.
However, everything works well when using GDAL without ECW support:
~/dev/gdal/_svn/trunk/gdal $ otool -L /Users/mloskot/dev/gdal/_svn/trunk/gdal/libgdal.dylib | grep NCS ~/dev/gdal/_svn/trunk/gdal
and I can import GDAL modules with success:
~/dev/gdal/_svn/trunk/gdal $ python Python 2.3.5 (#1, Dec 7 2006, 14:50:51) [GCC 4.0.1 (Apple Computer, Inc. build 5363) (+4864187)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import gdal /Users/mloskot/dev/gdal/_svn/trunk/gdal/swig/python/build/lib.darwin-8.11.1-i386-2.3/osgeo/gdal.py:81: DeprecationWarning: gdal.py was placed in a namespace, it is now available as osgeo.gdal DeprecationWarning) >>>
Change History (4)
comment:1 by , 16 years ago
Description: | modified (diff) |
---|
comment:2 by , 16 years ago
Description: | modified (diff) |
---|
comment:3 by , 16 years ago
comment:4 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Mateusz,
The linker options of ECW are what's causing the problem. It needs to use the same linking options as the Python bindings:
ldd -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup
Also, I've never gotten ECW to actually work on OS X. William may have had some success lately, but I know he's had a lot of trouble too.
Howard
Here is complete set of commands issued by python setup.py build, so you can see linker flags (ECW enabled by ./configure):