Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
d56c21b0
Commit
d56c21b0
authored
Dec 13, 2013
by
peastman
Browse files
Merged latest changes from main branch
parents
1049add2
8d062ebb
Changes
41
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
211 additions
and
337 deletions
+211
-337
CMakeLists.txt
CMakeLists.txt
+7
-3
libraries/lepton/include/lepton/Operation.h
libraries/lepton/include/lepton/Operation.h
+2
-1
libraries/lepton/src/MSVC_erfc.h
libraries/lepton/src/MSVC_erfc.h
+87
-88
openmmapi/include/openmm/internal/MSVC_erfc.h
openmmapi/include/openmm/internal/MSVC_erfc.h
+9
-8
platforms/reference/src/SimTKReference/ReferenceAndersenThermostat.cpp
...erence/src/SimTKReference/ReferenceAndersenThermostat.cpp
+6
-4
plugins/amoeba/CMakeLists.txt
plugins/amoeba/CMakeLists.txt
+4
-31
plugins/amoeba/platforms/reference/CMakeLists.txt
plugins/amoeba/platforms/reference/CMakeLists.txt
+40
-83
plugins/amoeba/platforms/reference/sharedTarget/CMakeLists.txt
...ns/amoeba/platforms/reference/sharedTarget/CMakeLists.txt
+0
-76
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernelFactory.cpp
.../platforms/reference/src/AmoebaReferenceKernelFactory.cpp
+21
-28
plugins/amoeba/platforms/reference/tests/CMakeLists.txt
plugins/amoeba/platforms/reference/tests/CMakeLists.txt
+2
-15
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
...atforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
+3
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaBondForce.cpp
...latforms/reference/tests/TestReferenceAmoebaBondForce.cpp
+3
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
...nce/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
+4
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
.../reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
+3
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
...rms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
+4
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
...eference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
+3
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
...rms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
+3
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaStretchBendForce.cpp
...s/reference/tests/TestReferenceAmoebaStretchBendForce.cpp
+3
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
...eference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
+4
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
...platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
+3
-0
No files found.
CMakeLists.txt
View file @
d56c21b0
...
...
@@ -116,9 +116,13 @@ IF (APPLE)
# Improve the linking behavior of Mac libraries
SET
(
CMAKE_INSTALL_NAME_DIR
"@rpath"
)
SET
(
EXTRA_COMPILE_FLAGS
"-stdlib=libc++"
)
SET
(
EXTRA_COMPILE_FLAGS
"
-msse2
-stdlib=libc++"
)
ELSE
(
APPLE
)
IF
(
WIN32
)
SET
(
EXTRA_COMPILE_FLAGS
)
ELSE
(
WIN32
)
SET
(
EXTRA_COMPILE_FLAGS
"-msse2"
)
ENDIF
(
WIN32
)
ENDIF
(
APPLE
)
IF
(
UNIX AND NOT CMAKE_BUILD_TYPE
)
...
...
@@ -257,7 +261,7 @@ FOREACH(subdir ${OPENMM_SOURCE_SUBDIRS})
## OpenMM was previously installed there.
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
ENDFOREACH
(
subdir
)
SET_SOURCE_FILES_PROPERTIES
(
${
CMAKE_SOURCE_DIR
}
/libraries/sfmt/src/SFMT.cpp PROPERTIES COMPILE_FLAGS
"
-msse2
-DHAVE_SSE2=1"
)
SET_SOURCE_FILES_PROPERTIES
(
${
CMAKE_SOURCE_DIR
}
/libraries/sfmt/src/SFMT.cpp PROPERTIES COMPILE_FLAGS
"-DHAVE_SSE2=1"
)
# If API wrappers are being generated, and add them to the build.
SET
(
OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS ON CACHE BOOL
"Build wrappers for C and Fortran"
)
...
...
libraries/lepton/include/lepton/Operation.h
View file @
d56c21b0
...
...
@@ -40,6 +40,7 @@
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
namespace
Lepton
{
...
...
libraries/lepton/src/MSVC_erfc.h
View file @
d56c21b0
...
...
@@ -2,16 +2,16 @@
#define LEPTON_MSVC_ERFC_H_
/*
* At least up to version 8 (VC++ 2005), Microsoft does not support the
* standard C99 erf() and erfc() functions. For now we're including these
* definitions for an MSVC compilation; if these are added later then
* the #ifdef below should change to compare _MSC_VER with a particular
* version level.
* Up to version 11 (VC++ 2012), Microsoft does not support the
* standard C99 erf() and erfc() functions so we have to fake them here.
* These were added in version 12 (VC++ 2013), which sets _MSC_VER=1800
* (VC11 has _MSC_VER=1700).
*/
#ifdef
_MSC_VER
#if
def
ined(
_MSC_VER
)
#define M_PI 3.14159265358979323846264338327950288
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
/***************************
* erf.cpp
* author: Steve Strand
...
...
@@ -20,8 +20,6 @@
#include <cmath>
#define M_PI 3.14159265358979323846264338327950288
static
const
double
rel_error
=
1E-12
;
//calculate 12 significant figures
//you can adjust rel_error to trade off between accuracy and speed
//but don't ask for > 15 figures (assuming usual 52 bit mantissa in a double)
...
...
@@ -83,6 +81,7 @@ static double erfc(double x)
return
one_sqrtpi
*
exp
(
-
x
*
x
)
*
q2
;
}
#endif // _MSC_VER <= 1700
#endif // _MSC_VER
#endif // LEPTON_MSVC_ERFC_H_
openmmapi/include/openmm/internal/MSVC_erfc.h
View file @
d56c21b0
...
...
@@ -2,16 +2,16 @@
#define OPENMM_MSVC_ERFC_H_
/*
* At least up to version 8 (VC++ 2005), Microsoft does not support the
* standard C99 erf() and erfc() functions. For now we're including these
* definitions for an MSVC compilation; if these are added later then
* the #ifdef below should change to compare _MSC_VER with a particular
* version level.
* Up to version 11 (VC++ 2012), Microsoft does not support the
* standard C99 erf() and erfc() functions so we have to fake them here.
* These were added in version 12 (VC++ 2013), which sets _MSC_VER=1800
* (VC11 has _MSC_VER=1700).
*/
#ifdef
_MSC_VER
#if
def
ined(
_MSC_VER
)
#define M_PI 3.14159265358979323846264338327950288
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
/***************************
* erf.cpp
* author: Steve Strand
...
...
@@ -81,6 +81,7 @@ static double erfc(double x)
return
one_sqrtpi
*
exp
(
-
x
*
x
)
*
q2
;
}
#endif // _MSC_VER <= 1700
#endif // _MSC_VER
#endif // OPENMM_MSVC_ERFC_H_
platforms/reference/src/SimTKReference/ReferenceAndersenThermostat.cpp
View file @
d56c21b0
...
...
@@ -72,6 +72,7 @@ using OpenMM::RealVec;
for
(
int
j
=
0
;
j
<
(
int
)
atomGroups
[
i
].
size
();
j
++
)
{
int
atom
=
atomGroups
[
i
][
j
];
if
(
atomMasses
[
atom
]
!=
0
)
{
const
RealOpenMM
velocityScale
=
static_cast
<
RealOpenMM
>
(
sqrt
(
BOLTZ
*
temperature
/
atomMasses
[
atom
]));
atomVelocities
[
atom
][
0
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
atomVelocities
[
atom
][
1
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
...
...
@@ -79,6 +80,7 @@ using OpenMM::RealVec;
}
}
}
}
}
plugins/amoeba/CMakeLists.txt
View file @
d56c21b0
...
...
@@ -18,7 +18,7 @@
# The source is organized into subdirectories, but we handle them all from
# this CMakeLists file rather than letting CMake visit them as SUBDIRS.
SET
(
OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi
platforms/reference
serialization
)
SET
(
OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi serialization
)
# Collect up information about the version of the OpenMM library we're building
# and make it available to the code so it can be built into the binaries.
...
...
@@ -82,11 +82,6 @@ FOREACH(subdir ${OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS})
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
ENDFOREACH
(
subdir
)
INCLUDE_DIRECTORIES
(
BEFORE
${
OPENMM_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
OPENMM_DIR
}
/platforms/reference/src/SimTKReference
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/platforms/reference/src/SimTKReference
)
# ----------------------------------------------------------------------------
# If API_AMOEBA wrappers are being generated, and add them to the build.
...
...
@@ -138,9 +133,10 @@ IF(OPENMM_BUILD_STATIC_LIB)
TARGET_LINK_LIBRARIES
(
${
STATIC_AMOEBA_TARGET
}
${
STATIC_TARGET
}
)
ENDIF
(
OPENMM_BUILD_STATIC_LIB
)
ADD_SUBDIRECTORY
(
platforms/reference/tests
)
# Which hardware platforms to build
ADD_SUBDIRECTORY
(
platforms/reference
)
IF
(
CUDA_FOUND
)
SET
(
OPENMM_BUILD_AMOEBA_CUDA_LIB ON CACHE BOOL
"Build OpenMMAmoebaCuda library for Nvidia GPUs"
)
ELSE
(
CUDA_FOUND
)
...
...
@@ -151,16 +147,10 @@ SET(OPENMM_BUILD_AMOEBA_PATH)
SET
(
OPENMM_BUILD_AMOEBA_CUDA_PATH
)
IF
(
OPENMM_BUILD_AMOEBA_CUDA_LIB
)
ADD_SUBDIRECTORY
(
platforms/cuda
)
SET
(
OPENMM_BUILD_AMOEBA_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/platforms/cuda
)
SET
(
OPENMM_BUILD_AMOEBA_CUDA_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/platforms/cuda
)
SET
(
OPENMM_AMOEBA_CUDA_SOURCE_SUBDIRS . openmmapi olla platforms/cuda
)
ENDIF
(
OPENMM_BUILD_AMOEBA_CUDA_LIB
)
#SET(OPENMM_BUILD_OPENCL_LIB OFF CACHE BOOL "Build OpenMMOpenCL library for Nvidia GPUs")
#IF(OPENMM_BUILD_OPENCL_LIB)
# ADD_SUBDIRECTORY(platforms/opencl)
#ENDIF(OPENMM_BUILD_OPENCL_LIB)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
SHARED_AMOEBA_TARGET
}
)
IF
(
OPENMM_BUILD_STATIC_LIB
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
STATIC_AMOEBA_TARGET
}
)
...
...
@@ -172,18 +162,6 @@ INSTALL_FILES(/include FILES ${CORE_HEADERS})
INSTALL_FILES
(
/include/openmm FILES
${
TOP_HEADERS
}
)
INSTALL_FILES
(
/include/openmm/internal FILES
${
INTERNAL_HEADERS
}
)
#
# Allow automated build and dashboard.
#
#INCLUDE (Dart)
#IF (UNIX AND NOT CYGWIN AND NOT APPLE)
# IF (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
# ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
# LINK_LIBRARIES(gcov)
# ENDIF (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
#ENDIF (UNIX AND NOT CYGWIN AND NOT APPLE)
#
# Testing
#
...
...
@@ -197,8 +175,3 @@ ELSE (EXECUTABLE_OUTPUT_PATH)
ENDIF
(
EXECUTABLE_OUTPUT_PATH
)
ADD_SUBDIRECTORY
(
serialization/tests
)
#INCLUDE(ApiDoxygen.cmake)
#ADD_SUBDIRECTORY(tests)
#ADD_SUBDIRECTORY(examples)
plugins/amoeba/platforms/reference/CMakeLists.txt
View file @
d56c21b0
#---------------------------------------------------
# OpenMM
Amoeba REFERENCE Platform
# OpenMM
Reference Amoeba Implementation
#
# Creates OpenMM library, base name=OpenMMAmoebaReference.
# Default libraries are shared & optimized. Variants
# are created for
static (_static) and
debug (_d).
# are created for debug (_d).
#
# Windows:
# OpenMMAmoebaReference[_d].dll
# OpenMMAmoebaReference[_d].lib
# OpenMMAmoebaReference_static[_d].lib
# Unix:
# libOpenMMAmoebaReference[_d].so
# libOpenMMAmoebaReference_static[_d].a
#----------------------------------------------------
# ----------------------------------------------------------------------------
# logging
SET
(
LOG TRUE
)
IF
(
LOG
)
SET
(
LOG_FILE
"CMakeLog.txt"
)
FILE
(
WRITE
${
LOG_FILE
}
"In plugins/amoeba/platforms/reference
\n
"
)
ENDIF
(
LOG
)
IF
(
LOG
)
MACRO
(
LOG_DIR LOG_FILE DIR_LIST
)
FILE
(
APPEND
${
LOG_FILE
}
"
\n
${
DIR_LIST
}
\n
"
)
FOREACH
(
currentFile
${
ARGN
}
)
FILE
(
APPEND
${
LOG_FILE
}
"
${
currentFile
}
\n
"
)
ENDFOREACH
(
currentFile
)
ENDMACRO
(
LOG_DIR
)
ENDIF
(
LOG
)
MESSAGE
(
"YYY Reference tests"
)
# ----------------------------------------------------------------------------
SET
(
DO_TESTS TRUE
)
# The source is organized into subdirectories, but we handle them all from
# this CMakeLists file rather than letting CMake visit them as SUBDIRS.
SET
(
OPENMM_
AMOEBA_
SOURCE_SUBDIRS .
)
SET
(
OPENMM_SOURCE_SUBDIRS .
)
# Collect up information about the version of the OpenMM library we're building
# and make it available to the code so it can be built into the binaries.
SET
(
OPENMM
_
REFERENCE_LIBRARY_NAME OpenMMAmoebaReference
)
SET
(
OPENMM
AMOEBA
REFERENCE_LIBRARY_NAME OpenMMAmoebaReference
)
SET
(
SHARED_TARGET
${
OPENMM_REFERENCE_LIBRARY_NAME
}
)
SET
(
STATIC_TARGET
${
OPENMM_REFERENCE_LIBRARY_NAME
}
_static
)
SET
(
SHARED_TARGET
${
OPENMMAMOEBAREFERENCE_LIBRARY_NAME
}
)
# Ensure that debug libraries have "_d" appended to their names.
# CMake gets this right on Windows automatically with this definition.
...
...
@@ -61,78 +32,64 @@ ENDIF (${CMAKE_GENERATOR} MATCHES "Visual Studio")
# But on Unix or Cygwin we have to add the suffix manually
IF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
SHARED_TARGET
${
SHARED_TARGET
}
_d
)
SET
(
STATIC_TARGET
${
STATIC_TARGET
}
_d
)
ENDIF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
# These are all the places to search for header files which are
# to be part of the API.
SET
(
API_
AMOEBA_
INCLUDE_DIRS
)
# start empty
FOREACH
(
subdir
${
OPENMM_
AMOEBA_
SOURCE_SUBDIRS
}
)
SET
(
API_INCLUDE_DIRS
)
# start empty
FOREACH
(
subdir
${
OPENMM_SOURCE_SUBDIRS
}
)
# append
SET
(
API_AMOEBA_INCLUDE_DIRS
${
API_AMOEBA_INCLUDE_DIRS
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include/internal
)
SET
(
API_INCLUDE_DIRS
${
API_INCLUDE_DIRS
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include/internal
)
ENDFOREACH
(
subdir
)
## ----------------------------------------------------------------------------
IF
(
LOG
)
LOG_DIR
(
${
LOG_FILE
}
"OPENMM_SOURCE_SUBDIRS"
${
OPENMM_SOURCE_SUBDIRS
}
)
LOG_DIR
(
${
LOG_FILE
}
"OPENMM_AMOEBA_SOURCE_SUBDIRS"
${
OPENMM_AMOEBA_SOURCE_SUBDIRS
}
)
LOG_DIR
(
${
LOG_FILE
}
"API_AMOEBA_INCLUDE_DIRS"
${
API_AMOEBA_INCLUDE_DIRS
}
)
LOG_DIR
(
${
LOG_FILE
}
"CMAKE_CURRENT_SOURCE_DIR"
${
CMAKE_CURRENT_SOURCE_DIR
}
)
ENDIF
(
LOG
)
## ----------------------------------------------------------------------------
# We'll need both *relative* path names, starting with their API_AMOEBA_INCLUDE_DIRS,
# We'll need both *relative* path names, starting with their API_INCLUDE_DIRS,
# and absolute pathnames.
SET
(
API_
AMOEBA_
REL_INCLUDE_FILES
)
# start these out empty
SET
(
API_
AMOEBA_
ABS_INCLUDE_FILES
)
SET
(
API_REL_INCLUDE_FILES
)
# start these out empty
SET
(
API_ABS_INCLUDE_FILES
)
FOREACH
(
dir
${
API_
AMOEBA_
INCLUDE_DIRS
}
)
FOREACH
(
dir
${
API_INCLUDE_DIRS
}
)
FILE
(
GLOB fullpaths
${
dir
}
/*.h
)
# returns full pathnames
SET
(
API_
AMOEBA_
ABS_INCLUDE_FILES
${
API_
AMOEBA_
ABS_INCLUDE_FILES
}
${
fullpaths
}
)
SET
(
API_ABS_INCLUDE_FILES
${
API_ABS_INCLUDE_FILES
}
${
fullpaths
}
)
FOREACH
(
pathname
${
fullpaths
}
)
GET_FILENAME_COMPONENT
(
filename
${
pathname
}
NAME
)
SET
(
API_
AMOEBA_
REL_INCLUDE_FILES
${
API_
AMOEBA_
REL_INCLUDE_FILES
}
${
dir
}
/
${
filename
}
)
SET
(
API_REL_INCLUDE_FILES
${
API_REL_INCLUDE_FILES
}
${
dir
}
/
${
filename
}
)
ENDFOREACH
(
pathname
)
ENDFOREACH
(
dir
)
## ----------------------------------------------------------------------------
IF
(
LOG
)
LOG_DIR
(
${
LOG_FILE
}
"API_AMOEBA_REL_INCLUDE_FILES"
${
API_AMOEBA_REL_INCLUDE_FILES
}
)
LOG_DIR
(
${
LOG_FILE
}
"OPENMM_DIR"
${
OPENMM_DIR
}
)
ENDIF
(
LOG
)
## ----------------------------------------------------------------------------
# collect up source files
SET
(
SOURCE_FILES
)
# empty
SET
(
SOURCE_INCLUDE_FILES
)
FOREACH
(
subdir
${
OPENMM_
AMOEBA_
SOURCE_SUBDIRS
}
)
FOREACH
(
subdir
${
OPENMM_SOURCE_SUBDIRS
}
)
FILE
(
GLOB_RECURSE src_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/src/*.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/src/*.c
)
FILE
(
GLOB incl_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/src/*.h
)
SET
(
SOURCE_FILES
${
SOURCE_FILES
}
${
src_files
}
)
#append
SET
(
SOURCE_INCLUDE_FILES
${
SOURCE_INCLUDE_FILES
}
${
incl_files
}
)
IF
(
LOG
)
LOG_DIR
(
${
LOG_FILE
}
"Adding include dir: "
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
ENDIF
(
LOG
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
ENDFOREACH
(
subdir
)
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/platforms/reference/include
)
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/platforms/reference/src/SimTKReference
)
IF
(
LOG
)
LOG_DIR
(
${
LOG_FILE
}
"CMAKE_CURRENT_SOURCE_DIR"
${
CMAKE_CURRENT_SOURCE_DIR
}
)
FILE
(
APPEND
${
LOG_FILE
}
"CMAKE_CURRENT_SOURCE_DIR=
${
CMAKE_CURRENT_SOURCE_DIR
}
\n
"
)
LOG_DIR
(
${
LOG_FILE
}
"SOURCE_FILES"
${
SOURCE_FILES
}
)
LOG_DIR
(
${
LOG_FILE
}
"SOURCE_INCLUDE_FILES"
${
SOURCE_INCLUDE_FILES
}
)
ENDIF
(
LOG
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
MESSAGE
(
"YYY Reference tests"
)
# SUBDIRS (sharedTarget staticTarget)
SUBDIRS
(
sharedTarget
)
SUBDIRS
(
tests
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/SimTKReference
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_SOURCE_DIR
}
/platforms/reference/include
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_SOURCE_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_SOURCE_DIR
}
/platforms/reference/src/SimTKReference
)
# Create the library
ADD_LIBRARY
(
${
SHARED_TARGET
}
SHARED
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
IF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
MAIN_OPENMM_LIB
${
OPENMM_LIBRARY_NAME
}
_d
)
ELSE
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
MAIN_OPENMM_LIB
${
OPENMM_LIBRARY_NAME
}
)
ENDIF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
${
MAIN_OPENMM_LIB
}
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
debug
${
SHARED_AMOEBA_TARGET
}
optimized
${
SHARED_AMOEBA_TARGET
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"
${
EXTRA_COMPILE_FLAGS
}
-DOPENMM_BUILDING_SHARED_LIBRARY"
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES LINK_FLAGS
"
${
EXTRA_COMPILE_FLAGS
}
"
)
INSTALL
(
TARGETS
${
SHARED_TARGET
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/lib/plugins
)
SUBDIRS
(
tests
)
plugins/amoeba/platforms/reference/sharedTarget/CMakeLists.txt
deleted
100644 → 0
View file @
1049add2
#
# Include REFERENCE related files.
#
# ----------------------------------------------------------------------------
# logging
SET
(
LOG FALSE
)
IF
(
LOG
)
SET
(
LOG_FILE
"CMakeLog.txt"
)
FILE
(
WRITE
${
LOG_FILE
}
"In amoeba/platforms/reference/sharedTarget Cmake
\n
"
)
# FILE( APPEND ${LOG_FILE} "BROOK_LIB_PATH=${BROOK_LIB_PATH}\n")
ENDIF
(
LOG
)
IF
(
LOG
)
MACRO
(
LOG_DIR LOG_FILE DIR_LIST
)
FILE
(
APPEND
${
LOG_FILE
}
"
\n
${
DIR_LIST
}
\n
"
)
FOREACH
(
currentFile
${
ARGN
}
)
FILE
(
APPEND
${
LOG_FILE
}
"
${
currentFile
}
\n
"
)
ENDFOREACH
(
currentFile
)
ENDMACRO
(
LOG_DIR
)
ENDIF
(
LOG
)
# ----------------------------------------------------------------------------
SET
(
OPENMM_BUILD_AMOEBA_PATH
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba
)
# ----------------------------------------------------------------------------
IF
(
LOG
)
LOG_DIR
(
${
LOG_FILE
}
"Pre OPENMM_SOURCE_SUBDIRS"
${
OPENMM_SOURCE_SUBDIRS
}
)
LOG_DIR
(
${
LOG_FILE
}
"Pre OPENMM_AMOEBA_SOURCE_SUBDIRS "
${
OPENMM_AMOEBA_SOURCE_SUBDIRS
}
)
LOG_DIR
(
${
LOG_FILE
}
"Pre SOURCE_FILES"
${
SOURCE_FILES
}
)
ENDIF
(
LOG
)
## ----------------------------------------------------------------------------
INCLUDE_DIRECTORIES
(
${
REFERENCE_INCLUDE
}
)
LINK_DIRECTORIES
(
${
REFERENCE_TARGET_LINK
}
)
FOREACH
(
subdir
${
OPENMM_AMOEBA_SOURCE_SUBDIRS
}
)
FILE
(
GLOB src_files
${
OPENMM_BUILD_AMOEBA_PATH
}
/platforms/reference/
${
subdir
}
/src/*.cu
${
OPENMM_BUILD_AMOEBA_PATH
}
/platforms/reference/src/*/*.cu
)
SET
(
SOURCE_FILES
${
SOURCE_FILES
}
${
src_files
}
)
INCLUDE_DIRECTORIES
(
BEFORE
${
OPENMM_BUILD_AMOEBA_PATH
}
/platforms/reference/../
${
subdir
}
/include
)
ENDFOREACH
(
subdir
)
# ----------------------------------------------------------------------------
IF
(
LOG
)
LOG_DIR
(
${
LOG_FILE
}
"OPENMM_BUILD_AMOEBA_PATH"
${
OPENMM_BUILD_AMOEBA_PATH
}
)
FILE
(
APPEND
${
LOG_FILE
}
"OPENMM_BUILD_AMOEBA_PATH=
${
OPENMM_BUILD_AMOEBA_PATH
}
\n
"
)
LOG_DIR
(
${
LOG_FILE
}
"OPENMM_SOURCE_SUBDIRS"
${
OPENMM_SOURCE_SUBDIRS
}
)
LOG_DIR
(
${
LOG_FILE
}
"CMAKE_SOURCE_DIR"
${
CMAKE_SOURCE_DIR
}
)
LOG_DIR
(
${
LOG_FILE
}
"REFERENCE_INCLUDE"
${
REFERENCE_INCLUDE
}
)
LOG_DIR
(
${
LOG_FILE
}
"REFERENCE_TARGET_LINK"
${
REFERENCE_TARGET_LINK
}
)
LOG_DIR
(
${
LOG_FILE
}
"SHARED_TARGET"
${
SHARED_TARGET
}
)
LOG_DIR
(
${
LOG_FILE
}
"OPENMM_DIR"
${
OPENMM_DIR
}
)
LOG_DIR
(
${
LOG_FILE
}
"SOURCE_FILES"
${
SOURCE_FILES
}
)
ENDIF
(
LOG
)
## ----------------------------------------------------------------------------
# REFERENCE_INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/jama/include)
INCLUDE_DIRECTORIES
(
${
OPENMM_BUILD_AMOEBA_PATH
}
/platforms/reference/../src
${
OPENMM_BUILD_AMOEBA_PATH
}
/platforms/reference/include
${
OPENMM_DIR
}
/platforms/reference/src
${
OPENMM_DIR
}
/platforms/reference/include
${
OPENMM_DIR
}
/platforms/reference/src/kernels
${
OPENMM_DIR
}
/openmmapi/include
)
ADD_LIBRARY
(
${
SHARED_TARGET
}
SHARED
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
debug
${
OPENMM_LIBRARY_NAME
}
_d optimized
${
OPENMM_LIBRARY_NAME
}
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
debug
${
OPENMM_LIBRARY_NAME
}
Cuda_d optimized
${
OPENMM_LIBRARY_NAME
}
Cuda
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
debug
${
OPENMM_AMOEBA_LIBRARY_NAME
}
_d optimized
${
OPENMM_AMOEBA_LIBRARY_NAME
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMMREFERENCE_BUILDING_SHARED_LIBRARY -DOPENMMREFERENCEAMOEBA_BUILDING_SHARED_LIBRARY"
)
INSTALL_TARGETS
(
/lib/plugins RUNTIME_DIRECTORY /lib/plugins
${
SHARED_TARGET
}
)
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernelFactory.cpp
View file @
d56c21b0
...
...
@@ -6,8 +6,8 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008 Stanford University and the Authors.
*
* Authors:
*
* Portions copyright (c) 2008
-2013
Stanford University and the Authors. *
* Authors:
Mark Friedrichs, Peter Eastman
*
* Contributors: *
* *
* This program is free software: you can redistribute it and/or modify *
...
...
@@ -32,25 +32,14 @@
using
namespace
OpenMM
;
#if defined(WIN32)
#include <windows.h>
extern
"C"
void
initAmoebaReferenceKernels
();
BOOL
WINAPI
DllMain
(
HANDLE
hModule
,
DWORD
ul_reason_for_call
,
LPVOID
lpReserved
)
{
if
(
ul_reason_for_call
==
DLL_PROCESS_ATTACH
)
initAmoebaReferenceKernels
();
return
TRUE
;
}
#else
extern
"C"
void
__attribute__
((
constructor
))
initAmoebaReferenceKernels
();
#endif
extern
"C"
void
initAmoebaReferenceKernels
()
{
for
(
int
ii
=
0
;
ii
<
Platform
::
getNumPlatforms
();
ii
++
){
Platform
&
platform
=
Platform
::
getPlatform
(
ii
);
if
(
platform
.
getName
()
==
"Reference"
){
extern
"C"
OPENMM_EXPORT
void
registerPlatforms
()
{
}
extern
"C"
OPENMM_EXPORT
void
registerKernelFactories
()
{
for
(
int
i
=
0
;
i
<
Platform
::
getNumPlatforms
();
i
++
)
{
Platform
&
platform
=
Platform
::
getPlatform
(
i
);
if
(
dynamic_cast
<
ReferencePlatform
*>
(
&
platform
)
!=
NULL
)
{
AmoebaReferenceKernelFactory
*
factory
=
new
AmoebaReferenceKernelFactory
();
platform
.
registerKernelFactory
(
CalcAmoebaBondForceKernel
::
Name
(),
factory
);
platform
.
registerKernelFactory
(
CalcAmoebaAngleForceKernel
::
Name
(),
factory
);
platform
.
registerKernelFactory
(
CalcAmoebaInPlaneAngleForceKernel
::
Name
(),
factory
);
...
...
@@ -66,6 +55,10 @@ extern "C" void initAmoebaReferenceKernels() {
}
}
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
()
{
registerKernelFactories
();
}
KernelImpl
*
AmoebaReferenceKernelFactory
::
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
{
ReferencePlatform
::
PlatformData
&
referencePlatformData
=
*
static_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
...
...
plugins/amoeba/platforms/reference/tests/CMakeLists.txt
View file @
d56c21b0
#
# Testing
#
ENABLE_TESTING
()
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/platforms/reference/include
)
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/openmmapi/include/openmm
)
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
${
OPENMM_DIR
}
/platforms/reference/src/kernels
)
Set
(
SHARED_OPENMM__AMOEBA_TARGET OpenMMAmoeba
)
Set
(
STATIC_OPENMM_TARGET OpenMMAmoeba_static
)
IF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
SHARED_OPENMM__AMOEBA_TARGET
${
SHARED_OPENMM__AMOEBA_TARGET
}
_d
)
ENDIF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
#LINK_DIRECTORIES
ENABLE_TESTING
()
# Automatically create tests using files named "Test*.cpp"
FILE
(
GLOB TEST_PROGS
"*Test*.cpp"
)
...
...
@@ -22,9 +10,8 @@ FOREACH(TEST_PROG ${TEST_PROGS})
GET_FILENAME_COMPONENT
(
TEST_ROOT
${
TEST_PROG
}
NAME_WE
)
# Link with shared library
ADD_EXECUTABLE
(
${
TEST_ROOT
}
${
TEST_PROG
}
)
TARGET_LINK_LIBRARIES
(
${
TEST_ROOT
}
${
SHARED_
TARGET
}
${
SHARED_OPENMM
_TARGET
}
${
SHARED_
OPENMM__AMOEBA_
TARGET
}
)
TARGET_LINK_LIBRARIES
(
${
TEST_ROOT
}
${
SHARED_
AMOEBA
_TARGET
}
${
SHARED_TARGET
}
)
SET_TARGET_PROPERTIES
(
${
TEST_ROOT
}
PROPERTIES LINK_FLAGS
"
${
EXTRA_COMPILE_FLAGS
}
"
COMPILE_FLAGS
"
${
EXTRA_COMPILE_FLAGS
}
"
)
ADD_TEST
(
${
TEST_ROOT
}
${
EXECUTABLE_OUTPUT_PATH
}
/
${
TEST_ROOT
}
)
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
View file @
d56c21b0
...
...
@@ -43,6 +43,8 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-5
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -315,6 +317,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
//FILE* log = fopen( "AmoebaAngleForce.log", "w" );;
FILE
*
log
=
NULL
;
//FILE* log = stderr;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaBondForce.cpp
View file @
d56c21b0
...
...
@@ -44,6 +44,8 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-5
;
static
void
computeAmoebaBondForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
AmoebaBondForce
&
AmoebaBondForce
,
...
...
@@ -222,6 +224,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaBondForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
FILE
*
log
=
NULL
;
//FILE* log = stderr;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
View file @
d56c21b0
...
...
@@ -50,6 +50,9 @@
using namespace OpenMM;
extern "C" OPENMM_EXPORT void registerAmoebaReferenceKernelFactories();
const double TOL = 1e-4;
// setup for 2 ammonia molecules
...
...
@@ -8470,6 +8473,7 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaGeneralizedKirkwoodForce running test..." << std::endl;
registerAmoebaReferenceKernelFactories();
FILE* log = NULL;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
View file @
d56c21b0
...
...
@@ -44,6 +44,8 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-5
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -391,6 +393,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
FILE
*
log
=
NULL
;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaInPlaneAngleForce.log", "w" );;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
View file @
d56c21b0
...
...
@@ -50,6 +50,9 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-4
;
// setup for 2 ammonia molecules
...
...
@@ -2803,6 +2806,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaMultipoleForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
FILE
*
log
=
NULL
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
View file @
d56c21b0
...
...
@@ -44,6 +44,8 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-3
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -521,6 +523,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaOutOfPlaneBendForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
//FILE* log = stderr;
FILE
*
log
=
NULL
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
View file @
d56c21b0
...
...
@@ -43,6 +43,8 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-5
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -318,6 +320,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaPiTorsionForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
FILE
*
log
=
NULL
;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaPiTorsionForce1.log", "w" );;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaStretchBendForce.cpp
View file @
d56c21b0
...
...
@@ -45,6 +45,8 @@ const double DegreesToRadians = 3.14159265/180.0;
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-4
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -304,6 +306,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaStretchBendForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
FILE
*
log
=
NULL
;
//FILE* log = stderr;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
View file @
d56c21b0
...
...
@@ -44,6 +44,9 @@
#include <vector>
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-4
;
TorsionTorsionGrid
&
getTorsionGrid
(
int
gridIndex
)
{
...
...
@@ -2683,6 +2686,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaTorsionTorsionForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
//registerAmoebaCudaKernelFactories();
FILE
*
log
=
NULL
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
View file @
d56c21b0
...
...
@@ -51,6 +51,8 @@
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT
void
registerAmoebaReferenceKernelFactories
();
const
double
TOL
=
1e-4
;
void
testVdw
(
FILE
*
log
)
{
...
...
@@ -1983,6 +1985,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"TestReferenceAmoebaVdwForce running test..."
<<
std
::
endl
;
registerAmoebaReferenceKernelFactories
();
FILE
*
log
=
NULL
;
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment