erwincoumans / tiny-differentiable-simulator

Tiny Differentiable Simulator is a header-only C++ and CUDA physics library for reinforcement learning and robotics with zero dependencies.
Apache License 2.0
1.23k stars 130 forks source link

unable to use python bindings in linux #63

Closed arpit15 closed 3 years ago

arpit15 commented 3 years ago

I am able to run CPP examples after following the build instructions mentioned in the readme. However, I am unable to run python examples present in python/examples directory.

Setup steps

Usage

Error

Traceback (most recent call last):
  File "python/examples/billiard_optimization.py", line 7, in <module>
    import pytinyopengl3 as p
ModuleNotFoundError: No module named 'pytinyopengl3'

I do see libpytinydiffsim_dual.so libpytinydiffsim.so libpytinyopengl3.so in the build/python folder. It seems to that python is unable to load the modules.

Kindly let me know if there are other steps in using python bindings.

arpit15 commented 3 years ago

The problem was that the libraries had lib prefix before their names. I added the following 3 lines to the end of python/CMakeLists.txt to resolve the issue

SET_TARGET_PROPERTIES(pytinydiffsim PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(pytinydiffsim_dual PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(pytinyopengl3 PROPERTIES PREFIX "")