[gdal-dev] osx compile failure

Alan Stewart astewart at terragotech.com
Mon Jan 14 12:25:42 PST 2019


Apparently the problems I was having with setdevenv.sh where caused by something trashed in my environment? After being gone for a few das now sourcing the script reports seems to operate normally.

Yes, libgdal.dylib is in the gdal/.libs path, and this path is in DYLD_LIBRARY_PATH. I'm running gdal/ci/travis/osx/script.sh from another script that sources gdal/scripts/setdevenv.sh first. I'm still seeing the same error.

Output snippet:

Sourcing setdevenv.sh...

Setting PATH=/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/apps:/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/apps/.libs:/Users/astewart/.rvm/gems/ruby-2.5.3/bin:/Users/astewart/.rvm/gems/ruby-2.5.3 at global/bin:/Users/astewart/.rvm/rubies/ruby-2.5.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Users/astewart/.rvm/bin
Setting DYLD_LIBRARY_PATH=/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal:/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/.libs:
Setting GDAL_DATA=/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/data
Setting PYTHONPATH=/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/swig/python/build/lib.macosx-10.12-x86_64-2.7:

Testing _gdal.so and libgdal.dylib for presence of CPLErrorSetState is successful.

Is there something besides DYLD_LIBRARY_PATH that needs to be set? Adding gdal/.libs to PATH did not good.

Alan Stewart
Senior Software Engineer
TerraGo Technologies
3200 Windy Hill Road, Suite 1550W
Atlanta, GA 30339 USA
O.  +1 678.391.9615
 
www.terragotech.com

-----Original Message-----
From: Even Rouault <even.rouault at spatialys.com> 
Sent: Thursday, January 03, 2019 4:40 PM
To: Alan Stewart <astewart at terragotech.com>
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] osx compile failure

On jeudi 3 janvier 2019 21:17:26 CET Alan Stewart wrote:
> Even,
> 
> I've been working on this. There were a lot of small source changes 
> across a number of formats, not just plscenes, plus some 
> system-specific details in the scripts, to be resolved. I have a 
> successful build now, but running the ci/travis/osx/script.sh results in:
> 
> ImportError while loading conftest
> '/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/autotes
> t/con ftest.py'. /usr/local/lib/python2.7/site-packages/six.py:709: in 
> exec_
>     exec("""exec _code_ in _globs_, _locs_""")
> conftest.py:9: in <module>
>     from osgeo import gdal
> ../gdal/swig/python/build/lib.macosx-10.12-x86_64-2.7/osgeo/__init__.py:21:
> in <module> _gdal = swig_import_helper()
> ../gdal/swig/python/build/lib.macosx-10.12-x86_64-2.7/osgeo/__init__.py:17:
> in swig_import_helper _mod = imp.load_module('_gdal', fp, pathname,
> description)
> E   ImportError:
> dlopen(/Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/g
> dal/s wig/python/build/lib.macosx-10.12-x86_64-2.7/osgeo/_gdal.so, 2): 
> Symbol not
> found: _CPLErrorSetState E     Referenced from:
> /Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/swig/pyt
> hon/build/lib.macosx-10.12-x86_64-2.7/osgeo/_gdal.so E     Expected in: flat
> namespace
> E    in
> /Users/astewart/Documents/GitHub/alanstewart-terragotech/gdal/gdal/swi
> g/pyt hon/build/lib.macosx-10.12-x86_64-2.7/osgeo/_gdal.so
> 
> Any thoughts on why CPLErrorSetState would be missing?

I presume that this is because libgdal.dylib is not found.
Did you source "scripts/setdevenv.sh" that should set up the appropriate environment variables ? In that particular case DYLD_LIBRARY_PATH to point to libgdal.dylib

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the gdal-dev mailing list