openmm / openmm-plumed

OpenMM plugin to interface with PLUMED
55 stars 23 forks source link

Building Python wrappers error #12

Closed aghanbar closed 5 years ago

aghanbar commented 6 years ago

Hi, I get these errors while trying to make the python wrappers:

make PythonInstall
[100%] Generating PlumedPluginWrapper.cpp
/home/ahmad/Downloads/openmm-plumed-master/python/plumedplugin.i:4: Error: Unable to find 'swig/OpenMMSwigHeaders.i'
/home/ahmad/Downloads/openmm-plumed-master/python/plumedplugin.i:5: Error: Unable to find 'swig/typemaps.i'
python/CMakeFiles/PythonInstall.dir/build.make:60: recipe for target 'python/PlumedPluginWrapper.cpp' failed
make[3]: *** [python/PlumedPluginWrapper.cpp] Error 1
CMakeFiles/Makefile2:403: recipe for target 'python/CMakeFiles/PythonInstall.dir/all' failed
make[2]: *** [python/CMakeFiles/PythonInstall.dir/all] Error 2
CMakeFiles/Makefile2:410: recipe for target 'python/CMakeFiles/PythonInstall.dir/rule' failed
make[1]: *** [python/CMakeFiles/PythonInstall.dir/rule] Error 2
Makefile:251: recipe for target 'PythonInstall' failed
make: *** [PythonInstall] Error 2

I'm not sure where it's coming from, but apparently some files are missing?

digbennett commented 5 years ago

I have spent an hour or so playing with this and have a similar error. I have a conda installed openMM and SWIG. The cmake options are set as follows: CMAKE_INSTALL_PREFIX --> usrpath/anaconda3/envs/env_name/include CUDA_HOST_COMPILER --> /Library/Developer/CommandLineTools/usr/bin/clang OPENCL_INCLUDE_DIR --> /System/Library/Frameworks/OpenCL.framework/Headers OPENCL_LIBRARY --> /System/Library/Frameworks/OpenCL.framework OPENMM_DIR --> usrpath/anaconda3/envs/env name/include PLUMED_BUILD_CUDA_LIB --> OFF PLUMED_BUILD_OPENCL_LIB --> ON
PLUMED_BUILD_PYTHON_WRAPPERS --> ON
PLUMED_INCLUDE_DIR --> usrpath/anaconda3/envs/env_name/include
PLUMED_LIBRARY_DIR --> usrpath/anaconda3/envs/env_name/lib
PYTHON_EXECUTABLE -->usrpath/anaconda3/envs/env_name/bin/python
SWIG_EXECUTABLE -->usrpath/anaconda3/envs/env_name/bin

a call to "make PythonInstall" then generates the following error message:

path/openmm-plumed-master/python/plumedplugin.i:4: Error: Unable to find 'swig/OpenMMSwigHeaders.i' path/openmm-plumed-master/python/plumedplugin.i:5: Error: Unable to find 'swig/typemaps.i' make[3]: [python/PlumedPluginWrapper.cpp] Error 1 make[2]: [python/CMakeFiles/PythonInstall.dir/all] Error 2 make[1]: [python/CMakeFiles/PythonInstall.dir/rule] Error 2 make: [PythonInstall] Error 2

I would appreciate any suggestions or advice. I know where the OpenMMSwigHeaders.i and typemaps.i files are, but there is no SWIG executable in that directory. I should also note this is all done on a MacOS10.13

peastman commented 5 years ago

path/openmm-plumed-master/python/plumedplugin.i:4: Error: Unable to find 'swig/OpenMMSwigHeaders.i' path/openmm-plumed-master/python/plumedplugin.i:5: Error: Unable to find 'swig/typemaps.i'

What is the output of

ls  usrpath/anaconda3/envs/env name/include/swig

When you write usrpath is that literally the name of the directory, or do you just mean you've abbreviated the path to your home directory? Make sure OPENMM_DIR is an absolute path, not a relative one. Likewise I notice it says env name (with a space) for that property, but all the others say env_name (with an underscore). Make sure the path is correct.

digbennett commented 5 years ago

Those are all absolute paths - I just abbreviated the path names. I double checked the CMake paths and they are all correct (the typo you caught in my lines above are due to my abbreviation).

There are two files in usrpath/anaconda3/env/env_name/include/swig: OpenMMSwigHeaders.i typemaps.i

peastman commented 5 years ago

I think I see the problem OPENMM_DIR should just be usrpath/anaconda3/envs/env_name. Take off the /include at the end.

digbennett commented 5 years ago

Worked like a charm. Thank you.

peastman commented 5 years ago

Great!