+1 vote

Hi, I am trying to install CADABRA2 in my computer, Ubuntu 18.04. I am doing it by following the instructions given in https://github.com/kpeeters/cadabra2/. Everything was going well until I typed in my terminal:

cmake ..
make

and a bunch of messages of the following type started to pop up:

/usr/local/lib/libpython3.7m.a(abstract.o): relocation RX866432S against symbol _Py_NotImplementedStruct' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libpython3.7m.a(boolobject.o): relocation R_X86_64_32S against symbolPyFalseStruct' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libpython3.7m.a(bytearrayobject.o): relocation R
X866432 against symbol _PyByteArray_empty_string' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libpython3.7m.a(bytesobject.o): relocation R_X86_64_32 against symbolPyNoneStruct' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libpython3.7m.a(call.o): relocation RX8664_32 against .rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC

etc,

I have been trying to find the main cause of the problem, but I did not succeed. Do you guys understand what it is going on? I would really appreciate any comments or suggestions which help me to fix this issue.

Surprising. I'll try on a clean 18.04 machine, hang on.

+1 vote

You are building against python3.7 which you installed yourself, right? (since it fetches libpython3.7m.a from /usr/local/lib).

Moreover, you are lacking the shared libraries, since it tries to link to the .a, not the .so. That by itself won't work; you need to link against shared libraries in order to produce the Python cadabra2.so module.

Any chance you can just build against stock python3.6 which comes with Ubuntu 18.04? I just tried that on a clean 18.04 install and it works fine. If that's not an option for you, you'll need to figure out why your python 3.7 installation does not have the shared libraries.

Hi Kasper,

Thanks for your answer. I tried to fix the python3.7 libraries by reconfiguring and updating them, and now the error message appears is the following

usr/local/lib/libpython3.7m.a(thread.o): In function PyThread_tss_create': /tmp/Python-3.7.2/Python/thread_pthread.h:750: undefined reference topthreadkeycreate'
/usr/local/lib/libpython3.7m.a(thread.o): In function PyThread_start_new_thread': /tmp/Python-3.7.2/Python/thread_pthread.h:222: undefined reference topthreadcreate'
pthread.h:239: undefined reference to pthread_detach' /usr/local/lib/libpython3.7m.a(thread.o): In functionPyThreadtssdelete':
/tmp/Python-3.7.2/Python/threadpthread.h:767: undefined reference to pthread_key_delete' /usr/local/lib/libpython3.7m.a(thread.o): In functionPyThreadacquirelocktimed':
/tmp/Python-3.7.2/Python/threadpthread.h:372: undefined reference to sem_wait' /tmp/Python-3.7.2/Python/thread_pthread.h:369: undefined reference tosemtrywait'
/tmp/Python-3.7.2/Python/threadpthread.h:369: undefined reference to sem_trywait' /usr/local/lib/libpython3.7m.a(thread.o): In functionPyThreadstartnewthread':
/tmp/Python-3.7.2/Python/threadpthread.h:203: undefined reference to pthread_attr_setstacksize' /usr/local/lib/libpython3.7m.a(thread.o): In functionPyThreadtssdelete':
pthread.h:767: undefined reference to pthread_key_delete' /usr/local/lib/libpython3.7m.a(thread.o): In functionpythreadpthreadsetstacksize':
/tmp/Python-3.7.2/Python/threadpthread.h:640: undefined reference to pthread_attr_setstacksize' /usr/local/lib/libpython3.7m.a(thread.o): In functionPyThreadcreatekey':
pthread.h:677: undefined reference to pthread_key_create' /tmp/Python-3.7.2/Python/thread_pthread.h:682: undefined reference topthreadkeydelete'
/usr/local/lib/libpython3.7m.a(thread.o): In function PyThread_set_key_value': /tmp/Python-3.7.2/Python/thread_pthread.h:712: undefined reference topthreadsetspecific'
/usr/local/lib/libpython3.7m.a(thread.o): In function PyThread_delete_key': /tmp/Python-3.7.2/Python/thread_pthread.h:696: undefined reference topthread
keydelete'
/usr/local/lib/libpython3.7m.a(thread.o): In function PyThread_delete_key_value': /tmp/Python-3.7.2/Python/thread_pthread.h:704: undefined reference topthread
setspecific'
/usr/local/lib/libpython3.7m.a(thread.o): In function PyThread_get_key_value': /tmp/Python-3.7.2/Python/thread_pthread.h:723: undefined reference topthreadgetspecific'
allocate_lock':

etc,

Following your suggestion, I started to look for websites where I can download the file libpython3.7m.so.1.0, but I did find anything useful.

I have also considered your suggestion of using python3.6 instead of python3.7, but it did not work, apparently I should make some modifications in the file CMakeCache.txt. Does this make sense for you?

It is still linking to the static version, so that will eventually break too. You are probably not building python3.7 for shared libraries, but without more details on how you install python3.7 I can't say.

Did you try simply install the cadabra2-2.2.9-bionic.deb package which you can download from the Cadabra web site? I uploaded that this morning after the successful build on Ubuntu 18.04.

Did you try simply install the cadabra2-2.2.9-bionic.deb package which you can download from the Cadabra web site? I uploaded that this morning after the successful build on Ubuntu 18.04.

Hi, yes that was my first option, but it didn't work (I click on the cadabra2 icon and it seems that it's loading but at the end it appears nothing). That's why I tried to install it step by step (manually). I just did it again, and unfortunately it's still not working.

What happens if you install the binary package and then start cadabra2 or cadabra2-gtk from a terminal window? Send me the error message.