Page 1 of 1

Compile openMM on an RPI

Posted: Mon Nov 07, 2016 9:15 am
by rajkovic1
I am attempting to compile openMM on a raspberry pi cluster, however I encounter an early error.
c++: error: unrecognized command line option ‘-msse2’

From what I gather this error occurs due to the the RPI using an ARM processor. Is it possible to compile openMM with msse2 disabled or is there an alternative method one could suggest?

Best,
Andrei

Re: Compile openMM on an RPI

Posted: Mon Nov 07, 2016 11:00 am
by peastman
We've never tried to support that particular combination before, but hopefully it isn't too difficult. We do support ARM on Android, so all the pieces are there. It's just a matter of recombining them to get the build commands for Linux with the compiler flags and #ifdefs for ARM.

I'd start by doing a search for every appearance of the word "android" anywhere in the source and build scripts. Some of them will be specific to Android, for example https://github.com/pandegroup/openmm/bl ... xt#L74-L76. Others are really specific to ARM, such as https://github.com/pandegroup/openmm/bl ... #L147-L149 and https://github.com/pandegroup/openmm/bl ... .h#L35-L36. If you can get it working, tell me what the needed changes were, and we can look into adding it as a supported combination.

Peter

Re: Compile openMM on an RPI

Posted: Mon Nov 07, 2016 11:15 am
by rajkovic1
Thanks for the resources! I'll start working on this and let you know if I make some progress.

Re: Compile openMM on an RPI

Posted: Mon Nov 28, 2016 8:37 am
by rajkovic1
I was able to successfully build OpenMM on the RPI. The operating system I used was Raspbian, but I also managed to install it on the Ubuntu OS (but this was more troubling since I was using arm-linux-gnueabihf-g++ and I had to manually change the paths for a lot of the systems header files) so I highly recommend Raspbian.

A major caveat was not being able to build with testing on. This seems to stem from TestVectorize8.cpp, which I suspect there is an easy way around. An indirect way of knowing that OpenMM partially works was getting macromoleculebuilder to execute correctly.

Here are the list of files I changed:

hardware.h
vectorize_neon.h
vecmath.cpp
OpenMM-7.0.1-Source/tests/CMakeLists.txt
OpenMM-7.0.1-Source/platforms/cpu/staticTarget/CMakeLists.txt
OpenMM-7.0.1-Source/platforms/cpu/sharedTarget/CMakeLists.txt
OpenMM-7.0.1-Source/plugins/cpupme/CMakeLists.txt
OpenMM-7.0.1-Source/CMakeLists.txt

I used ccmake to do the build and here were a few important flags:

CMAKE_CXX_FLAGS:STRING=-mfpu=neon
CMAKE_C_FLAGS:STRING=-mfloat-abi=hard
BUILD_TESTING:BOOL=OFF
CMAKE_CXX_COMPILER:FILEPATH=usr/bin/g++-6

Here is my disclaimer, I made a lot of these changes late at night and I may have changed a couple of other files, but I believe those were in the test files, so the files I provided here should be adequate to get OpenMM up and running on the RPI.

If it doesn't work I can try an upload the compressed (20.6MB) OpenMM source file with all the changes.

Re: Compile openMM on an RPI

Posted: Mon Nov 28, 2016 8:38 am
by rajkovic1
The rest of the files

Re: Compile openMM on an RPI

Posted: Sat Jun 17, 2017 3:00 pm
by sam
Hi Peter,

it's a bit hard for third parties like myself to follow this. There are more than 10 million Pis in the world now, so I feel that it's not a bad platform to support. Why not put the right switches in CMakeLists to handle the case of the Pi? We would be happy to give you access to our raspberry pi setup, since you probably don't have this hardware at simbios.What do you think?

Actually I only call one method: "computeNeighborListVoxelHash". I guess I could just stop pulling openmm updates. The disadvantage of that is that I can't in the future use additional OpenMM methods, or at least not the updated versions of those. A possibly bigger problem is that eventually I will get code rot and not be able to build on new OSs.


Thanks

Sam