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
Compile openMM on an RPI
- Peter Eastman
- Posts: 2564
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Compile openMM on an RPI
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
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
- Andrei Rajkovic
- Posts: 4
- Joined: Tue Jun 14, 2016 12:45 pm
Re: Compile openMM on an RPI
Thanks for the resources! I'll start working on this and let you know if I make some progress.
- Andrei Rajkovic
- Posts: 4
- Joined: Tue Jun 14, 2016 12:45 pm
Re: Compile openMM on an RPI
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.
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.
- Attachments
-
- CMakeLists.txt
- OpenMM-7.0.1-Source/tests/CMakeLists.txt
- (1.25 KiB) Downloaded 17 times
-
- CMakeLists.txt
- OpenMM-7.0.1-Source/platforms/cpu/sharedTarget/CMakeLists.txt
- (1.23 KiB) Downloaded 24 times
-
- CMakeLists.txt
- OpenMM-7.0.1-Source/platforms/cpu/sharedTarget/CMakeLists.txt
- (1.11 KiB) Downloaded 19 times
-
- CMakeLists.txt
- OpenMM-7.0.1-Source/plugins/cpupme/CMakeLists.txt
- (3.7 KiB) Downloaded 25 times
-
- CMakeLists.txt
- OpenMM-7.0.1-Source/CMakeLists.txt
- (22.44 KiB) Downloaded 18 times
- Andrei Rajkovic
- Posts: 4
- Joined: Tue Jun 14, 2016 12:45 pm
Re: Compile openMM on an RPI
The rest of the files
- Attachments
-
- vectorize_neon.h
- (11.76 KiB) Downloaded 19 times
-
- hardware.h
- (4.28 KiB) Downloaded 21 times
-
- vecmath.cpp
- (163 Bytes) Downloaded 21 times
- Samuel Flores
- Posts: 189
- Joined: Mon Apr 30, 2007 1:06 pm
Re: Compile openMM on an RPI
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
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