-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About Raisim Torch Conflict #599
Comments
That is not how you should link raisim. Please check the CMake example here |
I changed Cmake to this and raisim works fine. cmake_minimum_required(VERSION 3.10) set(CMAKE_PREFIX_PATH "/home/deno/raisimLib/build") find_package(raisim CONFIG REQUIRED) include_directories (${EIGEN3_INCLUDE_DIRS}) add_executable(franka src/franka_1.cpp src/Franka_Library/Math_Functions.cpp src/Franka_Library/Kinematics_Dynamics.cpp) But when I add necessary lines for torch(shown below), I got an error again. cmake_minimum_required(VERSION 3.10) set(CMAKE_PREFIX_PATH "/home/deno/raisimLib/build" ; "/home/deno/libtorch") find_package(raisim CONFIG REQUIRED) include_directories (${EIGEN3_INCLUDE_DIRS}) add_executable(franka src/franka_1.cpp src/Franka_Library/Math_Functions.cpp src/Franka_Library/Kinematics_Dynamics.cpp) ""Error"" /usr/bin/ld: CMakeFiles/franka.dir/src/franka_1.cpp.o: in function |
I am not sure what the semi colon and quotation marks do in the target_link_libraries. Can you remove them? Also can you print out the list "${TORCH_LIBRARIES}"? |
I removed the semi colon and quotation marks. the only problem is in the target link libraries. It works fine just with raisim but when I add the Torch to that line, I got the error as "undefined reference". Also in the installation part of the libtorch, (https://pytorch.org/cppdocs/installing.html) I need to add torch library as this target_link_libraries(example-app "${TORCH_LIBRARIES}"). Find the print of the torch libraries below, -- raisim: I also added the updated version of CMake. |
Also when I just #include raisim and use functions as world etc. I can build the project without any error but when I add the line server.launchServer() I got the error that I mentioned below. /usr/bin/ld: CMakeFiles/franka.dir/src/franka_1.cpp.o: in function |
|
Thank you for the correction. I changed it to linux folder but it did not solve my problem. You can find the updated Cmake. |
Hi, have you solved this problem yet? I’m facing the same problem now. |
Sorry, I could not solve it. |
Hi,
I will implement a RL algorithm with using Raisim. For that I will use libtorch but when I try to link libraries I got error as shown below. I will also add my CMake file.
Both libtorch and raisim are working separately. But when I create my run.cpp file and add launchServer() line, I got similar errors. In this error it seems like, it could not find the raisim library but if I remove torch it works properly.
Is there any conflict between libraries? Thanks in advance.
Sincerely,
"""Error"""
/usr/bin/ld: CMakeFiles/run.dir/src/run.cpp.o: in function
raisim::World::exportToXml(std::string const&)': /home/deno/raisimLib/build/include/raisim/World.hpp:107: undefined reference to
raisim::World::exportToXml(std::string const&, std::string const&)'/usr/bin/ld: CMakeFiles/run.dir/src/run.cpp.o: in function
raisim::RaisimServer::processRequests()': /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1151: undefined reference to
raisim::World::addBox(double, double, double, double, std::string const&, unsigned long, unsigned long)'/usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1153: undefined reference to
raisim::World::addSphere(double, double, std::string const&, unsigned long, unsigned long)' /usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1155: undefined reference to
raisim::World::addCylinder(double, double, double, std::string const&, unsigned long, unsigned long)'/usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1157: undefined reference to
raisim::World::addCapsule(double, double, double, std::string const&, unsigned long, unsigned long)' /usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1159: undefined reference to
raisim::World::addMesh(std::string const&, double, double, std::string const&, unsigned long, unsigned long)'/usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1180: undefined reference to
raisim::World::addGround(double, std::string const&, unsigned long)' /usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1183: undefined reference to
raisim::World::addHeightMap(std::string const&, double, double, double, double, double, double, std::string const&, unsigned long, unsigned long)'/usr/bin/ld: /home/deno/raisimLib/build/include/raisim/RaisimServer.hpp:1186: undefined reference to `raisim::World::addArticulatedSystem(std::string const&, std::string const&, std::vector<std::string, std::allocatorstd::string > const&, unsigned long, unsigned long, raisim::ArticulatedSystemOption)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/run.dir/build.make:102: run] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/run.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
CMakeLists.txt
The text was updated successfully, but these errors were encountered: