-
Hi @jnbrunet !
Any ideas? I tried to go back to the main branch, erase the build, and link again the site-packages but the same error is happening again. I only changed SofaCaribou, never SofaPython3 or Sofa. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey @Ziemnono ! Always good to see you posting here. This error you are having means that some bindings require SofaBaseLinearSolver.so but the latter cannot be found. My guess is that you would have the same error with SofaPython3 only, i.e. the following would cause the same error: $ python3 -c "import Sofa;print(Sofa);import SofaRuntime;print(SofaRuntime)" Is it the case? If so, a quick fix would be to tell LD (the linker that is trying to find the missing lib) where to find it. You can do so with the $ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SOFA_ROOT/lib" python3 manufactured_solution.py Did it help? |
Beta Was this translation helpful? Give feedback.
-
Hi @jnbrunet,
So apparently the linker can find the .so. So the problem is really specific to SofaCaribou:
For the second command line, it is working perfectly ! I included it in my bashrc file and no more problems :) Do you think there is a better fix or does it seem good enough? |
Beta Was this translation helpful? Give feedback.
-
Hey @Ziemnono Alright, I did some digging and I found what's the problem here. The caribou plugin is made to be install into the "plugins" directory of your SOFA installation. To be more precise, Caribou's binaries will search for SOFA's binaries by looking into parent folders and expecting to find SOFA root at some point. This search path is baked into the libraries (.so) during Caribou compilation. In your case, the "clean" solution is to copy or move Caribou installation directory into # Install Caribou into SOFA plugins
u@h:~/ $ export SOFA_ROOT=~/sofa/build/install
u@h:~/ $ export CARIBOU_ROOT=~/caribou/build/install
u@h:~/ $ cd ~/caribou/build
u@h:~/caribou/build $ cmake --build .
u@h:~/caribou/build $ cmake --install .
u@h:~/caribou/build $ mv install $SOFA_ROOT/plugins/SofaCaribou # <---- This is the relevant part # You can also do it with one step using:
u@h:~/caribou/build $ cmake --install . --prefix $SOFA_ROOT/plugins/SofaCaribou # Tell python where to find bindings
u@h:~/ $ export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages:$SOFA_ROOT/plugins/SofaCaribou/lib/python3/site-packages
u@h:~/ $ python3
Python 3.10.1 (main, Dec 9 2021, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Caribou
>>> import SofaCaribou
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/jnbrunet/sources/sofa/build/install
Warning: environment variable SOFAPYTHON3_ROOT is empty. Trying to guess it.
Guessed SOFAPYTHON3_ROOT: /home/jnbrunet/sources/sofa/build/install/plugins/SofaPython3
---------------------------------------
>>> Note that for some reason, we have to import Caribou before importing SofaCaribou, I will create an issue for this. |
Beta Was this translation helpful? Give feedback.
Hey @Ziemnono
Alright, I did some digging and I found what's the problem here. The caribou plugin is made to be install into the "plugins" directory of your SOFA installation. To be more precise, Caribou's binaries will search for SOFA's binaries by looking into parent folders and expecting to find SOFA root at some point. This search path is baked into the libraries (.so) during Caribou compilation.
In your case, the "clean" solution is to copy or move Caribou installation directory into
$SOFA_ROOT/plugins/SofaCaribou
and give this path to python: