Support #1607

gammalib: problem using libreadline in mac os 10.10.3

Added by de Ona Wilhelmi Emma over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:12/18/2015
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:-
Duration:

Description

Dear ctool help center,

I am trying to use the python utilities with ctools and I have a problem with some of the libraries. My python is installed through anaconda:

---→ 4 from gammalib.app import *
5 from gammalib.base import *
6 from gammalib.fits import *

/usr/local/gamma/lib/python2.7/site-packages/gammalib/app.py in <module>()
26 fp.close()
27 return _mod
--→ 28 _app = swig_import_helper()
29 del swig_import_helper
30 else:

/usr/local/gamma/lib/python2.7/site-packages/gammalib/app.py in swig_import_helper()
22 if fp is not None:
23 try:
--→ 24 _mod = imp.load_module('_app’, fp, pathname, description)
25 finally:
26 fp.close()

ImportError: dlopen(/usr/local/gamma/lib/python2.7/site-packages/gammalib/_app.so, 2): Library not loaded: libreadline.6.2.dylib
Referenced from: /usr/local/gamma/lib/python2.7/site-packages/gammalib/_app.so
Reason: no suitable image found. Did find:Tha
/Users/emmadeonawilhelmi/anaconda/lib/libreadline.6.2.dylib/libreadline.6.2.dylib: stat() failed with errno=20

But it seems to be some incompatibility between my version of the readline library in condo and the one in gammalib. Any idea what might be going on?

Thanks a lot for your help!
Best
Emma


Recurrence

No recurrence.

History

#1 Updated by de Ona Wilhelmi Emma over 6 years ago

Solved by Jurgen Knodlseder:

setenv DYLD_LIBRARY_PATH $ANACONDA_PATH/anaconda/lib/:$DYLD_LIBRARY_PATH

#2 Updated by Kelley-Hoskins Nathan over 6 years ago

I tried adding the miniconda lib path to DYLD_LIBRARY_PATH, but I still can’t import gammalib.

$ echo $DYLD_LIBRARY_PATH 
/Users/nkelhos/Software/miniconda3/lib:/Users/nkelhos/Software/gammalib-git/lib
$ python
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec  7 2015, 11:24:55) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gammalib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/__init__.py", line 4, in <module>
    from gammalib.app import *
  File "/Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/app.py", line 28, in <module>
    _app = swig_import_helper()
  File "/Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/app.py", line 24, in swig_import_helper
    _mod = imp.load_module('_app', fp, pathname, description)
  File "/Users/nkelhos/Software/miniconda3/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/nkelhos/Software/miniconda3/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/_app.cpython-35m-darwin.so, 2): Symbol not found: __ZN10GException12out_of_rangeC1ESsii
  Referenced from: /Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/_app.cpython-35m-darwin.so
  Expected in: dynamic lookup
$ conda --version
conda 3.18.9

#3 Updated by de Ona Wilhelmi Emma over 6 years ago

Hi, same here, I get similar error:

Emmas-MacBook-Pro:/usr/local/gammalib-0.11.0> ipython
Python 2.7.11 |Anaconda 2.1.0 (x86_64)| (default, Dec 6 2015, 18:57:58)
Type “copyright”, “credits” or “license” for more information.

IPython 4.0.1 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about 'object’, use 'object??' for extra details.

In [1]: import gammalib
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-e04cb6bbc9a5> in <module>()
---→ 1 import gammalib

/usr/local/gamma/lib/python2.7/site-packages/gammalib/__init__.py in <module>()
2 # Please do not modify, unless you exactly know what you do.
3 all = ['GApplication’, 'GApplicationPar’, 'GApplicationPars’, 'GArf’, 'GBase’, 'GBilinear’, 'GCOMEventBin’, 'GCOMEventCube’, 'GCOMInstDir’, 'GCOMModelDRBFitting’, 'GCOMObservation’, 'GCOMResponse’, 'GCTAAeff’, 'GCTAAeff2D’, 'GCTAAeffArf’, 'GCTAAeffPerfTable’, 'GCTABackground’, 'GCTABackground3D’, 'GCTABackgroundPerfTable’, 'GCTACubeBackground’, 'GCTACubeExposure’, 'GCTACubePsf’, 'GCTAEdisp’, 'GCTAEdisp2D’, 'GCTAEdispPerfTable’, 'GCTAEdispRmf’, 'GCTAEventAtom’, 'GCTAEventBin’, 'GCTAEventCube’, 'GCTAEventList’, 'GCTAInstDir’, 'GCTAModelAeffBackground’, 'GCTAModelCubeBackground’, 'GCTAModelIrfBackground’, 'GCTAModelRadial’, 'GCTAModelRadialAcceptance’, 'GCTAModelRadialGauss’, 'GCTAModelRadialPolynom’, 'GCTAModelRadialProfile’, 'GCTAModelRadialRegistry’, 'GCTAObservation’, 'GCTAOnOffObservation’, 'GCTAOnOffObservations’, 'GCTAPointing’, 'GCTAPsf’, 'GCTAPsf2D’, 'GCTAPsfKing’, 'GCTAPsfPerfTable’, 'GCTAPsfVector’, 'GCTAResponse’, 'GCTAResponseCube’, 'GCTAResponseIrf’, 'GCTAResponseTable’, 'GCTARoi’, 'GCaldb’, 'GContainer’, 'GCsv’, 'GDerivative’, 'GEbounds’, 'GEnergies’, 'GEnergy’, 'GEvent’, 'GEventAtom’, 'GEventBin’, 'GEventCube’, 'GEventList’, 'GEvents’, 'GFits’, 'GFitsAsciiTable’, 'GFitsBinTable’, 'GFitsHDU’, 'GFitsHeader’, 'GFitsHeaderCard’, 'GFitsImage’, 'GFitsImageByte’, 'GFitsImageDouble’, 'GFitsImageFloat’, 'GFitsImageLong’, 'GFitsImageLongLong’, 'GFitsImageSByte’, 'GFitsImageShort’, 'GFitsImageULong’, 'GFitsImageUShort’, 'GFitsTable’, 'GFitsTableBitCol’, 'GFitsTableBoolCol’, 'GFitsTableByteCol’, 'GFitsTableCDoubleCol’, 'GFitsTableCFloatCol’, 'GFitsTableCol’, 'GFitsTableDoubleCol’, 'GFitsTableFloatCol’, 'GFitsTableLongCol’, 'GFitsTableLongLongCol’, 'GFitsTableShortCol’, 'GFitsTableStringCol’, 'GFitsTableULongCol’, 'GFitsTableUShortCol’, 'GFunction’, 'GGti’, 'GHealpix’, 'GHorizDir’, 'GInstDir’, 'GIntegral’, 'GLATAeff’, 'GLATEdisp’, 'GLATEventAtom’, 'GLATEventBin’, 'GLATEventCube’, 'GLATEventList’, 'GLATInstDir’, 'GLATLtCube’, 'GLATMeanPsf’, 'GLATObservation’, 'GLATPsf’, 'GLATResponse’, 'GLATRoi’, 'GLog’, 'GMWLDatum’, 'GMWLObservation’, 'GMWLSpectrum’, 'GMatrix’, 'GMatrixBase’, 'GMatrixSparse’, 'GMatrixSymmetric’, 'GModel’, 'GModelData’, 'GModelPar’, 'GModelRegistry’, 'GModelSky’, 'GModelSpatial’, 'GModelSpatialDiffuse’, 'GModelSpatialDiffuseConst’, 'GModelSpatialDiffuseCube’, 'GModelSpatialDiffuseMap’, 'GModelSpatialElliptical’, 'GModelSpatialEllipticalDisk’, 'GModelSpatialEllipticalGauss’, 'GModelSpatialPointSource’, 'GModelSpatialRadial’, 'GModelSpatialRadialDisk’, 'GModelSpatialRadialGauss’, 'GModelSpatialRadialShell’, 'GModelSpatialRegistry’, 'GModelSpectral’, 'GModelSpectralBrokenPlaw’, 'GModelSpectralConst’, 'GModelSpectralExpPlaw’, 'GModelSpectralFunc’, 'GModelSpectralGauss’, 'GModelSpectralLogParabola’, 'GModelSpectralNodes’, 'GModelSpectralPlaw’, 'GModelSpectralPlaw2’, 'GModelSpectralRegistry’, 'GModelSpectralSuperExpPlaw’, 'GModelTemporal’, 'GModelTemporalConst’, 'GModelTemporalRegistry’, 'GModels’, 'GNodeArray’, 'GObservation’, 'GObservationRegistry’, 'GObservations’, 'GOptimizer’, 'GOptimizerFunction’, 'GOptimizerLM’, 'GOptimizerPar’, 'GOptimizerPars’, 'GPha’, 'GPhoton’, 'GPhotons’, 'GPythonTestSuite’, 'GRan’, 'GRegistry’, 'GResponse’, 'GRmf’, 'GRoi’, 'GSkyDir’, 'GSkyMap’, 'GSkyPixel’, 'GSkyProjection’, 'GSkyRegion’, 'GSkyRegionCircle’, 'GSkyRegions’, 'GSource’, 'GTestCase’, 'GTestSuite’, 'GTestSuites’, 'GTime’, 'GTimeReference’, 'GTimes’, 'GUrl’, 'GUrlFile’, 'GUrlString’, 'GVOClient’, 'GVOHub’, 'GVector’, 'GWcs’, 'GWcsAIT’, 'GWcsAZP’, 'GWcsCAR’, 'GWcsMER’, 'GWcsMOL’, 'GWcsRegistry’, 'GWcsSTG’, 'GWcsTAN’, 'GXml’, 'GXmlAttribute’, 'GXmlComment’, 'GXmlDocument’, 'GXmlElement’, 'GXmlNode’, 'GXmlPI’, 'GXmlText’]
---→ 4 from gammalib.app import *
5 from gammalib.base import *
6 from gammalib.fits import *

/usr/local/gamma/lib/python2.7/site-packages/gammalib/app.py in <module>()
26 fp.close()
27 return _mod
--→ 28 _app = swig_import_helper()
29 del swig_import_helper
30 else:

/usr/local/gamma/lib/python2.7/site-packages/gammalib/app.py in swig_import_helper()
22 if fp is not None:
23 try:
--→ 24 _mod = imp.load_module('_app’, fp, pathname, description)
25 finally:
26 fp.close()

ImportError: dlopen(/usr/local/gamma/lib/python2.7/site-packages/gammalib/_app.so, 2): Symbol not found: __ZN10GException12out_of_rangeC1ESsii
Referenced from: /usr/local/gamma/lib/python2.7/site-packages/gammalib/_app.so
Expected in: dynamic lookup

Thanks
Emma

#4 Updated by Knödlseder Jürgen over 6 years ago

Sorry for the lazy reaction, I took a week off for vacations.

Nathan, can you provide the output of

otool -L /Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/_app.cpython-35m-darwin.so

Ona, can you do the same for
otool -L /usr/local/gamma/lib/python2.7/site-packages/gammalib/_app.so

(the symbol that is missing is in the libgamma library; for some reason he cannot find that library).

#5 Updated by Knödlseder Jürgen over 6 years ago

  • Status changed from New to In Progress
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 10

I could reproduce the problem here on a virtual Mac OS X using Anaconda (hence don’t need the otool outputs). It seems to be linked to Anaconda. So far no clue what is going on, I’m working on that.

#6 Updated by Knödlseder Jürgen over 6 years ago

For reference:

$ otool -L /Users/cta/test/install/lib/python2.7/site-packages/gammalib/_app.so
/Users/cta/test/install/lib/python2.7/site-packages/gammalib/_app.so:
    /Users/cta/test/install/lib/libgamma.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/cfitsio/lib/libcfitsio.2.dylib (compatibility version 2.0.0, current version 2.3.37)
    libreadline.6.2.dylib (compatibility version 6.0.0, current version 6.2.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

and
$ export DYLD_LIBRARY_PATH=/anaconda/lib
$ $ python
Python 2.7.11 |Anaconda 2.4.1 (x86_64)| (default, Dec  6 2015, 18:57:58) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import gammalib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/cta/test/install/lib/python2.7/site-packages/gammalib/__init__.py", line 4, in <module>
    from gammalib.app import *
  File "/Users/cta/test/install/lib/python2.7/site-packages/gammalib/app.py", line 28, in <module>
    _app = swig_import_helper()
  File "/Users/cta/test/install/lib/python2.7/site-packages/gammalib/app.py", line 24, in swig_import_helper
    _mod = imp.load_module('_app', fp, pathname, description)
ImportError: dlopen(/Users/cta/test/install/lib/python2.7/site-packages/gammalib/_app.so, 2): Symbol not found: __ZN10GException12out_of_rangeC1ESsii
  Referenced from: /Users/cta/test/install/lib/python2.7/site-packages/gammalib/_app.so
  Expected in: dynamic lookup

#7 Updated by Knödlseder Jürgen over 6 years ago

Note that the name mangling seems a bit special:


$ nm /Users/cta/test/install/lib/libgamma.0.dylib | grep ZN10GException12out_of_range
000000000002b330 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEddd
000000000002b510 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEii
000000000002b090 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiii
000000000002b860 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiiii
0000000000001680 T __ZN10GException12out_of_rangeC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKiSB_S9_
000000000002b0a0 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEddd
000000000002b340 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEii
000000000002ae50 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiii
000000000002b520 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiiii
0000000000001220 T __ZN10GException12out_of_rangeC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKiSB_S9_
0000000000002b10 t __ZN10GException12out_of_rangeD0Ev
0000000000002b00 t __ZN10GException12out_of_rangeD1Ev

while on my Mac (OS X 10.6) I get
00000000000214b0 T __ZN10GException12out_of_rangeC1ERKSsS2_RKiS4_S2_
000000000004e6b0 T __ZN10GException12out_of_rangeC1ESsddd
000000000004e370 T __ZN10GException12out_of_rangeC1ESsii
000000000004e9c0 T __ZN10GException12out_of_rangeC1ESsiii
000000000004e120 T __ZN10GException12out_of_rangeC1ESsiiii
0000000000020ab0 T __ZN10GException12out_of_rangeC2ERKSsS2_RKiS4_S2_
000000000004e380 T __ZN10GException12out_of_rangeC2ESsddd
000000000004e130 T __ZN10GException12out_of_rangeC2ESsii
000000000004e6c0 T __ZN10GException12out_of_rangeC2ESsiii
000000000004dc90 T __ZN10GException12out_of_rangeC2ESsiiii
0000000000022d80 T __ZN10GException12out_of_rangeD0Ev
0000000000022db0 T __ZN10GException12out_of_rangeD1Ev

#8 Updated by Knödlseder Jürgen over 6 years ago

  • % Done changed from 10 to 20

It looks like the name mangling is the problem. On Mac OS X 10.10 without Anaconda, the gammalib library also has the long names

$ nm /Users/cta/test/install/lib/libgamma.0.dylib | grep ZN10GException12out_of_range
000000000002b330 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEddd
000000000002b510 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEii
000000000002b090 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiii
000000000002b860 T __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiiii
0000000000001680 T __ZN10GException12out_of_rangeC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKiSB_S9_
000000000002b0a0 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEddd
000000000002b340 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEii
000000000002ae50 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiii
000000000002b520 T __ZN10GException12out_of_rangeC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiiii
0000000000001220 T __ZN10GException12out_of_rangeC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKiSB_S9_
0000000000002b10 t __ZN10GException12out_of_rangeD0Ev
0000000000002b00 t __ZN10GException12out_of_rangeD1Ev

but these long names are also present in the Python module
$ nm /Users/cta/test/install/lib/python2.7/site-packages/gammalib/_app.so | grep ZN10GException12out_of_range
                 U __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEii
0000000000018f0e t __ZN10GException12out_of_rangeD1Ev

On a system with Anaconda installed, one gets
$ nm /Users/cta/test/install/lib/python2.7/site-packages/gammalib/_app.so | grep ZN10GException12out_of_range
                 U __ZN10GException12out_of_rangeC1ESsii
000000000001c4a0 T __ZN10GException12out_of_rangeD1Ev

hence the name in the Python module differs from the name in the library.

#9 Updated by Knödlseder Jürgen over 6 years ago

The compilation of the code is different. Without Anaconda the cc compiler and c++ linker are used:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I../include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gammalib/app_wrap.cpp -o build/temp.macosx-10.10-intel-2.7/gammalib/app_wrap.o
c++ -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.10-intel-2.7/gammalib/app_wrap.o -L../src/.libs -L../src/.libs -L/Users/cta/test/install/lib -lgamma -lcfitsio -lreadline -lncurses -o build/lib.macosx-10.10-intel-2.7/gammalib/_app.so
$ cc --version
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

With Anaconda, the gcc compiler and g++ linker are used:
gcc -fno-strict-aliasing -I//anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../include -I//anaconda/include/python2.7 -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I//anaconda/include/python2.7 -c gammalib/app_wrap.cpp -o build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o
g++ -bundle -undefined dynamic_lookup -L//anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o -L../src/.libs -L//anaconda/lib -L../src/.libs -L/Users/cta/test/install/lib -lgamma -lcfitsio -lreadline -lncurses -o build/lib.macosx-10.5-x86_64-2.7/gammalib/_app.so
$ gcc -help
OVERVIEW: clang LLVM compiler

#10 Updated by Knödlseder Jürgen over 6 years ago

Coming back to the readline problem, Anaconda apparently replaces /usr/lib/libedit.3.dylib by libreadline.6.2.dylib:

$ otool -L src/.libs/libgamma.0.dylib 
src/.libs/libgamma.0.dylib:
    /Users/cta/test/install/lib/libgamma.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/local/opt/cfitsio/lib/libcfitsio.2.dylib (compatibility version 2.0.0, current version 2.3.37)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
$ otool -L pyext/build/gammalib/_app.so
pyext/build/gammalib/_app.so:
    /Users/cta/test/install/lib/libgamma.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/cfitsio/lib/libcfitsio.2.dylib (compatibility version 2.0.0, current version 2.3.37)
    libreadline.6.2.dylib (compatibility version 6.0.0, current version 6.2.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

Removing the -L//anaconda/lib linker argument when calling g++ resolves this issue:
$ g++ -bundle -undefined dynamic_lookup -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o -L../src/.libs -L../src/.libs -L/Users/cta/test/install/lib -lgamma -lcfitsio -lreadline -lncurses -o build/lib.macosx-10.5-x86_64-2.7/gammalib/_app.soCTAs-Mac-OS-X-2:pyext cta
$ otool -L build/lib.macosx-10.5-x86_64-2.7/gammalib/_app.sobuild/lib.macosx-10.5-x86_64-2.7/gammalib/_app.so:
    /Users/cta/test/install/lib/libgamma.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/cfitsio/lib/libcfitsio.2.dylib (compatibility version 2.0.0, current version 2.3.37)
    /usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

#11 Updated by Kelley-Hoskins Nathan over 6 years ago

I’ve got libreadline.6.2.dylib :

$ otool -L /Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/_app.cpython-35m-darwin.so

/Users/nkelhos/Software/gammalib-git/lib/python3.5/site-packages/gammalib/_app.cpython-35m-darwin.so:
    @rpath/libgamma.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /opt/local/lib/libcfitsio.dylib (compatibility version 0.0.0, current version 0.0.0)
    libreadline.6.2.dylib (compatibility version 6.0.0, current version 6.2.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 955.0.0)

#12 Updated by Knödlseder Jürgen over 6 years ago

Kelley-Hoskins Nathan wrote:

I’ve got libreadline.6.2.dylib :

[...]

Thanks. I solved the readline problem, but the missing symbol problem is really tricky. I keep investigating.

#14 Updated by Knödlseder Jürgen over 6 years ago

  • % Done changed from 20 to 50

Got it. It is again the “famous” MACOSX_DEPLOYMENT_TARGET environment variable that impacts how the compiler generates the code. Here the proof:

$ gcc -fno-strict-aliasing -I//anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../include -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I//anaconda/include/python2.7 -c gammalib/app_wrap.cpp -o build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o
$ nm build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o | grep ZN10GException12out_of_range
                 U __ZN10GException12out_of_rangeC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEii
00000000000c92e0 S __ZN10GException12out_of_rangeD1Ev
$ export MACOSX_DEPLOYMENT_TARGET=10.5
$ gcc -fno-strict-aliasing -I//anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../include -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I//anaconda/include/python2.7 -c gammalib/app_wrap.cpp -o build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o
$ nm build/temp.macosx-10.5-x86_64-2.7/gammalib/app_wrap.o | grep ZN10GException12out_of_range
                 U __ZN10GException12out_of_rangeC1ESsii
00000000000ca930 S __ZN10GException12out_of_rangeD1Ev

Anaconda’s Python is compiled for a MACOSX_DEPLOYMENT_TARGET=10.5, and this environment is used when compiling the swig extension.

For completeness: the name mangling has changed from Mac OS X 10.9 on (old was up to 10.8).

#15 Updated by Knödlseder Jürgen over 6 years ago

  • % Done changed from 50 to 60

I think I have fixed the gammalib problem. You may try and checkout the code from gitlab (devel branch).

I need to check whether ctools also has problems (probably).

#16 Updated by Knödlseder Jürgen over 6 years ago

  • Status changed from In Progress to Feedback

This should now be fixed for gammalib and ctools. Can you check whether it’s also okay on your side (devel branch)?

#17 Updated by Kelley-Hoskins Nathan over 6 years ago

With the latest pull, I was able to import gammalib and ctools in python again, so the problem is resolved for me.

#18 Updated by de Ona Wilhelmi Emma over 6 years ago

Kelley-Hoskins Nathan wrote:

With the latest pull, I was able to import gammalib and ctools in python again, so the problem is resolved for me.

Dear Jurgen,

thanks a lot and apologize for my late reaction. Only now I had time to try the develop version and I still have some problems, but this time of different nature. I tried to compile it and got:

GammaLib configuration summary ==============================
  • FITS I/O support (yes) /opt/local/lib /opt/local/include
  • Readline support (yes)
  • Ncurses support (yes)
  • Make Python binding (yes) use swig for building
  • Python (yes)
  • Python.h (yes)
    - Python wrappers (no)
  • swig (yes)
  • Multiwavelength interface (yes)
  • Fermi-LAT interface (yes)
  • CTA interface (yes)
  • COMPTEL interface (yes)
    - Doxygen (no)
  • Perform NaN/Inf checks (yes) (default)
  • Perform range checking (yes) (default)
  • Optimize memory usage (yes) (default)
    - Enable OpenMP (no)
    - Compile in debug code (no) (default)
    - Enable code for profiling (no) (default)

do I need to enable some of the (no) options? when I do make:

Emmas-MBP:/Users/emmadeonawilhelmi/gammalib> make
/Library/Developer/CommandLineTools/usr/bin/make all-recursive
Making all in include
make2: Nothing to be done for `all’.
Making all in inst
Making all in mwl
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLException.lo src/GMWLException.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLException.cpp -o src/.libs/GMWLException.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLException.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLObservation.lo src/GMWLObservation.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLObservation.cpp -o src/.libs/GMWLObservation.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLObservation.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLSpectrum.lo src/GMWLSpectrum.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLSpectrum.cpp -o src/.libs/GMWLSpectrum.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLSpectrum.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLDatum.lo src/GMWLDatum.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLDatum.cpp -o src/.libs/GMWLDatum.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLDatum.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLInstDir.lo src/GMWLInstDir.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLInstDir.cpp -o src/.libs/GMWLInstDir.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLInstDir.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLResponse.lo src/GMWLResponse.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLResponse.cpp -o src/.libs/GMWLResponse.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLResponse.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=link g++ -fPIC -L/opt/local/lib -o libmwl.la src/GMWLException.lo src/GMWLObservation.lo src/GMWLSpectrum.lo src/GMWLDatum.lo src/GMWLInstDir.lo src/GMWLResponse.lo -lstdc++ -ledit -lcurses -lcfitsio -lm
libtool: link: unsupported hardcode properties
libtool: link: See the libtool documentation for more information.
libtool: link: Fatal configuration error.
make3: * [libmwl.la] Error 1
make2:
[all-recursive] Error 1
make1:
[all-recursive] Error 1
make: *
[all] Error 2

Thanks again

Emma

#19 Updated by Knödlseder Jürgen over 6 years ago

de Ona Wilhelmi Emma wrote:

Kelley-Hoskins Nathan wrote:

With the latest pull, I was able to import gammalib and ctools in python again, so the problem is resolved for me.

Dear Jurgen,

thanks a lot and apologize for my late reaction. Only now I had time to try the develop version and I still have some problems, but this time of different nature. I tried to compile it and got:

GammaLib configuration summary ==============================
  • FITS I/O support (yes) /opt/local/lib /opt/local/include
  • Readline support (yes)
  • Ncurses support (yes)
  • Make Python binding (yes) use swig for building
  • Python (yes)
  • Python.h (yes)
    - Python wrappers (no)
  • swig (yes)
  • Multiwavelength interface (yes)
  • Fermi-LAT interface (yes)
  • CTA interface (yes)
  • COMPTEL interface (yes)
    - Doxygen (no)
  • Perform NaN/Inf checks (yes) (default)
  • Perform range checking (yes) (default)
  • Optimize memory usage (yes) (default)
    - Enable OpenMP (no)
    - Compile in debug code (no) (default)
    - Enable code for profiling (no) (default)

do I need to enable some of the (no) options? when I do make:

Emmas-MBP:/Users/emmadeonawilhelmi/gammalib> make
/Library/Developer/CommandLineTools/usr/bin/make all-recursive
Making all in include
make2: Nothing to be done for `all’.
Making all in inst
Making all in mwl
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLException.lo src/GMWLException.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLException.cpp -o src/.libs/GMWLException.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLException.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLObservation.lo src/GMWLObservation.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLObservation.cpp -o src/.libs/GMWLObservation.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLObservation.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLSpectrum.lo src/GMWLSpectrum.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLSpectrum.cpp -o src/.libs/GMWLSpectrum.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLSpectrum.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLDatum.lo src/GMWLDatum.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLDatum.cpp -o src/.libs/GMWLDatum.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLDatum.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLInstDir.lo src/GMWLInstDir.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLInstDir.cpp -o src/.libs/GMWLInstDir.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLInstDir.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c -o src/GMWLResponse.lo src/GMWLResponse.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLResponse.cpp -o src/.libs/GMWLResponse.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -I../../src/support -I../../inst/mwl/include -I/opt/local/include -fPIC -c src/GMWLResponse.cpp >/dev/null 2>&1
/bin/sh ../../libtool --tag=CXX --mode=link g++ -fPIC -L/opt/local/lib -o libmwl.la src/GMWLException.lo src/GMWLObservation.lo src/GMWLSpectrum.lo src/GMWLDatum.lo src/GMWLInstDir.lo src/GMWLResponse.lo -lstdc++ -ledit -lcurses -lcfitsio -lm
libtool: link: unsupported hardcode properties
libtool: link: See the libtool documentation for more information.
libtool: link: Fatal configuration error.
make3: * [libmwl.la] Error 1
make2:
[all-recursive] Error 1
make1:
[all-recursive] Error 1
make: *
[all] Error 2

Thanks again

Emma

Hi Emma,

I never have seen this before. It should not be related to any of the no’s you see.

Have you made a clean checkout of the code, run eventually ./autogen.sh, make clean before ./configure, or even delete the code and clone again?

If the problem persists, what is:
  • your libtool version
  • your autoconf version
  • your clang++ version

#20 Updated by de Ona Wilhelmi Emma over 6 years ago

Dear Jurgen,

the cleaning didnt help but I removed the old version and started a new one and it worked. I also compiled everything in bash instead of cshrc which might have some effect. Anyways, now it is nicely working, many thanks again for your help
Best
Emma

#21 Updated by Knödlseder Jürgen over 6 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 60 to 100

de Ona Wilhelmi Emma wrote:

Dear Jurgen,

the cleaning didnt help but I removed the old version and started a new one and it worked. I also compiled everything in bash instead of cshrc which might have some effect. Anyways, now it is nicely working, many thanks again for your help
Best
Emma

I suspect that something got mixed up. Good to see that it’s working now. I close the issue.

Also available in: Atom PDF