You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After this I was able to compile but in python I was not able to import srwlib due to wrong linking.
In ipython console I was getting this error:
import srwlpy
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
This was caused by linking of the srwlib.o to wrong python. Using otool I could se this output:
srwlpy.so:
srwlpy.so (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
/opt/local/lib/libgcc/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
So the linking to /System/Library/ .... /2.7/Python is wrong .... this I was able to fix my manual relinking using install_name_tool:
Now using otool linking was done correctly and srwlib can be imported to python:
otool -L srwlpy.so
srwlpy.so:
srwlpy.so (compatibility version 0.0.0, current version 0.0.0)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
/opt/local/lib/libgcc/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
The text was updated successfully, but these errors were encountered:
Compilation and link errors have been fixed for OSX 10.9 using the macport python 2.7 distribution ...
During compiling the sources of SRW I was getting following errors:
g++ -shared -O3 -fPIC -I..//src/core -I..//src/lib -I..//src/ext/auxparse -I..//src/ext/genmath -D_GNU_SOURCE -D__USE_XOPEN2K8 -DFFTW_ENABLE_FLOAT -D_GM_WITHOUT_BASE -DSRWLIB_STATIC -DNO_TIMER -DANSI_DECLARATORS -DTRILIBRARY -DLINUX -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 -o srwlpy.so ../src/clients/python/srwlpy.cpp libsrw.a -L..//../ext_lib -lm -lfftw
Undefined symbols for architecture x86_64:
"_PyArg_ParseTuple", referenced from:
This was fixed by adding -lpython2.7 into PYFLAGS in the srw makefile:
PYFLAGS= -I$(PYPATH)/include/python2.7 -L$(PYPATH)/lib/python2.7 -lpython2.7
After this I was able to compile but in python I was not able to import srwlib due to wrong linking.
In ipython console I was getting this error:
import srwlpy
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
This was caused by linking of the srwlib.o to wrong python. Using otool I could se this output:
srwlpy.so:
srwlpy.so (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
/opt/local/lib/libgcc/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
So the linking to /System/Library/ .... /2.7/Python is wrong .... this I was able to fix my manual relinking using install_name_tool:
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python srwlpy.so
Now using otool linking was done correctly and srwlib can be imported to python:
otool -L srwlpy.so
srwlpy.so:
srwlpy.so (compatibility version 0.0.0, current version 0.0.0)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
/opt/local/lib/libgcc/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
The text was updated successfully, but these errors were encountered: