opensim-core
opensim-core copied to clipboard
How To Disable Certain Dependencies If Not Using Opensim Moco
Hello,
I am trying to build the latest opensim package for python via a docker image and am running into the following error:

Is there a way to disable the dependencies I don't need since I am not using Opensim Moco? Specifically in Ubuntu.
Thank you.
On opensim-core side. Turn off both Opensim_with_tropter and opensim_with_casadi
If this worked @dpar21 please let us know so we can update the documentation/cmake instructions and close this issue. @AlbertoCasasOrtiz Let's make sure this is documented in the build instructions on all platforms that you worked on. Thank you
Yes, this worked! Thank you @aymanhab!
Apologies, I did have one more issue when attempting to import opensim in python following only building Opensim without Moco:

Was wondering @aymanhab if this is happening because I have built Opensim without Moco functionality? The file does in fact exist in the specified location in the error.
Instead of building from scratch or using custom scripts, I suggest you use the official images published on dockerhub at https://hub.docker.com/repository/docker/stanfordnmbl/opensim-python Both 4.4 and 4.4-with-moco tags are available. Please let us know if they work for you so we can create a robust repository of images for the whole community.
Hi @aymanhab, I have been using a modified version of the docker image that is also on dockerhub, but the issue still persists that I am unable to import opensim in python due to an ImportError. I used to have this error around a year ago or so and I was able to resolve it back then. I have tried everything I did then but it still hasn't fixed the issue.
I would start from the image on dockerhub linked to above, test/verify it works out of the box, then gradually apply your changes. If something breaks you'll know what it is and you can tell us, at this point we can either fix/document or suggest a workaround/alternatives. Debugging a container in the dark is a bit hard especially when we didn't create it in the first place. I've seen these errors in other iterations of the container for a variety of reasons including using the wrong compilers/libraries/flags/python, Path/rpath/ld_library_path etc.
Hi @aymanhab - I have copied the dockerfile exactly as what is seen on DockerHub but for some reason I am still getting the same error having to do with _simbody.so. I am not sure exactly what it is I am missing.
Can you download the image as is (stanfordnmbl/opensim-python:4.4) and run python3.8, import opensim ? If not then we have a more fundamental issue to deal with since that's what docker is made for so we don't worry about different OS versions, python versions, PATH etc. all these are accounted for.
Hi @aymanhab - I found the issue. I was utilizing a multi-stage docker build where the GNU Libc versions were mismatched. I was able to resolve the problem and am successfully able to import opensim! Thank you for your help!