compiling openmm with c++11 on OSX
Posted: Thu Jul 16, 2015 8:09 am
Guys,
I'm having trouble compiling OpenMM using the c++11 standard, on OSX 10.10. This appears by default not to be specified, but I need this for compatibility with simbody and molmodel, which apparently need to be built to this standard (I get compile errors if I try to build molmodel without -std=c++11).
The error is in one of the tests (output copied ), but even if I turn off BUILD_TESTING, it still tries to compile them. So, just figuring out how to turn off the tests would be helpful. If I build openmm without c++11, I get a seg fault when I then compile MMB. Also in openmm without c++11, the tests fail:
samuel-floress-macbook-pro-3:build Sam$ make test
Running tests...
Test project /Users/Sam/github/openmm/build
Start 1: TestOpenCLAndersenThermostatSingle
1/171 Test #1: TestOpenCLAndersenThermostatSingle ..............***Exception: Other 0.12 sec
Start 2: TestOpenCLAndersenThermostatMixed
2/171 Test #2: TestOpenCLAndersenThermostatMixed ...............***Exception: Other 0.08 sec
I believe I am working from the latest source:
samuel-floress-macbook-pro-3:build Sam$ git log ..
commit bca01957a298710ef9b9397ba66e934d6324572a
Merge: 5f5dafe 9a167d0
Author: peastman <peter.eastman@gmail.com>
Date: Fri Jun 26 14:44:17 2015 -0700
Merge pull request #993 from peastman/amoebaparams
Removed inappropriate error checks that forced all AMOEBA parameters to be in a single file
At any rate my main concern is getting openmm to compile with -std=c++11 . Can you provide any suggestions?
Many thanks
Sam
Linking CXX executable ../../../TestOpenCLSort
[ 97%] Built target TestOpenCLSort
[ 97%] Building CXX object plugins/drude/platforms/opencl/CMakeFiles/OpenMMDrudeOpenCL.dir/src/OpenCLDrudeKernelFactory.cpp.o
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: error: expected variable name or 'this' in lambda capture
list
ASSERT_EQUAL_VEC(Vec3(), state.getPositions()[0], 0.0);
^
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:174: note: expanded from macro 'ASSERT_EQUAL_VEC'
..._norm_ = std::sqrt((expected).dot(expected)); double _scale_ = _norm_ > 1.0 ? _norm_ : 1.0; if ((std::abs(((expected)[0])-((found)[0])...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: error: expected variable name or 'this' in lambda capture
list
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:234: note: expanded from macro 'ASSERT_EQUAL_VEC'
...= _norm_ > 1.0 ? _norm_ : 1.0; if ((std::abs(((expected)[0])-((found)[0]))/_scale_ > (tol)) || (std::abs(((expected)[1])-((found)[1]))...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: error: expected variable name or 'this' in lambda capture
list
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:294: note: expanded from macro 'ASSERT_EQUAL_VEC'
...> (tol)) || (std::abs(((expected)[1])-((found)[1]))/_scale_ > (tol)) || (std::abs(((expected)[2])-((found)[2]))/_scale_ > (tol))) {std...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:587:2: error: expected '}'
}
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: note: to match this '{'
ASSERT_EQUAL_VEC(Vec3(), state.getPositions()[0], 0.0);
^
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:48: note: expanded from macro 'ASSERT_EQUAL_VEC'
#define ASSERT_EQUAL_VEC(expected, found, tol) {double _norm_ = std::sqrt((expected).dot(expected)); double _scale_ = _norm_ > 1.0 ? _...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:587:2: error: expected '}'
}
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:80:36: note: to match this '{'
for (int i = 0; i < 1000; ++i) {
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:587:2: error: expected '}'
}
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:58:29: note: to match this '{'
void testMasslessParticle() {
^
6 errors generated.
make[2]: *** [platforms/opencl/tests/CMakeFiles/TestOpenCLVirtualSites.dir/TestOpenCLVirtualSites.cpp.o] Error 1
make[1]: *** [platforms/opencl/tests/CMakeFiles/TestOpenCLVirtualSites.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Building CXX object plugins/rpmd/platforms/opencl/CMakeFiles/OpenMMRPMDOpenCL.dir/src/OpenCLRpmdKernelSources.cpp.o
I'm having trouble compiling OpenMM using the c++11 standard, on OSX 10.10. This appears by default not to be specified, but I need this for compatibility with simbody and molmodel, which apparently need to be built to this standard (I get compile errors if I try to build molmodel without -std=c++11).
The error is in one of the tests (output copied ), but even if I turn off BUILD_TESTING, it still tries to compile them. So, just figuring out how to turn off the tests would be helpful. If I build openmm without c++11, I get a seg fault when I then compile MMB. Also in openmm without c++11, the tests fail:
samuel-floress-macbook-pro-3:build Sam$ make test
Running tests...
Test project /Users/Sam/github/openmm/build
Start 1: TestOpenCLAndersenThermostatSingle
1/171 Test #1: TestOpenCLAndersenThermostatSingle ..............***Exception: Other 0.12 sec
Start 2: TestOpenCLAndersenThermostatMixed
2/171 Test #2: TestOpenCLAndersenThermostatMixed ...............***Exception: Other 0.08 sec
I believe I am working from the latest source:
samuel-floress-macbook-pro-3:build Sam$ git log ..
commit bca01957a298710ef9b9397ba66e934d6324572a
Merge: 5f5dafe 9a167d0
Author: peastman <peter.eastman@gmail.com>
Date: Fri Jun 26 14:44:17 2015 -0700
Merge pull request #993 from peastman/amoebaparams
Removed inappropriate error checks that forced all AMOEBA parameters to be in a single file
At any rate my main concern is getting openmm to compile with -std=c++11 . Can you provide any suggestions?
Many thanks
Sam
Linking CXX executable ../../../TestOpenCLSort
[ 97%] Built target TestOpenCLSort
[ 97%] Building CXX object plugins/drude/platforms/opencl/CMakeFiles/OpenMMDrudeOpenCL.dir/src/OpenCLDrudeKernelFactory.cpp.o
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: error: expected variable name or 'this' in lambda capture
list
ASSERT_EQUAL_VEC(Vec3(), state.getPositions()[0], 0.0);
^
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:174: note: expanded from macro 'ASSERT_EQUAL_VEC'
..._norm_ = std::sqrt((expected).dot(expected)); double _scale_ = _norm_ > 1.0 ? _norm_ : 1.0; if ((std::abs(((expected)[0])-((found)[0])...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: error: expected variable name or 'this' in lambda capture
list
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:234: note: expanded from macro 'ASSERT_EQUAL_VEC'
...= _norm_ > 1.0 ? _norm_ : 1.0; if ((std::abs(((expected)[0])-((found)[0]))/_scale_ > (tol)) || (std::abs(((expected)[1])-((found)[1]))...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: error: expected variable name or 'this' in lambda capture
list
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:294: note: expanded from macro 'ASSERT_EQUAL_VEC'
...> (tol)) || (std::abs(((expected)[1])-((found)[1]))/_scale_ > (tol)) || (std::abs(((expected)[2])-((found)[2]))/_scale_ > (tol))) {std...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:587:2: error: expected '}'
}
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:83:9: note: to match this '{'
ASSERT_EQUAL_VEC(Vec3(), state.getPositions()[0], 0.0);
^
/Users/Sam/github/openmm/openmmapi/include/openmm/internal/AssertionUtilities.h:57:48: note: expanded from macro 'ASSERT_EQUAL_VEC'
#define ASSERT_EQUAL_VEC(expected, found, tol) {double _norm_ = std::sqrt((expected).dot(expected)); double _scale_ = _norm_ > 1.0 ? _...
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:587:2: error: expected '}'
}
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:80:36: note: to match this '{'
for (int i = 0; i < 1000; ++i) {
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:587:2: error: expected '}'
}
^
/Users/Sam/github/openmm/platforms/opencl/tests/TestOpenCLVirtualSites.cpp:58:29: note: to match this '{'
void testMasslessParticle() {
^
6 errors generated.
make[2]: *** [platforms/opencl/tests/CMakeFiles/TestOpenCLVirtualSites.dir/TestOpenCLVirtualSites.cpp.o] Error 1
make[1]: *** [platforms/opencl/tests/CMakeFiles/TestOpenCLVirtualSites.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Building CXX object plugins/rpmd/platforms/opencl/CMakeFiles/OpenMMRPMDOpenCL.dir/src/OpenCLRpmdKernelSources.cpp.o