User install location of build from source - Python API

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Ondrej Marsalek
Posts: 8
Joined: Sat Feb 21, 2009 5:27 am

User install location of build from source - Python API

Post by Ondrej Marsalek » Wed Oct 22, 2014 7:13 pm

I want to build OpenMM 6.1 from source and install it in a user directory. I also want to install the Python API. As far as I can tell, the PythonInstall target does not provide a mechanism to specify the location of the Python bindings. If system Python (e.g. /usr/bin/python) is used, it will try to install under /usr and fail. Am I missing something here? If not, I would like to suggest adding such a feature.

If I edit the file `wrappers/python/pysetupinstall.cmake` by hand and add `--user`, for example, it works as expected.

User avatar
Peter Eastman
Posts: 2546
Joined: Thu Aug 09, 2007 1:25 pm

Re: User install location of build from source - Python API

Post by Peter Eastman » Thu Oct 23, 2014 10:46 am

The PythonInstall target is just a shortcut for running the setup.py script. So after you build, cd to the "python" subdirectory inside your build directory, then install as you would any other Python package (python setup.py build, python setup.py install). That way you can specify --user. (The script requires a couple of environment variables to be set, but if they aren't it will tell you what to do.)

Peter

User avatar
Ondrej Marsalek
Posts: 8
Joined: Sat Feb 21, 2009 5:27 am

Re: User install location of build from source - Python API

Post by Ondrej Marsalek » Thu Oct 23, 2014 10:53 am

Thanks, sounds good. I found that before I found the PythonInstall target, but was not sure if there perhaps were side effects of the target that would make it preferable.

Would you consider adding this to the manual? I would expect this to be a fairly common scenario - you are installing on a cluster managed by someone else, but using the system provided Python.

POST REPLY