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
b256555e
Commit
b256555e
authored
Dec 12, 2012
by
Peter Eastman
Browse files
Fixed compilation errors on Windows
parent
59b69776
Changes
72
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
113 additions
and
31 deletions
+113
-31
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+3
-4
platforms/cuda/include/CudaPlatform.h
platforms/cuda/include/CudaPlatform.h
+3
-2
platforms/cuda/include/windowsExportCuda.h
platforms/cuda/include/windowsExportCuda.h
+41
-0
platforms/cuda/sharedTarget/CMakeLists.txt
platforms/cuda/sharedTarget/CMakeLists.txt
+1
-1
platforms/cuda/src/CudaArray.h
platforms/cuda/src/CudaArray.h
+2
-2
platforms/cuda/src/CudaBondedUtilities.h
platforms/cuda/src/CudaBondedUtilities.h
+1
-1
platforms/cuda/src/CudaContext.h
platforms/cuda/src/CudaContext.h
+2
-2
platforms/cuda/src/CudaExpressionUtilities.h
platforms/cuda/src/CudaExpressionUtilities.h
+1
-1
platforms/cuda/src/CudaForceInfo.h
platforms/cuda/src/CudaForceInfo.h
+2
-2
platforms/cuda/src/CudaIntegrationUtilities.h
platforms/cuda/src/CudaIntegrationUtilities.h
+2
-2
platforms/cuda/src/CudaKernelSources.h.in
platforms/cuda/src/CudaKernelSources.h.in
+2
-2
platforms/cuda/src/CudaNonbondedUtilities.h
platforms/cuda/src/CudaNonbondedUtilities.h
+1
-1
platforms/cuda/src/CudaParameterSet.h
platforms/cuda/src/CudaParameterSet.h
+1
-1
platforms/cuda/src/CudaPlatform.cpp
platforms/cuda/src/CudaPlatform.cpp
+1
-1
platforms/cuda/src/CudaSort.h
platforms/cuda/src/CudaSort.h
+2
-2
platforms/cuda/tests/TestCudaRandom.cpp
platforms/cuda/tests/TestCudaRandom.cpp
+1
-1
platforms/opencl/include/OpenCLPlatform.h
platforms/opencl/include/OpenCLPlatform.h
+3
-3
platforms/opencl/include/windowsExportOpenCL.h
platforms/opencl/include/windowsExportOpenCL.h
+41
-0
platforms/opencl/sharedTarget/CMakeLists.txt
platforms/opencl/sharedTarget/CMakeLists.txt
+1
-1
platforms/opencl/src/OpenCLArray.h
platforms/opencl/src/OpenCLArray.h
+2
-2
No files found.
openmmapi/src/NonbondedForceImpl.cpp
View file @
b256555e
...
...
@@ -29,6 +29,9 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#ifdef WIN32
#define _USE_MATH_DEFINES // Needed to get M_PI
#endif
#include "openmm/OpenMMException.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/NonbondedForceImpl.h"
...
...
@@ -37,10 +40,6 @@
#include <map>
#include <sstream>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
using
namespace
OpenMM
;
using
namespace
std
;
...
...
platforms/cuda/include/CudaPlatform.h
View file @
b256555e
...
...
@@ -29,6 +29,7 @@
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "windowsExportCuda.h"
namespace
OpenMM
{
...
...
@@ -38,7 +39,7 @@ class CudaContext;
* This Platform subclass uses CUDA implementations of the OpenMM kernels.
*/
class
OPENMM_EXPORT
CudaPlatform
:
public
Platform
{
class
OPENMM_EXPORT
_CUDA
CudaPlatform
:
public
Platform
{
public:
class
PlatformData
;
CudaPlatform
();
...
...
@@ -91,7 +92,7 @@ public:
}
};
class
OPENMM_EXPORT
CudaPlatform
::
PlatformData
{
class
OPENMM_EXPORT
_CUDA
CudaPlatform
::
PlatformData
{
public:
PlatformData
(
const
System
&
system
,
const
std
::
string
&
deviceIndexProperty
,
const
std
::
string
&
blockingProperty
,
const
std
::
string
&
precisionProperty
,
const
std
::
string
&
compilerProperty
,
const
std
::
string
&
tempProperty
);
...
...
platforms/cuda/include/windowsExportCuda.h
0 → 100644
View file @
b256555e
#ifndef OPENMM_WINDOWSEXPORTCUDA_H_
#define OPENMM_WINDOWSEXPORTCUDA_H_
/*
* Shared libraries are messy in Visual Studio. We have to distinguish three
* cases:
* (1) this header is being used to build the OpenMM shared library
* (dllexport)
* (2) this header is being used by a *client* of the OpenMM shared
* library (dllimport)
* (3) we are building the OpenMM static library, or the client is
* being compiled with the expectation of linking with the
* OpenMM static library (nothing special needed)
* In the CMake script for building this library, we define one of the symbols
* OPENMM_CUDA_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_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 OpenMM 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)
// Keep MS VC++ quiet about lack of dll export of private members.
#pragma warning(disable:4251)
#if defined(OPENMM_CUDA_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_CUDA __declspec(dllexport)
#elif defined(OPENMM_CUDA_BUILDING_STATIC_LIBRARY) || defined(OPENMM_CUDA_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_CUDA
#else
#define OPENMM_EXPORT_CUDA __declspec(dllimport) // i.e., a client of a shared library
#endif
#else
#define OPENMM_EXPORT_CUDA // Linux, Mac
#endif
#endif // OPENMM_WINDOWSEXPORTCUDA_H_
platforms/cuda/sharedTarget/CMakeLists.txt
View file @
b256555e
...
...
@@ -19,6 +19,6 @@ 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
}
${
CUDA_CUDA_LIBRARY
}
${
CUDA_cufft_LIBRARY
}
${
PTHREADS_LIB
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_BUILDING_SHARED_LIBRARY"
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_
CUDA_
BUILDING_SHARED_LIBRARY"
)
INSTALL_TARGETS
(
/lib/plugins RUNTIME_DIRECTORY /lib/plugins
${
SHARED_TARGET
}
)
platforms/cuda/src/CudaArray.h
View file @
b256555e
...
...
@@ -28,7 +28,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/OpenMMException.h"
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
Cuda
.h"
#include <cuda.h>
#include <iostream>
#include <sstream>
...
...
@@ -43,7 +43,7 @@ class CudaContext;
* for working with it and for copying data to and from device memory.
*/
class
OPENMM_EXPORT
CudaArray
{
class
OPENMM_EXPORT
_CUDA
CudaArray
{
public:
/**
* Create a CudaArray object. The object is allocated on the heap with the "new" operator.
...
...
platforms/cuda/src/CudaBondedUtilities.h
View file @
b256555e
...
...
@@ -78,7 +78,7 @@ namespace OpenMM {
* from your interaction code.
*/
class
OPENMM_EXPORT
CudaBondedUtilities
{
class
OPENMM_EXPORT
_CUDA
CudaBondedUtilities
{
public:
CudaBondedUtilities
(
CudaContext
&
context
);
~
CudaBondedUtilities
();
...
...
platforms/cuda/src/CudaContext.h
View file @
b256555e
...
...
@@ -39,7 +39,7 @@
#include <cuda.h>
#include <builtin_types.h>
#include <vector_functions.h>
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
Cuda
.h"
#include "CudaPlatform.h"
namespace
OpenMM
{
...
...
@@ -63,7 +63,7 @@ class System;
* thread is not used and calculations are performed on the main application thread.
*/
class
OPENMM_EXPORT
CudaContext
{
class
OPENMM_EXPORT
_CUDA
CudaContext
{
public:
class
WorkTask
;
class
WorkThread
;
...
...
platforms/cuda/src/CudaExpressionUtilities.h
View file @
b256555e
...
...
@@ -43,7 +43,7 @@ namespace OpenMM {
* user defined mathematical expressions.
*/
class
OPENMM_EXPORT
CudaExpressionUtilities
{
class
OPENMM_EXPORT
_CUDA
CudaExpressionUtilities
{
public:
CudaExpressionUtilities
(
CudaContext
&
context
)
:
context
(
context
)
{
}
...
...
platforms/cuda/src/CudaForceInfo.h
View file @
b256555e
...
...
@@ -27,7 +27,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
Cuda
.h"
#include <vector>
namespace
OpenMM
{
...
...
@@ -37,7 +37,7 @@ namespace OpenMM {
* about the behavior and requirements of that force.
*/
class
OPENMM_EXPORT
CudaForceInfo
{
class
OPENMM_EXPORT
_CUDA
CudaForceInfo
{
public:
CudaForceInfo
()
{
}
...
...
platforms/cuda/src/CudaIntegrationUtilities.h
View file @
b256555e
...
...
@@ -29,7 +29,7 @@
#include "openmm/System.h"
#include "CudaContext.h"
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
Cuda
.h"
#include <iosfwd>
namespace
OpenMM
{
...
...
@@ -39,7 +39,7 @@ namespace OpenMM {
* common workspace arrays, random number generation, and enforcing constraints.
*/
class
OPENMM_EXPORT
CudaIntegrationUtilities
{
class
OPENMM_EXPORT
_CUDA
CudaIntegrationUtilities
{
public:
CudaIntegrationUtilities
(
CudaContext
&
context
,
const
System
&
system
);
~
CudaIntegrationUtilities
();
...
...
platforms/cuda/src/CudaKernelSources.h.in
View file @
b256555e
...
...
@@ -27,7 +27,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
Cuda
.h"
#include <string>
namespace OpenMM {
...
...
@@ -38,7 +38,7 @@ namespace OpenMM {
* kernels subfolder.
*/
class OPENMM_EXPORT CudaKernelSources {
class OPENMM_EXPORT
_CUDA
CudaKernelSources {
public:
@CUDA_FILE_DECLARATIONS@
};
...
...
platforms/cuda/src/CudaNonbondedUtilities.h
View file @
b256555e
...
...
@@ -61,7 +61,7 @@ namespace OpenMM {
* by ForceImpls during calcForcesAndEnergy().
*/
class
OPENMM_EXPORT
CudaNonbondedUtilities
{
class
OPENMM_EXPORT
_CUDA
CudaNonbondedUtilities
{
public:
class
ParameterInfo
;
CudaNonbondedUtilities
(
CudaContext
&
context
);
...
...
platforms/cuda/src/CudaParameterSet.h
View file @
b256555e
...
...
@@ -40,7 +40,7 @@ class CudaNonbondedUtilities;
* on the number of parameters required.
*/
class
OPENMM_EXPORT
CudaParameterSet
{
class
OPENMM_EXPORT
_CUDA
CudaParameterSet
{
public:
/**
* Create an CudaParameterSet.
...
...
platforms/cuda/src/CudaPlatform.cpp
View file @
b256555e
...
...
@@ -42,7 +42,7 @@
using
namespace
OpenMM
;
using
namespace
std
;
extern
"C"
OPENMM_EXPORT
void
registerPlatforms
()
{
extern
"C"
OPENMM_EXPORT
_CUDA
void
registerPlatforms
()
{
Platform
::
registerPlatform
(
new
CudaPlatform
());
}
...
...
platforms/cuda/src/CudaSort.h
View file @
b256555e
...
...
@@ -28,7 +28,7 @@
* -------------------------------------------------------------------------- */
#include "CudaArray.h"
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
Cuda
.h"
#include "CudaContext.h"
namespace
OpenMM
{
...
...
@@ -66,7 +66,7 @@ namespace OpenMM {
* elements).
*/
class
OPENMM_EXPORT
CudaSort
{
class
OPENMM_EXPORT
_CUDA
CudaSort
{
public:
class
SortTrait
;
/**
...
...
platforms/cuda/tests/TestCudaRandom.cpp
View file @
b256555e
...
...
@@ -128,7 +128,7 @@ void testRandomVelocities() {
ke
+=
0.5
*
system
.
getParticleMass
(
i
)
*
v
.
dot
(
v
);
}
double
expected
=
0.5
*
(
numParticles
*
3
-
system
.
getNumConstraints
())
*
BOLTZ
*
temperture
;
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
4
/
sqrt
(
numParticles
));
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
4
/
sqrt
(
(
double
)
numParticles
));
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
platforms/opencl/include/OpenCLPlatform.h
View file @
b256555e
...
...
@@ -29,7 +29,7 @@
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "windowsExportOpenCL.h"
namespace
OpenMM
{
class
OpenCLContext
;
...
...
@@ -38,7 +38,7 @@ class OpenCLContext;
* This Platform subclass uses OpenCL implementations of the OpenMM kernels.
*/
class
OPENMM_EXPORT
OpenCLPlatform
:
public
Platform
{
class
OPENMM_EXPORT
_OPENCL
OpenCLPlatform
:
public
Platform
{
public:
class
PlatformData
;
OpenCLPlatform
();
...
...
@@ -77,7 +77,7 @@ public:
}
};
class
OPENMM_EXPORT
OpenCLPlatform
::
PlatformData
{
class
OPENMM_EXPORT
_OPENCL
OpenCLPlatform
::
PlatformData
{
public:
PlatformData
(
const
System
&
system
,
const
std
::
string
&
platformPropValue
,
const
std
::
string
&
deviceIndexProperty
,
const
std
::
string
&
precisionProperty
);
~
PlatformData
();
...
...
platforms/opencl/include/windowsExportOpenCL.h
0 → 100644
View file @
b256555e
#ifndef OPENMM_WINDOWSEXPORTOPENCL_H_
#define OPENMM_WINDOWSEXPORTOPENCL_H_
/*
* Shared libraries are messy in Visual Studio. We have to distinguish three
* cases:
* (1) this header is being used to build the OpenMM shared library
* (dllexport)
* (2) this header is being used by a *client* of the OpenMM shared
* library (dllimport)
* (3) we are building the OpenMM static library, or the client is
* being compiled with the expectation of linking with the
* OpenMM static library (nothing special needed)
* In the CMake script for building this library, we define one of the symbols
* OPENMM_OPENCL_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_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 OpenMM 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)
// Keep MS VC++ quiet about lack of dll export of private members.
#pragma warning(disable:4251)
#if defined(OPENMM_OPENCL_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_OPENCL __declspec(dllexport)
#elif defined(OPENMM_OPENCL_BUILDING_STATIC_LIBRARY) || defined(OPENMM_OPENCL_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_OPENCL
#else
#define OPENMM_EXPORT_OPENCL __declspec(dllimport) // i.e., a client of a shared library
#endif
#else
#define OPENMM_EXPORT_OPENCL // Linux, Mac
#endif
#endif // OPENMM_WINDOWSEXPORTOPENCL_H_
platforms/opencl/sharedTarget/CMakeLists.txt
View file @
b256555e
...
...
@@ -19,6 +19,6 @@ 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
}
${
OPENCL_LIBRARIES
}
${
PTHREADS_LIB
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_BUILDING_SHARED_LIBRARY"
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_
OPENCL_
BUILDING_SHARED_LIBRARY"
)
INSTALL_TARGETS
(
/lib/plugins RUNTIME_DIRECTORY /lib/plugins
${
SHARED_TARGET
}
)
platforms/opencl/src/OpenCLArray.h
View file @
b256555e
...
...
@@ -29,7 +29,7 @@
#include "OpenCLContext.h"
#include "openmm/OpenMMException.h"
#include "
openmm/internal/
windowsExport.h"
#include "windowsExport
OpenCL
.h"
#include <iostream>
#include <sstream>
#include <vector>
...
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* and for copying data to and from the OpenCL Buffer.
*/
class
OPENMM_EXPORT
OpenCLArray
{
class
OPENMM_EXPORT
_OPENCL
OpenCLArray
{
public:
/**
* Create an OpenCLArray object. The object is allocated on the heap with the "new" operator.
...
...
Prev
1
2
3
4
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