Home › Forum › SOFA › Building SOFA › Setting up out-of-tree build & SofaPython 3 plugin
Tagged: 64_bits, Linux_ubuntu, Plugin_other, SOFA_1912, VS2019
- This topic has 24 replies, 5 voices, and was last updated 4 years, 1 month ago by PhoNguyen.
-
AuthorPosts
-
10 May 2020 at 22:45 #16084stonkensBlocked
Hi,
I have been using SOFA for the last half year and would like to start using the Python3 integration as it has a lot of interesting new features: https://github.com/SofaDefrost/plugin.SofaPython3
In the link, they recommend using an out-of-tree build if you want to maintain the possibility of using SofaPython plugin (the regular Python2 plugin). I have spent a significant amount of time trying to understand and implement an out-of-tree build, but am having some difficulty with it. Is there someone who could provide me with an easy-to-follow step-by-step process for this?
However, I went instead and did cmake and build without SofaPython plugin, but was faced with the error that I hadn’t set SOFA_ROOT when trying to import Sofa. I hence set SOFA_ROOT in my zshrc/bashrc file to [HOME_DIR]/dev/sofa/build/master but to no avail. I managed to successfully do import Sofa when adding the path [HOME_DIR]/dev/sofa/build/master/lib to PYTHONPATH in zshrc/bashrc file, but it gave the error ‘No module named Sofa.Helper’
Given my limited background in developing applications, it would be great to have some guidance on this. Thank you very much and I really appreciate the help
10 May 2020 at 22:47 #16148HugoKeymasterHi @stonkens
Your post was marked as spam. Sorry about the process delay.
We will get on your topic early this week.Hugo
11 May 2020 at 06:41 #16154jnbrunetModeratorHi @stonkens,
You can have a look at this thread, it should help you to set things right.
Let me know if you still have problem after this.
JN12 May 2020 at 22:10 #16175stonkensBlockedHi @jnbrunet,
Thank you very much for the detailed information. I have some errors, unfortunately. After git pull from master and adding the plugins I want (SoftRobots, ModelOrderReduction, STLIB, note that SoftRobots requires SofaPython) I got the following errors when building (running ninja command):
/usr/bin/ld: cannot find -lSofaComponentCommon
collect2: error: ld returned 1 exit statusI assume this is due to some mismatch between the Sofa versions –> Is there a way to use a released build of Sofa instead of pulling from master?
I also tried building without the test scripts (GTestMain etc.) but this gives error when running ninja on the SofaPython3 plugin (Step 2).
Sander
13 May 2020 at 09:16 #16176jnbrunetModeratorHey @stonkens,
Unfortunetly, the SofaPython3 plugin is following closely the master branch as it does not had an official release yet.
However, for this particular problem you have, it looks quite close to this thread.
You can deactivate the build of tests on SofaPython3 by setting the cmake variable
SP3_BUILD_TEST=OFF
.JN
13 May 2020 at 20:13 #16198stonkensBlockedHey @jnbrunet,
Thanks again for helping out. I am getting a better understanding of the inner workings, but still require some help unfortunately.
I am now at status with origin master branches for SoftRobots, Sofa, SofaPython3. I have successfully run build and complete Step 1.
For step 2 when configuring SofaPython3 I get the following error: CMake Error at /home/stonkens/dev/sofa/build/install/lib/cmake/SofaGui/SofaGuiConfig.cmake:43 (find_package): Found package configuration file: /home/stonkens/dev/sofa/build/install/lib/cmake/SofaMisc/SofaMiscConfig.cmake but it set SofaMisc_FOUND to FALSE so package "SofaMisc" is considered to be NOT FOUND. Reason given by package: The following imported targets are referenced, but are missing: SofaNonUniformFem Call Stack (most recent call first): bindings/SofaGui/CMakeLists.txt:15 (find_package)
I checked and SofaNonUniformFEM is in the plugins within $SOFA_BLD/install.
I have checked both the sofa forum and the issues on github but have not found a similar issue unfortunately.I’m happy to email instead (given this seems to be an issue that only I am having), which may allow for a bit faster debugging.
ST
EDIT: What might help, I get this warning when configuring in step 1 of your first linked post (building dev version of Sofa):
CMake Deprecation Warning at SofaAdvanced/CMakeLists.txt:15 (message): SofaAdvanced is deprecated. You should now explicitely find (find_package) and link (target_link_library) each module you need within: SofaNonUniformFem
13 May 2020 at 22:14 #16201jnbrunetModeratorHey @stonkens,
You are not the only one having this issue, it seems I also have it. Looks to be caused by a recent change merged yesterday in the master branch of SOFA.
SOFA has been undergoing a lot of refactoring these past weeks, its compilation and the one of the plugins are a little bit unstable at the moment.
I’ll look into it and and update this thread once I’ve made a PR fixing it (probably tomorrow).
J-N
14 May 2020 at 14:16 #16209jnbrunetModeratorPull request is here.
We need to wait for the tests to pass and a review before merging the fix, but you can already checkout the PR’s branch. SofaPython3’s master branch should compile correctly with this fix on SOFA.
19 May 2020 at 02:20 #16319stonkensBlockedThank you very much @jnbrunet.
Final question, splib (part of STLIB: Sofa Template library) has less functionality in SofaPython3. Is this done intentionally? Particularly, I rely on Vec3 and Quat classes –> I have found a workaround so definitely no need to resolve this, but was wondering what the underlying reason was.
Cheers,
Sander
19 May 2020 at 09:05 #16320jnbrunetModeratorHey @stonkens,
I haven’t worked with STLIB, therefore I cannot really say what have or have not been migrated from SofaPython to SofaPython3.
For these particular types, it seems there are some bindings in the SofaTypes modules.
$ python3 >>> import SofaTypes >>> print('\n'.join(dir(SofaTypes))) Mat1x1 Mat2x2 Mat3x3 Mat3x4 Mat4x4 Quat SofaTypes Vec10d Vec10i Vec11d Vec11i Vec12d Vec12i Vec1d Vec1i Vec2d Vec2i Vec3d Vec3i Vec4d Vec4i Vec5d Vec5i Vec6d Vec6i Vec7d Vec7i Vec8d Vec8i Vec9d Vec9i >>> help(SofaTypes.Quad) Help on class Quat in module SofaTypes.SofaTypes: class Quat(pybind11_builtins.pybind11_object) | Method resolution order: | Quat | pybind11_builtins.pybind11_object | builtins.object | | Methods defined here: (...) | __init__(...) | __init__(*args, **kwargs) | Overloaded function. | | 1. __init__(self: SofaTypes.SofaTypes.Quat) -> None | | 2. __init__(self: SofaTypes.SofaTypes.Quat, x: float, y: float, z: float, w: float) -> None | | 3. __init__(self: SofaTypes.SofaTypes.Quat, arg0: SofaTypes.SofaTypes.Quat) -> None | | 4. __init__(self: SofaTypes.SofaTypes.Quat, axis: sofa::defaulttype::Vec<3, double>, angle: float) -> None | | 5. __init__(self: SofaTypes.SofaTypes.Quat, arg0: list) -> None | | 6. __init__(self: SofaTypes.SofaTypes.Quat, vFrom: sofa::defaulttype::Vec<3, double>, vTo: sofa::defaulttype::Vec<3, double>) -> None | axisToQuat(...) | axisToQuat(self: SofaTypes.SofaTypes.Quat, a: sofa::defaulttype::Vec<3, double>, phi: float) -> SofaTypes.SofaTypes.Quat | | buildRotationMatrix(...) | buildRotationMatrix(self: SofaTypes.SofaTypes.Quat, arg0: SofaTypes.SofaTypes.Mat4x4) -> None | | clear(...) | clear(self: SofaTypes.SofaTypes.Quat) -> None | | fromFrame(...) | fromFrame(self: SofaTypes.SofaTypes.Quat, x: sofa::defaulttype::Vec<3, double>, y: sofa::defaulttype::Vec<3, double>, z: sofa::defaulttype::Vec<3, double>) -> None | | fromMatrix(...) | fromMatrix(self: SofaTypes.SofaTypes.Quat, m: SofaTypes.SofaTypes.Mat3x3) -> None | | identity(...) | identity() -> SofaTypes.SofaTypes.Quat | | inverse(...) | inverse(self: SofaTypes.SofaTypes.Quat) -> SofaTypes.SofaTypes.Quat | | inverseRotate(...) | inverseRotate(self: SofaTypes.SofaTypes.Quat, v: sofa::defaulttype::Vec<3, double>) -> sofa::defaulttype::Vec<3, double> | | normalize(...) | normalize(self: SofaTypes.SofaTypes.Quat) -> None | | quatToAxis(...) | quatToAxis(self: SofaTypes.SofaTypes.Quat, a: sofa::defaulttype::Vec<3, double>, phi: float) -> None | | rotate(...) | rotate(self: SofaTypes.SofaTypes.Quat, v: sofa::defaulttype::Vec<3, double>) -> sofa::defaulttype::Vec<3, double> | | set(...) | set(self: SofaTypes.SofaTypes.Quat, x: float, y: float, z: float, w: float) -> None | | size(...) | size() -> int (...)
There is not so much documentation on those classes, but I guess you can easily infer their functionalities from their method names and arguments.
Hope that helps !
J-N19 May 2020 at 15:11 #16324sescaidaBlockedHey @stonkens,
regarding your questions about splib (and STLIB): SPLIB basically has to be ported to python 3. For now SofaPython3’s functionality is mostly related to the bindings and scripting. We are slowly populating SPLIB with the functionality it had before. SPLIB is now a part of SP3 and there could eventually be a separate STLIB for python 3 to complement the SoftRobots plugin.
In any case, I think porting the code from the old STLIB (which includes SPLIB) should not be soo difficult. If you happen to do some porting for SPLIB, you can even create a pull-request!
Cheers
Stefan
27 May 2020 at 02:11 #16393stonkensBlockedThank you very much @jnbrunet and @secaida, this is all very helpful.
I will definitely make a PR if I port code to py3.
29 October 2020 at 14:45 #17472PhoNguyenBlockedHi @jnbrunet,
In compiling Sofapython3, I had successful config and generate Sofapython3 in linux 20.04. However, the error appeared after clicking “ninja”. This is comments on the terrminal.
FAILED: bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Mat.cpp.o /usr/bin/clang++-9 -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DBindings_SofaTypes_EXPORTS -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DNDEBUG -DSOFA_HAVE_SOFAPYTHON3 -I/home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src -I/home/pho/Desktop/SofaPython3/plugin.SofaPython3/Plugin/src -I/home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/Sofa/src -isystem /home/pho/anaconda3/include -isystem /usr/include/python3.8 -isystem /home/pho/Desktop/sofa/build/install/include/SofaFramework -isystem /home/pho/Desktop/sofa/build/install/include/extlibs/json -isystem /home/pho/Desktop/sofa/build/install/include/extlibs/GTest -isystem /usr/include/eigen3 -isystem /home/pho/Desktop/sofa/build/install/include/SofaSimulation -isystem /home/pho/Desktop/sofa/build/install/include/SofaBase -fPIC -fvisibility=hidden -std=c++17 -flto -fsized-deallocation -Dregister= -fvisibility=hidden -DFRAMEWORK_TEST_RESOURCES_DIR=\"/home/pho/Desktop/sofa/src/SofaKernel/SofaFramework/resources/tests\" -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -std=c++17 -MD -MT bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Mat.cpp.o -MF bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Mat.cpp.o.d -o bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Mat.cpp.o -c /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:214:9: error: no matching function for call to 'addMat' ::addMat(m, p); ^~~~~~~~ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:62:13: note: candidate template ignored: substitution failure : deduced non-type template argument does not have the same type as the corresponding template parameter ('unsigned long' vs 'int') static void addMat(py::module & /*m*/, py::class_<Mat<R, C, double>> &p) { ^ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:243:9: error: no matching function for call to 'addMat' ::addMat(m, p); ^~~~~~~~ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:62:13: note: candidate template ignored: substitution failure : deduced non-type template argument does not have the same type as the corresponding template parameter ('unsigned long' vs 'int') static void addMat(py::module & /*m*/, py::class_<Mat<R, C, double>> &p) { ^ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:272:9: error: no matching function for call to 'addMat' ::addMat(m, p); ^~~~~~~~ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:62:13: note: candidate template ignored: substitution failure : deduced non-type template argument does not have the same type as the corresponding template parameter ('unsigned long' vs 'int') static void addMat(py::module & /*m*/, py::class_<Mat<R, C, double>> &p) { ^ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:301:9: error: no matching function for call to 'addMat' ::addMat(m, p); ^~~~~~~~ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:62:13: note: candidate template ignored: substitution failure : deduced non-type template argument does not have the same type as the corresponding template parameter ('unsigned long' vs 'int') static void addMat(py::module & /*m*/, py::class_<Mat<R, C, double>> &p) { ^ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:330:9: error: no matching function for call to 'addMat' ::addMat(m, p); ^~~~~~~~ /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp:62:13: note: candidate template ignored: substitution failure : deduced non-type template argument does not have the same type as the corresponding template parameter ('unsigned long' vs 'int') static void addMat(py::module & /*m*/, py::class_<Mat<R, C, double>> &p) { ^ 5 errors generated. [2/4] Building CXX object bindings/Sof...ofaPython3/SofaTypes/Binding_Vec.cpp.o FAILED: bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Vec.cpp.o /usr/bin/clang++-9 -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DBindings_SofaTypes_EXPORTS -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DNDEBUG -DSOFA_HAVE_SOFAPYTHON3 -I/home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src -I/home/pho/Desktop/SofaPython3/plugin.SofaPython3/Plugin/src -I/home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/Sofa/src -isystem /home/pho/anaconda3/include -isystem /usr/include/python3.8 -isystem /home/pho/Desktop/sofa/build/install/include/SofaFramework -isystem /home/pho/Desktop/sofa/build/install/include/extlibs/json -isystem /home/pho/Desktop/sofa/build/install/include/extlibs/GTest -isystem /usr/include/eigen3 -isystem /home/pho/Desktop/sofa/build/install/include/SofaSimulation -isystem /home/pho/Desktop/sofa/build/install/include/SofaBase -fPIC -fvisibility=hidden -std=c++17 -flto -fsized-deallocation -Dregister= -fvisibility=hidden -DFRAMEWORK_TEST_RESOURCES_DIR=\"/home/pho/Desktop/sofa/src/SofaKernel/SofaFramework/resources/tests\" -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -std=c++17 -MD -MT bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Vec.cpp.o -MF bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Vec.cpp.o.d -o bindings/SofaTypes/CMakeFiles/Bindings.SofaTypes.dir/src/SofaPython3/SofaTypes/Binding_Vec.cpp.o -c /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Vec.cpp /home/pho/Desktop/SofaPython3/plugin.SofaPython3/bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Vec.cpp:186:47: error: no matching function for call to '__str__' p.def("__str__", [](VecClass &v) { return pyVec::__str__(v); });
Could you please help me to solve this problem?
Pho29 October 2020 at 17:06 #17473jnbrunetModeratorHi @nguyenvanpho,
Could you try to update both your SOFA and SofaPython3 source code from their respective master branches (i.e.
git checkout master && git pull
). Try cleaning any previous builds from both of them (i.e.rm -rf build/*
) and restart the compilations and installations (ninja install
).30 October 2020 at 10:18 #17475PhoNguyenBlockedHi @jnbrunet,
Thank you for your answer. I have no problem when compiling Sofa. But, i meet another problem when compiling SP3 at configure as folows:
How to solve this problem?
Best regards,
Pho30 October 2020 at 13:32 #17481jnbrunetModeratorHi @nguyenvanpho,
Looks like I cannot access your image. Could you paste the output somewhere else?
JN
30 October 2020 at 13:41 #17482PhoNguyenBlockedHi @jnbrunet,
Sorry, the error is:
CMake Error at Plugin/CMakeLists.txt:38 (find_package): Found package configuration file: /home/pho/Desktop/sofa/build/install/lib/cmake/SofaGeneral/SofaGeneralConfig.cmake but it set SofaGeneral_FOUND to FALSE so package "SofaGeneral" is considered to be NOT FOUND. Reason given by package: The following imported targets are referenced, but are missing: SofaGeneralMeshCollision SofaGeneralVisual SofaGraphComponent
It is also on this image:
file:///home/pho/Pictures/Screenshot%20from%202020-10-30%2018-12-33.pngSorry, I don’t know how to load an image from my computer to this forum.
Best,
Pho30 October 2020 at 13:52 #17484jnbrunetModeratorHey @nguyenvanpho,
That’s the inconvenient of following so closely a development branch, there are often bug introduced! This problem was introduced recently (last week) in SOFA and makes external plugins fail to find the modules of SOFA.
There’s a fix being made right now in SOFA, see this pull request. Hopefully it should be merged during our next SOFA developer meeting, next Wednesday. If you cannot wait until then, you can try to checkout the fix branch (in SOFA, not SP3):
git remote add fredroy https://github.com/fredroy/sofa.git git fetch fredroy git checkout -b fix_outoftree_compil
Sorry for this. We are working hard right now to make SOFA and SP3 stable and release a first version very soon.
30 October 2020 at 14:41 #17491PhoNguyenBlockedHi @jnbrunet,
Thank you for your explanation. I will wait for your next response.
Please answer me when you have a new solution after your team meeting.Best regards,
Pho2 November 2020 at 16:35 #17520jnbrunetModeratorHey @nguyenvanpho,
Simply to let you know that the merge has been made. You can now update your SP3 repository.
J-N
3 November 2020 at 07:40 #17529PhoNguyenBlockedHi @jnbrunet,
I followed your suggestion, but Cmake still showed errors in terminal ass follows:
pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ git remote add fredroy https://github.com/fredroy/sofa.git fatal: remote fredroy already exists. pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ git fetch fredroy pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ git checkout -b fix_outoftree_compil fatal: A branch named 'fix_outoftree_compil' already exists. pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ cd $SP3_BLD pho@pho:~/Desktop/plugin.SofaPython3/build$ cmake -DCMAKE_PREFIX_PATH=$SOFA_BLD/install/lib/cmake $SP3_SRC -- Python version: 3.8.2 -- Python executable: /usr/bin/python3 -- Python include dirs: /usr/include/python3.8 -- Python libraries: /usr/lib/x86_64-linux-gnu/libpython3.8.so -- Python user site: /home/pho/.local/lib/python3.8/site-packages -- pybind11 version: 2.5.0 -- pybind11 config: /home/pho/anaconda3/share/cmake/pybind11/pybind11Config.cmake Adding plugin SofaPython3 CMake Error at Plugin/CMakeLists.txt:38 (find_package): Found package configuration file: /home/pho/Desktop/sofa/build/install/lib/cmake/SofaGeneral/SofaGeneralConfig.cmake but it set SofaGeneral_FOUND to FALSE so package "SofaGeneral" is considered to be NOT FOUND. Reason given by package: The following imported targets are referenced, but are missing: SofaGeneralMeshCollision SofaGeneralVisual SofaGraphComponent -- Configuring incomplete, errors occurred! See also "/home/pho/Desktop/plugin.SofaPython3/build/CMakeFiles/CMakeOutput.log". See also "/home/pho/Desktop/plugin.SofaPython3/build/CMakeFiles/CMakeError.log". pho@pho:~/Desktop/plugin.SofaPython3/build$
This error is same as previous problem.
Best,
Pho3 November 2020 at 08:41 #17530jnbrunetModeratorHey @nguyenvanpho,
The fix has been merge in the master branch. Hence, you can do
$ cd $SP3_SRC $ git checkout master $ git pull $ cd $SP3_BLD $ cmake -DCMAKE_PREFIX_PATH=$SOFA_BLD/install/lib/cmake $SP3_SRC
J-N
3 November 2020 at 09:07 #17531PhoNguyenBlockedHi
It still same error:
pho@pho:~$ cd $SP3_SRC pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ git checkout master Switched to branch 'master' Your branch is up to date with 'origin/master'. pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ git pull Already up to date. pho@pho:~/Desktop/plugin.SofaPython3/SofaPython3$ cd $SP3_BLD pho@pho:~/Desktop/plugin.SofaPython3/build$ cmake -DCMAKE_PREFIX_PATH=$SOFA_BLD/install/lib/cmake $SP3_SRC -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.5", minimum required is "3.7") -- Python version: 3.8.5 -- Python executable: /usr/bin/python3 -- Python include dirs: /usr/include/python3.8 -- Python libraries: /usr/lib/x86_64-linux-gnu/libpython3.8.so -- Python user site: /home/pho/.local/lib/python3.8/site-packages -- pybind11 version: 2.5.0 -- pybind11 config: /home/pho/anaconda3/share/cmake/pybind11/pybind11Config.cmake Adding plugin SofaPython3 CMake Error at Plugin/CMakeLists.txt:38 (find_package): Found package configuration file: /home/pho/Desktop/sofa/build/install/lib/cmake/SofaGeneral/SofaGeneralConfig.cmake but it set SofaGeneral_FOUND to FALSE so package "SofaGeneral" is considered to be NOT FOUND. Reason given by package: The following imported targets are referenced, but are missing: SofaGeneralMeshCollision SofaGeneralVisual SofaGraphComponent -- Configuring incomplete, errors occurred! See also "/home/pho/Desktop/plugin.SofaPython3/build/CMakeFiles/CMakeOutput.log". See also "/home/pho/Desktop/plugin.SofaPython3/build/CMakeFiles/CMakeError.log". pho@pho:~/Desktop/plugin.SofaPython3/build$
Do I need to remove both sofa and SP3 and compile again?
Best,
Pho3 November 2020 at 09:13 #17533jnbrunetModeratorHey @nguyenvanpho,
My bad, the fix was in SOFA, not SP3. Hence got to your SOFA repository and do the
git pull
there.Also, make sure your SP3 origin is the one from sofa-framework, and not SofaDefrost, ie:
$ cd $SP3_SRC $ git remote -vv (..) origin git@github.com:sofa-framework/plugin.SofaPython3.git (..)
J-N
4 November 2020 at 07:32 #17544PhoNguyenBlockedHi @jnbrunet,
Thank you for your help. I met another error when click “ninja” after Cmake generation for SP3. The error in terminal was as follows:
pho@pho:~/Desktop/plugin.SofaPython3/build$ cmake -DCMAKE_PREFIX_PATH=$SOFA_BLD/install/lib/cmake $SP3_SRC -- Python version: 3.8.5 -- Python executable: /usr/bin/python3 -- Python include dirs: /usr/include/python3.8 -- Python libraries: /usr/lib/x86_64-linux-gnu/libpython3.8.so -- Python user site: /home/pho/.local/lib/python3.8/site-packages -- pybind11 version: 2.5.0 -- pybind11 config: /home/pho/anaconda3/share/cmake/pybind11/pybind11Config.cmake Adding plugin SofaPython3 Adding plugin SofaPython3_Bindings -- Python module 'Core' added to python3/site-packages/Sofa -- Python module 'Components' added to python3/site-packages/Sofa -- Python module 'Helper' added to python3/site-packages/Sofa -- Python module 'Simulation' added to python3/site-packages/Sofa -- Python module 'Types' added to python3/site-packages/Sofa -- Python package /home/pho/Desktop/plugin.SofaPython3/SofaPython3/bindings/Sofa/package added to directory python3/site-packages/Sofa -- Python package /home/pho/Desktop/plugin.SofaPython3/SofaPython3/bindings/SofaRuntime/package added to directory python3/site-packages/SofaRuntime -- Python module 'SofaRuntime' added to python3/site-packages/SofaRuntime -- Python module 'Gui' added to python3/site-packages/Sofa -- Python package /home/pho/Desktop/plugin.SofaPython3/SofaPython3/bindings/SofaTypes/package added to directory python3/site-packages/SofaTypes -- Python module 'SofaTypes' added to python3/site-packages/SofaTypes -- Python module 'SofaBaseTopology' added to python3/site-packages/Sofa Adding plugin SofaPython3_Examples Adding plugin SofaPython3_Docs -- Python package /home/pho/Desktop/plugin.SofaPython3/SofaPython3/splib added to directory python3/site-packages/splib -- Python package /home/pho/Desktop/plugin.SofaPython3/SofaPython3/constants added to directory python3/site-packages/Sofa/constants -- Configuring done -- Generating done -- Build files have been written to: /home/pho/Desktop/plugin.SofaPython3/build pho@pho:~/Desktop/plugin.SofaPython3/build$ make make: *** No targets specified and no makefile found. Stop. pho@pho:~/Desktop/plugin.SofaPython3/build$ ninja [1/7] Linking CXX executable bin/Bindings.SofaTypes.Tests FAILED: bin/Bindings.SofaTypes.Tests : && /usr/bin/c++ bindings/SofaTypes/tests/CMakeFiles/Bindings.SofaTypes.Tests.dir/PythonModule_SofaTypes_test.cpp.o -o bin/Bindings.SofaTypes.Tests -Wl,-rpath,/home/pho/Desktop/plugin.SofaPython3/build/lib:/home/pho/Desktop/sofa/build/install/lib: /home/pho/Desktop/sofa/build/install/lib/libSofaGTestMain.a lib/libSofaPython3.so /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationTree.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationGraph.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCommon.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationGraph.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCommon.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCore.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaCore.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaDefaultType.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaHelper.so.20.06.99 /home/pho/Desktop/sofa/build/install/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.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 -lpthread /usr/lib/x86_64-linux-gnu/libboost_atomic.so.1.71.0 /usr/lib/x86_64-linux-gnu/libpython3.8.so && : /usr/bin/ld: /home/pho/Desktop/sofa/build/install/lib/libSofaGTestMain.a(SofaGTestMain.cpp.o): relocation R_X86_64_32 against .bss can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status [2/7] Linking CXX executable bin/Bindings.SofaRuntime.Tests FAILED: bin/Bindings.SofaRuntime.Tests : && /usr/bin/c++ bindings/SofaRuntime/tests/CMakeFiles/Bindings.SofaRuntime.Tests.dir/PythonModule_SofaRuntime_test.cpp.o -o bin/Bindings.SofaRuntime.Tests -Wl,-rpath,/home/pho/Desktop/plugin.SofaPython3/build/lib/python3/site-packages/Sofa:/home/pho/Desktop/sofa/build/install/lib:/home/pho/Desktop/plugin.SofaPython3/build/lib: /home/pho/Desktop/sofa/build/install/lib/libSofaGTestMain.a lib/python3/site-packages/Sofa/Core.cpython-38-x86_64-linux-gnu.so /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationTree.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationGraph.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCommon.so.20.06.99 lib/libSofaPython3.so /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationGraph.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCommon.so.20.06.99 /usr/lib/x86_64-linux-gnu/libpython3.8.so /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationGraph.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaBaseVisual.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaBaseTopology.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCommon.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaSimulationCore.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaCore.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaDefaultType.so.20.06.99 /home/pho/Desktop/sofa/build/install/lib/libSofaHelper.so.20.06.99 /home/pho/Desktop/sofa/build/install/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.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 -lpthread /usr/lib/x86_64-linux-gnu/libboost_atomic.so.1.71.0 && : /usr/bin/ld: /home/pho/Desktop/sofa/build/install/lib/libSofaGTestMain.a(SofaGTestMain.cpp.o): relocation R_X86_64_32 against .bss can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status [6/7] Linking CXX shared library lib/python3/site-packages/SofaTypes/SofaTypes.cpython-38-x86_64-linux-gnu.so ninja: build stopped: subcommand failed.
How can we fix in this scenario?
Best,
Pho -
AuthorPosts
- You must be logged in to reply to this topic.