sudo apt-get install swig doxygen openjdk-7-jdk
Also, patience...the build can be temperamental. However, go through the steps enough times and it will work. Why, I don't know.
Also:
1. download (see error 4 below) py-dom-xpath-0.1 from here:
https://code.google.com/p/py-dom-xpath/downloads/list
sudo apt-get install python-setuptools
wget https://py-dom-xpath.googlecode.com/files/py-dom-xpath-0.1.tar.gz
2. Unzip it
3. Change to the directory py-dom-xpath-0.1/ and run
sudo python setup.py install
And
add this to your ~/.bashrc or /etc/profile
export LD_LIBRARY_PATH=/lib/openmm:/usr/lib/nvidia-cuda-toolkit:/usr/lib/nvidia:$LD_LIBRARY_PATHFinally (and this is truly ridiculous):
export OPENMM_PLUGIN_DIR=/usr/local/openmm/lib/plugins
export OPENMM_ROOT_DIR=/usr/local/openmm
mkdir ~/tmp/OpenMM4.0-Source/docs/UsersGuide
cp OpenMM4.0-Source/docs/OpenMMUsersGuide.pdf OpenMM4.0-Source/docs/UsersGuide/
Start here:
As usual we'll do our work in ~/tmp
so
mkdir ~/tmp
if that directory doesn't exist
To download the OpenMM4.0-Source.zip file you need to register at simtk.org
Put the file in ~/tmp
Run:
cd ~/tmp
unzip OpenMM4.0-Source.zip
cd OpenMM4.0-Source/
cmake CMakeList.txt
make OpenMM
sudo make install
If all goes well (it took me three hours to iron out the details...) you'll see
[..]
-- Installing: /usr/local/openmm/include/openmm/internal/AmoebaUreyBradleyForceImpl.h
-- Installing: /usr/local/openmm/include/openmm/internal/AmoebaTorsionTorsionForceImpl.h
-- Installing: /usr/local/openmm/include/openmm/internal/AmoebaStretchBendForceImpl.h
-- Installing: /usr/local/openmm/lib/libOpenMMAmoeba.so
-- Removed runtime path from "/usr/local/openmm/lib/libOpenMMAmoeba.so"
-- Installing: /usr/local/openmm/lib/plugins/libOpenMMAmoebaCuda.so
-- Removed runtime path from "/usr/local/openmm/lib/plugins/libOpenMMAmoebaCuda.so"
-- Installing: /usr/local/openmm/lib/plugins/libOpenMMAmoebaSerialization.so
-- Removed runtime path from "/usr/local/openmm/lib/plugins/libOpenMMAmoebaSerialization.so"
-- Installing: /usr/local/openmm/include/openmm/RPMDIntegrator.h
-- Installing: /usr/local/openmm/include/openmm/RpmdKernels.h
-- Installing: /usr/local/openmm/lib/libOpenMMRPMD.so
-- Removed runtime path from "/usr/local/openmm/lib/libOpenMMRPMD.so"
-- Installing: /usr/local/openmm/lib/plugins/libOpenMMRPMDOpenCL.so
-- Removed runtime path from "/usr/local/openmm/lib/plugins/libOpenMMRPMDOpenCL.so"
-- Installing: /usr/local/openmm/include/openmm/serialization/SerializationNode.h
-- Installing: /usr/local/openmm/include/openmm/serialization/SerializationProxy.h
-- Installing: /usr/local/openmm/include/openmm/serialization/XmlSerializer.h
-- Installing: /usr/local/openmm/lib/libOpenMMSerialization.so
-- Removed runtime path from "/usr/local/openmm/lib/libOpenMMSerialization.so"
And you're are done! SUCCESS!
Errors and solutions:
I hate cmake, possibly because I don't really understand it.
Anyway, every time you hit one of the errors below you need to do the following after fixing it:
make clean
cmake CMakeList.txt
make OpenMM
or you'll get error # 6
1. Doxygen missing:
Symptom:
Swig version must be 1.3.39 or greater! (You have 0.0.0)
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindDoxygen.cmake:80 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
wrappers/python/CMakeLists.txt:82 (find_package)
Solution:
sudo apt-get install doxygen
2. Swig missing:
Symptom:
Swig version must be 1.3.39 or greater! (You have 0.0.0)
-- Java version 1.6.0.24 configured successfully!
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE)
(found version "1.6.0.24")
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindJava.cmake:174 (find_package_handle_standard_args)
wrappers/python/CMakeLists.txt:85 (find_package)
Solution:
sudo apt-get install swig
3. Java found and missing at the same time
Symptom:
-- Java version 1.6.0.24 configured successfully!
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE)
(found version "1.6.0.24")
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindJava.cmake:174 (find_package_handle_standard_args)
wrappers/python/CMakeLists.txt:85 (find_package)
Solution:
sudo apt-get install openjdk-7-jdk
4. No module named xpath
Symptom:
Execution time: 1072 milliseconds
Memory used: 21270968
NamePool contents: 89 entries in 86 chains. 6 prefixes, 6 URIs
[ 87%] Creating OpenMM Python swig input files...
Traceback (most recent call last):
File "/home/me/tmp/OpenMM4.0-Source/python/src/swig_doxygen/swigInputBuilder.py", line 15, in <module>
import xpath
ImportError: No module named xpath
make[2]: *** [python/src/swig_doxygen/swig_lib/python/pythonprepend.i] Error 1
make[1]: *** [wrappers/python/CMakeFiles/BuildModule.dir/all] Error 2
make: *** [all] Error 2
Solution:
Download py-dom-xpath-0.1.tar.gz:
wget https://py-dom-xpath.googlecode.com/files/py-dom-xpath-0.1.tar.gz
Untar (tar -xvf) in ~/tmp
Untar (tar -xvf) in ~/tmp
cd py-dom-xpath-0.1/
sudo python setup.py install
What didn't work:
sudo apt-get install libxml-xpath-perl
sudo apt-get install libghc-hxt-xpath-dev
5. Missing OpenMMUsersGuide.pdf
Symptom:
-- Installing: /usr/local/openmm/docs/API Reference.html
CMake Error at cmake_install.cmake:119 (FILE):
file INSTALL cannot find
"/home/me/tmp/OpenMM4.0-Source/docs/UsersGuide/OpenMMUsersGuide.pdf".
make: *** [install] Error 1
Solution:
WTF??? The build can fail over something so trivial???
Anyway,
mkdir ~/tmp/OpenMM4.0-Source/docs/UsersGuide
cp ~/tmp/OpenMM4.0-Source/docs/OpenMMUsersGuide.pdf ~/tmp/OpenMM4.0-Source/docs/UsersGuide/
6. Linking CXX shared library libOpenMM.so failure
Symptom:
[ 6%] Building CXX object CMakeFiles/OpenMM.dir/src/cuda/kCalculateLocalForces.cu_OpenMMCuda_generated.cpp.o
Linking CXX shared library libOpenMM.so
CMakeFiles/OpenMM.dir/src/cuda/kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp.o: In function `__device_stub__Z29kFindBlockBoundsCutoff_kernelv()':
kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp:(.text+0x200): multiple definition of `__device_stub__Z29kFindBlockBoundsCutoff_kernelv()'
CMakeFiles/OpenMM.dir/src/cuda/kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp.o:kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp:(.text+0x1b0): first defined here
[..]
CMakeFiles/OpenMM.dir/src/cuda/kCalculateAmoebaCudaUtilities.cu_OpenMMAmoebaCuda_generated.cpp.o: In function `kFindInteractionsWithinBlocksPeriodic_kernel(unsigned int*)':
kCalculateAmoebaCudaUtilities.cu_OpenMMAmoebaCuda_generated.cpp:(.text+0x1d0): multiple definition of `kFindInteractionsWithinBlocksPeriodic_kernel(unsigned int*)'
CMakeFiles/OpenMM.dir/src/cuda/kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp.o:kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp:(.text+0x3a0): first defined here
collect2: ld returned 1 exit status
make[2]: *** [libOpenMM.so] Error 1
make[1]: *** [CMakeFiles/OpenMM.dir/all] Error 2
make: *** [all] Error 2
Solution:
You had one of errors 1-5, you solved it and tried to run make again. You need to do
make clean
cmake CMakeList.txt
first before proceeding with make or you end up with this error.