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
d88141d5
Commit
d88141d5
authored
Feb 10, 2010
by
Mark Friedrichs
Browse files
Added support for exporting validation methods for Window's builds
parent
5be64eae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
6 deletions
+48
-6
CMakeLists.txt
CMakeLists.txt
+2
-2
libraries/validate/include/ValidateOpenMM.h
libraries/validate/include/ValidateOpenMM.h
+2
-1
libraries/validate/include/ValidateOpenMMForces.h
libraries/validate/include/ValidateOpenMMForces.h
+3
-3
libraries/validate/include/ValidateWindowsIncludes.h
libraries/validate/include/ValidateWindowsIncludes.h
+41
-0
No files found.
CMakeLists.txt
View file @
d88141d5
...
@@ -290,10 +290,10 @@ ENDIF(OPENMM_BUILD_API_WRAPPERS)
...
@@ -290,10 +290,10 @@ ENDIF(OPENMM_BUILD_API_WRAPPERS)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
ADD_LIBRARY
(
${
SHARED_TARGET
}
SHARED
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
ADD_LIBRARY
(
${
SHARED_TARGET
}
SHARED
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY"
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY
-DOPENMM_VALIDATE_BUILDING_SHARED_LIBRARY
"
)
ADD_LIBRARY
(
${
STATIC_TARGET
}
STATIC
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
ADD_LIBRARY
(
${
STATIC_TARGET
}
STATIC
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
SET_TARGET_PROPERTIES
(
${
STATIC_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_USE_STATIC_LIBRARIES -DLEPTON_BUILDING_STATIC_LIBRARY"
)
SET_TARGET_PROPERTIES
(
${
STATIC_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_USE_STATIC_LIBRARIES -DLEPTON_BUILDING_STATIC_LIBRARY
-DOPENMMM_VALIDATE_BUILDING_STATIC_LIBRARY -DOPENMM_VALIDATE_BUILDING_STATIC_LIBRARY
"
)
IF
(
OPENMM_BUILD_API_WRAPPERS
)
IF
(
OPENMM_BUILD_API_WRAPPERS
)
ADD_DEPENDENCIES
(
${
SHARED_TARGET
}
ApiWrappers
)
ADD_DEPENDENCIES
(
${
SHARED_TARGET
}
ApiWrappers
)
...
...
libraries/validate/include/ValidateOpenMM.h
View file @
d88141d5
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "../../../platforms/reference/include/ReferencePlatform.h"
#include "../../../platforms/reference/include/ReferencePlatform.h"
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/System.h"
#include "openmm/System.h"
#include "ValidateWindowsIncludes.h"
// free-energy plugin includes
// free-energy plugin includes
...
@@ -174,7 +175,7 @@ public:
...
@@ -174,7 +175,7 @@ public:
* @param log log
* @param log log
*
*
*/
*/
void
setLog
(
FILE
*
log
);
void
OPENMM_VALIDATE_EXPORT
setLog
(
FILE
*
log
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
libraries/validate/include/ValidateOpenMMForces.h
View file @
d88141d5
...
@@ -224,8 +224,8 @@ private:
...
@@ -224,8 +224,8 @@ private:
class
ValidateOpenMMForces
:
public
ValidateOpenMM
{
class
ValidateOpenMMForces
:
public
ValidateOpenMM
{
public:
public:
ValidateOpenMMForces
(
void
);
OPENMM_VALIDATE_EXPORT
ValidateOpenMMForces
(
void
);
~
ValidateOpenMMForces
();
OPENMM_VALIDATE_EXPORT
~
ValidateOpenMMForces
();
/**
/**
* Validate force/energy by comparing the results between the forces/energies computed on user-provided context platform
* Validate force/energy by comparing the results between the forces/energies computed on user-provided context platform
...
@@ -236,7 +236,7 @@ public:
...
@@ -236,7 +236,7 @@ public:
*
*
* @return number of inconsistent entries
* @return number of inconsistent entries
*/
*/
int
compareWithReferencePlatform
(
Context
&
context
,
std
::
string
*
summaryString
=
NULL
);
int
OPENMM_VALIDATE_EXPORT
compareWithReferencePlatform
(
Context
&
context
,
std
::
string
*
summaryString
=
NULL
);
/**
/**
* Validate force/energy by comparing the results between the forces/energies computed on two different platforms
* Validate force/energy by comparing the results between the forces/energies computed on two different platforms
...
...
libraries/validate/include/ValidateWindowsIncludes.h
0 → 100644
View file @
d88141d5
#ifndef OPENMM_VALIDATE_WINDOW_INCLUDE_H_
#define OPENMM_VALIDATE_WINDOW_INCLUDE_H_
/*
* Shared libraries are messy in Visual Studio. We have to distinguish three
* cases:
* (1) this header is being used to build the OpenMMValidate shared library
* (dllexport)
* (2) this header is being used by a *client* of the OpenMMValidate shared
* library (dllimport)
* (3) we are building the OpenMMValidate static library, or the client is
* being compiled with the expectation of linking with the
* OpenMMValidate static library (nothing special needed)
* In the CMake script for building this library, we define one of the symbols
* OpenMMValidate_BUILDING_{SHARED|STATIC}_LIBRARY
* Client code normally has no special symbol defined, in which case we'll
* assume it wants to use the shared library. However, if the client defines
* the symbol OPENMM_VALIDATE_USE_STATIC_LIBRARIES we'll suppress the dllimport so
* that the client code can be linked with static libraries. Note that
* the client symbol is not library dependent, while the library symbols
* affect only the OpenMMValidate library, meaning that other libraries can
* be clients of this one. However, we are assuming all-static or all-shared.
*/
#ifdef _MSC_VER
// We don't want to hear about how sprintf is "unsafe".
#pragma warning(disable:4996)
#if defined(OPENMM_VALIDATE_BUILDING_SHARED_LIBRARY)
#define OPENMM_VALIDATE_EXPORT __declspec(dllexport)
// Keep MS VC++ quiet about lack of dll export of private members.
#pragma warning(disable:4251)
#elif defined(OPENMM_VALIDATE_BUILDING_STATIC_LIBRARY) || defined(OPENMM_VALIDATE_USE_STATIC_LIBRARIES)
#define OPENMM_VALIDATE_EXPORT
#else
#define OPENMM_VALIDATE_EXPORT __declspec(dllimport) // i.e., a client of a shared library
#endif
#else
#define OPENMM_VALIDATE_EXPORT // Linux, Mac
#endif
#endif // OPENMM_VALIDATE_WINDOW_INCLUDE_H_
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