Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

Hi, I had a working installation of cadabra2 installed from the github repo on my laptop (running Debian bullseye), and it seems that after an update of the system my cadabra2 installation got broken.

I realise the trouble when trying to use the function isolate from cdb.core.manip module. The message was:

ModuleNotFoundError: No module named 'gmpy2.gmpy2'

At:
  /usr/lib/python3/dist-packages/gmpy2/__init__.py(1): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /home/oscar/.config/cadabra_packages/cdb/core/manip.py(80): get_factor
  /home/oscar/.config/cadabra_packages/cdb/core/manip.py(156): isolate
  <string>(3): <module>

I checked that the package gmpy2 was installed:

$ aptitude search gmpy2
i A python-gmpy2-common                       - common files for python3-gmpy2                      
p   python-gmpy2-doc                          - documentation for python-gmpy2                      
i   python3-gmpy2                             - interfaces GMP to Python 3 for fast, unbound-precisi
v   python3.8-gmpy2                           -  

So, my first thought was that reinstalling cadabra2 after pulling the source code could solve the problem, but the compilation failed at make (notice that cmake .. was completed) returning the message:

/usr/bin/ld: cannot find -lpython3.7m
collect2: error: ld returned 1 exit status
make[2]: *** [client_server/CMakeFiles/cadabra2latex.dir/build.make:104: client_server/cadabra2latex] Error 1
make[1]: *** [CMakeFiles/Makefile2:618: client_server/CMakeFiles/cadabra2latex.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Any ideas on what is going on?

in Installation trouble by (15.0k points)

2 Answers

+1 vote
 
Best answer

Can you please pull from github once more and try on Debian again? I have updated pybind11, which seems to have fixed the issue with attempting to link to the wrong python library. It builds here fine on a clean Debian bullseye installation.

by (82.6k points)
selected by

Thank you very much Kasper, once again you've solved my problems!

+1 vote

For the first problem, can you try removing the /home/oscar/.config/cadabra_packages/ directory, to force cadabra to reconvert the packages?

If that does not work, send me the /home/oscar/.config/cadabra_packages/cdb/core/manip.py file by email.

For the second problem, are you sure that you started with an empty build directory? cmake caches all sorts of things, and if you still had leftovers from a previous run (possibly on an earlier Debian version), then all sorts of things can go wrong.

by (82.6k points)
...