Open 0707yiliu opened 1 year ago
Hi @0707yiliu,
you did not mention if you already have CosseratPlugin
or not. It's an external plugin, so it does not come with Sofa. You need to compile it or get the binaries.
Yes, I have import the plugin into sofa, and using the cmake-gui to make the whole sofa like:
Adding plugin ArticulatedSystemPlugin SofaPython3 is compiled as a subproject to the external project 'Sofa'. Adding plugin SofaPython3 Python: Version: 3.9.12 Executable: /home/yi/anaconda3/envs/peginhole/bin/python3.9 Headers: /home/yi/anaconda3/envs/peginhole/include/python3.9 Libraries: /home/yi/anaconda3/envs/peginhole/lib/libpython3.9.so User site: /root/.local/lib/python3.9/site-packages pybind11: Version: 2.9.1 Config: /usr/lib/cmake/pybind11/pybind11Config.cmake Adding binding module SofaBaseTopology Adding binding module SofaDeformable Adding binding module SofaLinearSolver Adding binding module SofaConstraintSolver Adding binding module SofaGL Adding plugin SofaMatrix Adding plugin BeamAdapter Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/plugin.Cosserat/install/CosseratPlugin Adding plugin STLIB Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/STLIB/install/STLIB Adding plugin SoftRobots Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/STLIB/install/STLIB -- Found dependency : 'STLIB' plugin . Adding plugin CosseratPlugin Install prefix: /home/yi/sofa/build/v22.06/applications/plugins/plugin.Cosserat/install/CosseratPlugin -- Found dependency : 'STLIB' plugin . -- Found dependency: 'SoftRobots' plugin. -- Python3 packages will be installed. Adding application SceneChecking Adding application runSofa Write Plugin list at /home/yi/sofa/build/v22.06/lib/plugin_list.conf.default Configuring done CMake Warning at /usr/share/cmake-3.22/Modules/FindPython/Support.cmake:3330 (add_library): Cannot generate a safe runtime search path for target Bindings.SofaExporter because files in some directories may conflict with libraries in implicit directories:
runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/yi/anaconda3/envs/peginhole/lib
Some of these libraries may not be found correctly. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/FindPython.cmake:580 (__Python_add_library) applications/plugins/SofaPython3/CMake/SofaPython3Tools.cmake:125 (python_add_library) applications/plugins/SofaPython3/bindings/SofaExporter/CMakeLists.txt:18 (SP3_add_python_module)
Generating done
Hi, @alxbilger , one more thing I need to said that my system is Ubuntu22 and python3.9, I'm not sure whether it would produce bug or not.
Do you see the binary of the plugin in your build directory? It's the folder where you have the runSofa executable
Do you see the binary of the plugin in your build directory? It's the folder where you have the runSofa executable
Hi, @alxbilger . Do you means the CosseratPlugin's binary file? I installed the git-source file into sofa/src/applications/plugins/.
Yes, the binary file of the Cosserat plugin. It should be in bin
, in your build folder.
Hi, @alxbilger
I can not see any binary file about the Cosserat Plugin in this dir: build/v22.06/bin, which has runSofa and some plugins'test file such as BeamAdapter_test.
That is why SOFA cannot find the plugin. Check that you do compile the plugin.
It's weird, I can see the plugin has been imported into sofa in cmake-gui. But I can not see it in build/lib or build/bin
Updating...
the plugin has working, but the .so file (binary file) is generated in build/application/plugins dir, I copied it to build/lib dir which makes the sofa can search the plugin.
Second, the plugin's src/config and src/init file may has some problem? (I modified the project name to real name XXXplugin instead of @PROJECT_NAME@, otherwise, the sofa would get the plugin name like "@PROJECT_NAME@")
If you know what make it has the problem like above, please let me know.
Best
Yi
@0707yiliu thanks for reporting the issue. Indeed, there was a problem on the location of the plugin. This should be solved soon on the master branch.
I am not so sure about the project name. I was not able to reproduce the problem. At least, not on the master branch.
I‘m trying to add this plugin into the SofaGym-CartStemContactScene. When I import it into sofa without using the test selection, it's working.
And Using the SofaGym test_env.py to make env, it would feedback the error like: