downloading opensim for linux and using python
- Vincent Berenz
- Posts: 7
- Joined: Mon Mar 25, 2013 8:12 pm
downloading opensim for linux and using python
Hi,
I would like to use open sim on ubuntu using python scripting.
The "supported plateform" of the installation guide says there is some download of opensim available for linux (without GUI) but following the instructions on the following page ("getting open sim") I am redirected on a download page on which no linux download is available.
Looking on this forum, I found a link to opensim 2.02 for linux, but python seems to be supported from version 3.2 onwards.
According to this page, using python scripting on ubuntu is possible:
http://simtk-confluence.stanford.edu:80 ... +in+Python
Could it be possible to get a download link of a recent linux version supporting python scripting ?
Many thx,
Vincent
I would like to use open sim on ubuntu using python scripting.
The "supported plateform" of the installation guide says there is some download of opensim available for linux (without GUI) but following the instructions on the following page ("getting open sim") I am redirected on a download page on which no linux download is available.
Looking on this forum, I found a link to opensim 2.02 for linux, but python seems to be supported from version 3.2 onwards.
According to this page, using python scripting on ubuntu is possible:
http://simtk-confluence.stanford.edu:80 ... +in+Python
Could it be possible to get a download link of a recent linux version supporting python scripting ?
Many thx,
Vincent
Re: downloading opensim for linux and using python
Hi Vincent,
The latest OpenSim source (3.2) is shipped with Python wrapping. You will have to build Simbody and OpenSim from source, with instructions being found here;
http://simtk-confluence.stanford.edu:80 ... rom+Source
The source code can be found on the download link of this project.
Let us know how it goes,
-james
The latest OpenSim source (3.2) is shipped with Python wrapping. You will have to build Simbody and OpenSim from source, with instructions being found here;
http://simtk-confluence.stanford.edu:80 ... rom+Source
The source code can be found on the download link of this project.
Let us know how it goes,
-james
- Michel Audette
- Posts: 21
- Joined: Tue May 27, 2014 7:04 am
Re: downloading opensim for linux and using python
Hello,
I am trying to install OpenSim from source on Linux; when I run CMake, I see the following error.
CMake Error at CMakeLists.txt:465 (INSTALL):
install PROGRAMS given directory "/usr/local/bin/Python" to install.
I have python installed.
audette@msvel608:~$ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Please advise.
I am trying to install OpenSim from source on Linux; when I run CMake, I see the following error.
CMake Error at CMakeLists.txt:465 (INSTALL):
install PROGRAMS given directory "/usr/local/bin/Python" to install.
I have python installed.
audette@msvel608:~$ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Please advise.
- Michel Audette
- Posts: 21
- Joined: Tue May 27, 2014 7:04 am
Re: downloading opensim for linux and using python
For the time being, I commented out lines 465 and 466 in the CMakeLists file.
#INSTALL(PROGRAMS ${THIRDPARTY_BIN_FILES}
# DESTINATION bin)
However this is not a clean solution. With these lines commented out, I was able to run configure and generate.
The build process did not go through to the end... something python-related.
audette@msvel608:~/projects/OpenSim32-source$ make
[ 0%] Copy /usr/local/bin/Python -> /home/audette/projects/OpenSim32-source/./Python
cp: omitting directory ‘/usr/local/bin/Python’
make[2]: *** [Python] Error 1
make[1]: *** [CMakeFiles/SimbodyFiles.dir/all] Error 2
make: *** [all] Error 2
I had python wrapping off the whole time, so I am a bit confused. The CMake process seems to have a bug in it.
#INSTALL(PROGRAMS ${THIRDPARTY_BIN_FILES}
# DESTINATION bin)
However this is not a clean solution. With these lines commented out, I was able to run configure and generate.
The build process did not go through to the end... something python-related.
audette@msvel608:~/projects/OpenSim32-source$ make
[ 0%] Copy /usr/local/bin/Python -> /home/audette/projects/OpenSim32-source/./Python
cp: omitting directory ‘/usr/local/bin/Python’
make[2]: *** [Python] Error 1
make[1]: *** [CMakeFiles/SimbodyFiles.dir/all] Error 2
make: *** [all] Error 2
I had python wrapping off the whole time, so I am a bit confused. The CMake process seems to have a bug in it.
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: downloading opensim for linux and using python
Hey Michel:
I have successfully built the Python wrapping using this source distribution, and I did not run into this issue. CMake is complaining because ${THIRDPARTY_BIN_FILES} is a directory, an we're trying to use it as if ${THIRDPARTY_BIN_FILES} were a list of files.
Can you list all the CMake variables you've modified, and their values?
As to why CMake was still doing something python-related with python wrapping turned off: did you initiallly have python wrapping turned on, and then turned it off? In that case, clear your CMake cache first (just delete the build dir).
This might be unrelated, but you are installing into a directory that requires sudo access to write to (/usr/local/). I'd advise you to install to a different directory, probably within ~. I usually use ~/simtk/opensim-<version> (e.g., ~/simtk/opensim-3.2).
EDIT
Okay now I have slightly more insight into the issue. I think you installed Simbody into /usr/local/. Is this correct? If so, the line:
FILE(GLOB THIRDPARTY_BIN_FILES ${Simbody_BIN_DIR}/*)
is grabbing everything in /usr/local/bin. So it seems that this line is making the assumption that you did not install Simbody into a directory like /usr/local/ or /usr. Indeed, this logic could be improved. One solution for now might be to install Simbody into a stand-alone place (like ~/simtk/simbody-3.3.1).
Can you tell me if you have a Python directory in /usr/local/bin, and what is in it? On my Ubuntu installation, I have no such directory.
I have successfully built the Python wrapping using this source distribution, and I did not run into this issue. CMake is complaining because ${THIRDPARTY_BIN_FILES} is a directory, an we're trying to use it as if ${THIRDPARTY_BIN_FILES} were a list of files.
Can you list all the CMake variables you've modified, and their values?
As to why CMake was still doing something python-related with python wrapping turned off: did you initiallly have python wrapping turned on, and then turned it off? In that case, clear your CMake cache first (just delete the build dir).
This might be unrelated, but you are installing into a directory that requires sudo access to write to (/usr/local/). I'd advise you to install to a different directory, probably within ~. I usually use ~/simtk/opensim-<version> (e.g., ~/simtk/opensim-3.2).
EDIT
Okay now I have slightly more insight into the issue. I think you installed Simbody into /usr/local/. Is this correct? If so, the line:
FILE(GLOB THIRDPARTY_BIN_FILES ${Simbody_BIN_DIR}/*)
is grabbing everything in /usr/local/bin. So it seems that this line is making the assumption that you did not install Simbody into a directory like /usr/local/ or /usr. Indeed, this logic could be improved. One solution for now might be to install Simbody into a stand-alone place (like ~/simtk/simbody-3.3.1).
Can you tell me if you have a Python directory in /usr/local/bin, and what is in it? On my Ubuntu installation, I have no such directory.
- Michel Audette
- Posts: 21
- Joined: Tue May 27, 2014 7:04 am
Re: downloading opensim for linux and using python
Hi Chris,
thanks for your kind reply. I have just deleted my build directory, and started from scratch, to make sure that there are no vestigial files causing trouble... and I'm still seeing the problem.
I am uploading my CMakeCache.txt for you... See enclosed.
Let me know what you find. Btw, I tried using python setup.py in the source directory (under OpenSim/Wrapping/Python) and at first it was complaning about lack of setuptools; I updated that, so this is not an issue... Still, it should be part of your documentation on how to proceed with Python support.
thanks for your kind reply. I have just deleted my build directory, and started from scratch, to make sure that there are no vestigial files causing trouble... and I'm still seeing the problem.
I am uploading my CMakeCache.txt for you... See enclosed.
Let me know what you find. Btw, I tried using python setup.py in the source directory (under OpenSim/Wrapping/Python) and at first it was complaning about lack of setuptools; I updated that, so this is not an issue... Still, it should be part of your documentation on how to proceed with Python support.
- Attachments
-
- CMakeCache.txt
- (20 KiB) Downloaded 89 times
- Michel Audette
- Posts: 21
- Joined: Tue May 27, 2014 7:04 am
Re: downloading opensim for linux and using python
Actually, I do have a copy of simbody in my user directory, so I will retry with new values for these variables in OpenSim and report back.
- Michel Audette
- Posts: 21
- Joined: Tue May 27, 2014 7:04 am
Re: downloading opensim for linux and using python
I reinstalled Simbody under /user/audette/projects/sim , having also moved from /usr/local all software relevant to SimTk and Simbody into a tmp directory.
However, when I try to build OpenSim, it stubbornly won't let me use my own installation, complaining as follows...
CMake Error: The following variables are used in this project, but they are
set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake
files:
Simbody_INCLUDE_DIR (ADVANCED)
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
Despite the fact that I have this in my bashrc file.
Simbody_INCLUDE_DIR=/home/audette/projects/simbody-Simbody-3.3.1Install/include
export Simbody_INCLUDE_DIR
However, when I try to build OpenSim, it stubbornly won't let me use my own installation, complaining as follows...
CMake Error: The following variables are used in this project, but they are
set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake
files:
Simbody_INCLUDE_DIR (ADVANCED)
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
/home/audette/projects/OpenSim32-source
used as include directory in directory
Despite the fact that I have this in my bashrc file.
Simbody_INCLUDE_DIR=/home/audette/projects/simbody-Simbody-3.3.1Install/include
export Simbody_INCLUDE_DIR
- Ayman Habib
- Posts: 2244
- Joined: Fri Apr 01, 2005 12:24 pm
Re: downloading opensim for linux and using python
Hi Michel,
Environment variables and CMake variables are distinct unless you tell CMake to evaluate an environment variable (which would preclude in this case having multiple installations on the same machine). Please use the CMake GUI/interface to set Simbody_* CMake variables to the proper directories.
Hope this helps,
-Ayman
Environment variables and CMake variables are distinct unless you tell CMake to evaluate an environment variable (which would preclude in this case having multiple installations on the same machine). Please use the CMake GUI/interface to set Simbody_* CMake variables to the proper directories.
Hope this helps,
-Ayman
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: downloading opensim for linux and using python
Hi, Michel.
Simbody_INCLUDE_DIR is an internal variable that is set by OpenSim's FindSimbody.cmake module. It is not separately overrideable. Please try setting the environment variable SimTK_INSTALL_DIR to the Simbody install directory; the module will then use that to locate include files and so on.
Regards,
Sherm
Simbody_INCLUDE_DIR is an internal variable that is set by OpenSim's FindSimbody.cmake module. It is not separately overrideable. Please try setting the environment variable SimTK_INSTALL_DIR to the Simbody install directory; the module will then use that to locate include files and so on.
Regards,
Sherm