Home › Forum › SofaPython3 › Getting Started › Error while compiling SOFA v2012 with Sofapython 3
Tagged: Sofa v20.12 error
- This topic has 9 replies, 5 voices, and was last updated 3 years, 9 months ago by jnbrunet.
-
AuthorPosts
-
29 January 2021 at 01:58 #18417nhnhanBlocked
Dear,
I have tried to compile the newest release of SOFA (v20.12) to play with Sofapython3. Everything looks good until i got this below error:FAILED: bin/Bindings.Sofa.Tests : && /usr/bin/clang++-11 -Wall -W -Wno-padded -O2 -g -DNDEBUG applications/plugins/SofaPython3/bindings/Sofa/tests/CMakeFiles/Bindings.Sofa.Tests.dir/PythonModule_Sofa_test.cpp.o applications/plugins/SofaPython3/bindings/Sofa/tests/CMakeFiles/Bindings.Sofa.Tests.dir/Binding_BaseObject_MockComponent.cpp.o -o bin/Bindings.Sofa.Tests -Wl,-rpath,/home/nhnhanbk/Desktop/sofa/build-v2012/lib:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: lib/libSofaGTestMain.a lib/libSofaPython3.so.1.0 lib/libSofaSimulationTree.so.20.12.00 lib/libSofaSimulationGraph.so.20.12.00 lib/libSofaSimulationCommon.so.20.12.00 lib/libSofaSimulationCore.so.20.12.00 lib/libSofaCore.so.20.12.00 lib/libSofaDefaultType.so.20.12.00 lib/libSofaHelper.so.20.12.00 lib/libgtest.so.2.6.2 /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/x86_64-linux-gnu/libGLEW.so /usr/lib/x86_64-linux-gnu/libboost_system.so /usr/lib/x86_64-linux-gnu/libboost_filesystem.so /usr/lib/x86_64-linux-gnu/libboost_program_options.so /usr/lib/x86_64-linux-gnu/libboost_thread.so /usr/lib/x86_64-linux-gnu/libboost_chrono.so /usr/lib/x86_64-linux-gnu/libboost_date_time.so /usr/lib/x86_64-linux-gnu/libboost_atomic.so -pthread /usr/lib/x86_64-linux-gnu/libpython2.7.so -Wl,-rpath-link,/home/nhnhanbk/Desktop/sofa/build-v2012/lib && : /usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to _Py_Dealloc' /usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to
PyUnicode_AsUTF8String’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `_Py_FalseStruct’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyException_SetTraceback’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `_PyThreadState_UncheckedGet’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PySlice_AdjustIndices’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyUnicode_DecodeUTF8′
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyUnicode_FromString’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyThread_tss_set’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyUnicode_FromStringAndSize’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyThread_tss_create’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyBytes_AsString’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyUnicode_DecodeLatin1′
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyInstanceMethod_New’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyMem_Calloc’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyBytes_Size’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyThread_tss_get’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyThread_tss_alloc’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyBytes_AsStringAndSize’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyUnicode_AsEncodedString’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `Py_DecodeLocale’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PySlice_Unpack’
/usr/bin/ld: lib/libSofaPython3.so.1.0: undefined reference to `PyInstanceMethod_Type’
clang: error: linker command failed with exit code 1 (use -v to see invocation)I just wonder that anyone has had this type of error before? or any advice to fix it will be also appreciated. Thank you very much
1 February 2021 at 10:12 #18452jnbrunetModeratorHey @nhnhan,
Did you compile the plugin within the compilation of SOFA or as an out-of-tree plugin? Are you compiling the SofaPython(2) plugin at the same time?
These errors looks to me as if you are linking against a wrong python version (python 2 maybe?). During the cmake configure stage, it should have a some information on which python version is used for the compilation, something like :
$ cmake .. (...) -- Python: Version: 3.9.1 Executable: /usr/bin/python3.9 Headers: /usr/include/python3.9 Libraries: /usr/lib64/libpython3.9.so User site: /home/jnbrunet/.local/lib/python3.9/site-packages (...) -- Configuring done -- Generating done
10 February 2021 at 05:21 #18562PhoNguyenBlockedHi,
I compile sofapython3 with sofa v20.12. There is one error as follows:
pho@pho:~/Desktop/plugin.SofaPython3/build$ cmake -DCMAKE_PREFIX_PATH=$SOFA_BLD/install/lib/cmake $SP3_SRC -- Python: Version: 3.9.1 Executable: /usr/bin/python3.9 Headers: /usr/include/python3.9 Libraries: /usr/lib/x86_64-linux-gnu/libpython3.9.so User site: /home/pho/.local/lib/python3.9/site-packages -- pybind11: Version: 2.5.0 Config: /home/pho/anaconda3/share/cmake/pybind11/pybind11Config.cmake -- SOFA Framework: Version: 20.12.00 Location: /home/pho/Desktop/sofa/build/install CMake Error at Plugin/CMakeLists.txt:39 (find_package): By not providing "FindSofaSimulationGraph.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SofaSimulationGraph", but CMake did not find one. Could not find a package configuration file provided by "SofaSimulationGraph" with any of the following names: SofaSimulationGraphConfig.cmake sofasimulationgraph-config.cmake Add the installation prefix of "SofaSimulationGraph" to CMAKE_PREFIX_PATH or set "SofaSimulationGraph_DIR" to a directory containing one of the above files. If "SofaSimulationGraph" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred!
How can I solve this problem?
Best,
Pho11 February 2021 at 15:35 #18569GuillaumeKeymasterHi Pho,
SofaSimulationGraph is now a plugin and is installed in
/plugins/SofaSimulationGraph In order to be able to find_package plugins, you must add
/plugins to CMAKE_PREFIX_PATH. Thus, in your case you should do:
cmake -DCMAKE_PREFIX_PATH="$SOFA_BLD/install/lib/cmake;$SOFA_BLD/install/plugins" $SP3_SRC
12 February 2021 at 06:39 #18627PhoNguyenBlockedHi Guillaume,
I tried your suggestion, and the errors came as follows:
pho@pho:~/Desktop/plugin.SofaPython3/build$ cmake -DCMAKE_PREFIX_PATH="$SOFA_BLD/install/lib/cmake;$SOFA_BLD/install/plugins" $SP3_SRC CMake Error at CMakeLists.txt:108 (find_package): Could not find a package configuration file provided by "pybind11" (requested version 2.3) with any of the following names: pybind11Config.cmake pybind11-config.cmake Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set "pybind11_DIR" to a directory containing one of the above files. If "pybind11" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/pho/Desktop/plugin.SofaPython3/SofaPython3/CMakeFiles/CMakeOutput.log". See also "/home/pho/Desktop/plugin.SofaPython3/SofaPython3/CMakeFiles/CMakeError.log". pho@pho:~/Desktop/plugin.SofaPython3/build$
Then I tried to fix this error in Cmake, the error appeared as my previous question.
How can I solve this problem?12 February 2021 at 10:33 #18662HugoKeymaster13 February 2021 at 08:08 #18663PhoNguyenBlockedHi @Hugo,
Yeap, I installed pybind11 version 2.5.0 as shown in my question (10 February 2021).
-- pybind11: Version: 2.5.0 Config: /home/pho/anaconda3/share/cmake/pybind11/pybind11Config.cmake -- SOFA Framework: Version: 20.12.00 Location: /home/pho/Desktop/sofa/build/install
However, when I run this command
cmake -DCMAKE_PREFIX_PATH="$SOFA_BLD/install/lib/cmake;$SOFA_BLD/install/plugins" $SP3_SRC
Sofa cannot detect pybind11.
Best,
Pho13 February 2021 at 15:59 #18664jnbrunetModeratorHey Pho,
Something does not seems right here.
First, concerning your first question, you should not have to add
$SOFA_BLD/install/plugins
to the cmake prefix path, as this should already be done by the SOFA’s cmake macro. I’m guessing you are on the master branch of SofaPython3, while being on the v20.12 branch of SOFA, since the pluginization of SofaSimulationGraph didn’t make it in the release, hence the cmake error. You need to checkout v20.12 on SofaPython3 as well.Next, how is cmake able to output you the version and path of pybind11 if he cannot find it? My guest is that you had previously manually set the cmake path of pybind11 since the latter isn’t installed in a standard path (anaconda) and cmake probably has no idea it exists there.
Could you try the following:
$ cd ~/Desktop/plugin.SofaPython3 $ git checkout v20.12 $ rm -rf build && mkdir build $ cd build $ cmake -DCMAKE_PREFIX_PATH="$SOFA_BLD/install/lib/cmake;/home/pho/anaconda3/share" ..
And let us know how it goes.
J-N
14 February 2021 at 03:40 #18665PhoNguyenBlockedHi @jnbrunet,
Thank you for your help.
It is still error:pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ git checkout v20.12 Already on 'v20.12' Your branch is up to date with 'origin/v20.12'. pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ rm -rf build && mkdir build pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ cd build pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3/build$ cmake -DCMAKE_PREFIX_PATH="$SOFA_BLD/install/lib/cmake;/home/pho/anaconda3/share" .. CMake Error at CMakeLists.txt:108 (find_package): Could not find a package configuration file provided by "pybind11" (requested version 2.3) with any of the following names: pybind11Config.cmake pybind11-config.cmake Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set "pybind11_DIR" to a directory containing one of the above files. If "pybind11" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/pho/Desktop/plugin.SofaPython3/SofaPython3/CMakeFiles/CMakeOutput.log". See also "/home/pho/Desktop/plugin.SofaPython3/SofaPython3/CMakeFiles/CMakeError.log". pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3/build$
14 February 2021 at 15:21 #18666jnbrunetModeratorHi Pho,
Did you remove your pybind11 previously installed by anaconda? Looks like this file should exists:
/home/pho/anaconda3/share/cmake/pybind11/pybind11Config.cmake
Is this still the case?
In any case, I would suggest you install pybind11 using your system package manager instead of anaconda:
# Ubuntu $ sudo apt install pybind11-dev # Fedora $ sudo dnf install pybind11-devel # MacOS $ brew install pybind11
-
AuthorPosts
- You must be logged in to reply to this topic.