"csrc/vscode:/vscode.git/clone" did not exist on "8c44b1fa968e0eaab024f1527a3f5d3074d91fcf"
Commit b256555e authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed compilation errors on Windows

parent 59b69776
......@@ -33,7 +33,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/Force.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include <vector>
namespace OpenMM {
......@@ -45,7 +45,7 @@ namespace OpenMM {
* a stretch-bend has been added, you can modify its force field parameters by calling setStretchBendParameters().
*/
class OPENMM_EXPORT AmoebaStretchBendForce : public Force {
class OPENMM_EXPORT_AMOEBA AmoebaStretchBendForce : public Force {
public:
......
......@@ -33,7 +33,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/Force.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include <vector>
#include <cmath>
......@@ -50,7 +50,7 @@ typedef std::vector< std::vector< std::vector<float> > > TorsionTorsionGridFloat
* a torsion-torsion has been added, you can modify its force field parameters by calling setTorsionTorsionParameters().
*/
class OPENMM_EXPORT AmoebaTorsionTorsionForce : public Force {
class OPENMM_EXPORT_AMOEBA AmoebaTorsionTorsionForce : public Force {
public:
/**
......
......@@ -33,7 +33,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/Force.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include <vector>
namespace OpenMM {
......@@ -51,7 +51,7 @@ namespace OpenMM {
* from the parent atom to the interaction site.
*/
class OPENMM_EXPORT AmoebaVdwForce : public Force {
class OPENMM_EXPORT_AMOEBA AmoebaVdwForce : public Force {
public:
/**
* This is an enumeration of the different methods that may be used for handling long range nonbonded forces.
......
......@@ -33,7 +33,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/Force.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include <vector>
namespace OpenMM {
......@@ -46,7 +46,7 @@ namespace OpenMM {
* a particle has been added, you can modify its force field parameters by calling setParticleParameters().
*/
class OPENMM_EXPORT AmoebaWcaDispersionForce : public Force {
class OPENMM_EXPORT_AMOEBA AmoebaWcaDispersionForce : public Force {
public:
......
......@@ -45,7 +45,7 @@ namespace OpenMM {
* This is the internal implementation of AmoebaMultipoleForce.
*/
class OPENMM_EXPORT AmoebaMultipoleForceImpl : public ForceImpl {
class OPENMM_EXPORT_AMOEBA AmoebaMultipoleForceImpl : public ForceImpl {
public:
AmoebaMultipoleForceImpl(AmoebaMultipoleForce& owner);
~AmoebaMultipoleForceImpl();
......
......@@ -61,7 +61,7 @@ public:
}
std::vector<std::string> getKernelNames();
OPENMM_EXPORT static void reorderGrid( const TorsionTorsionGrid& grid, TorsionTorsionGrid& reorderedGrid );
OPENMM_EXPORT_AMOEBA static void reorderGrid( const TorsionTorsionGrid& grid, TorsionTorsionGrid& reorderedGrid );
private:
AmoebaTorsionTorsionForce& owner;
......
......@@ -47,7 +47,7 @@ class System;
* This is the internal implementation of AmoebaVdwForce.
*/
class AmoebaVdwForceImpl : public ForceImpl {
class OPENMM_EXPORT_AMOEBA AmoebaVdwForceImpl : public ForceImpl {
public:
AmoebaVdwForceImpl(AmoebaVdwForce& owner);
~AmoebaVdwForceImpl();
......
......@@ -45,7 +45,7 @@ namespace OpenMM {
* This is the internal implementation of AmoebaWcaDispersionForce.
*/
class OPENMM_EXPORT AmoebaWcaDispersionForceImpl : public ForceImpl {
class OPENMM_EXPORT_AMOEBA AmoebaWcaDispersionForceImpl : public ForceImpl {
public:
AmoebaWcaDispersionForceImpl(AmoebaWcaDispersionForce& owner);
~AmoebaWcaDispersionForceImpl();
......
#ifndef OPENMM_WINDOWSEXPORTAMOEBA_H_
#define OPENMM_WINDOWSEXPORTAMOEBA_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_AMOEBA_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_AMOEBA_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_AMOEBA __declspec(dllexport)
#elif defined(OPENMM_AMOEBA_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_AMOEBA
#else
#define OPENMM_EXPORT_AMOEBA __declspec(dllimport) // i.e., a client of a shared library
#endif
#else
#define OPENMM_EXPORT_AMOEBA // Linux, Mac
#endif
#endif // OPENMM_WINDOWSEXPORTAMOEBA_H_
......@@ -24,6 +24,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#ifdef WIN32
#define _USE_MATH_DEFINES // Needed to get M_PI
#endif
#include "AmoebaCudaKernels.h"
#include "CudaAmoebaKernelSources.h"
#include "openmm/internal/ContextImpl.h"
......
......@@ -1349,7 +1349,8 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No
amoebaBondForce->setAmoebaGlobalBondQuartic( 0.0 );
system.addForce(amoebaBondForce);
std::vector<Vec3> positions(numberOfParticles);
static std::vector<Vec3> positions; // Static to work around bug in Visual Studio that makes compilation very very slow.
positions.resize(numberOfParticles);
positions[0] = Vec3( 8.0394300e-01, 5.8680350e-01, 4.9277700e-02 );
positions[1] = Vec3( 7.5814940e-01, 5.0226660e-01, 4.0375900e-02 );
......@@ -2038,7 +2039,8 @@ static void testPMEMutualPolarizationLargeWater( FILE* log ) {
setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::PME, AmoebaMultipoleForce::Mutual,
cutoff, inputPmeGridDimension, testName,
forces, energy, outputMultipoleMoments, inputGrid, outputGridPotential, log );
std::vector<Vec3> expectedForces(numberOfParticles);
static std::vector<Vec3> expectedForces; // Static to work around bug in Visual Studio that makes compilation very very slow.
expectedForces.resize(numberOfParticles);
double expectedEnergy = -1.3268930e+04;
......
......@@ -27,7 +27,6 @@
#include "AmoebaReferenceKernelFactory.h"
#include "AmoebaReferenceKernels.h"
#include "ReferencePlatform.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/OpenMMException.h"
......
......@@ -81,7 +81,7 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src )
# Create the library
ADD_LIBRARY(${OPENMM_AMOEBA_SERIALIZATION_LIBRARY_NAME} SHARED ${SOURCE_FILES} ${SOURCE_INCLUDE_FILES} ${API_ABS_INCLUDE_FILES})
TARGET_LINK_LIBRARIES(${OPENMM_AMOEBA_SERIALIZATION_LIBRARY_NAME} ${OPENMM_AMOEBA_LIBRARY_NAME} ${OPENMM_SERIALIZATION_LIBRARY_NAME} ${SHARED_TARGET})
SET_TARGET_PROPERTIES(${OPENMM_AMOEBA_SERIALIZATION_LIBRARY_NAME} PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY -DTIXML_USE_STL -DIEEE_8087")
SET_TARGET_PROPERTIES(${OPENMM_AMOEBA_SERIALIZATION_LIBRARY_NAME} PROPERTIES COMPILE_FLAGS "-DOPENMM_AMOEBA_SERIALIZATION_BUILDING_SHARED_LIBRARY -DTIXML_USE_STL -DIEEE_8087")
INSTALL_TARGETS(/lib/plugins RUNTIME_DIRECTORY /lib/plugins ${OPENMM_AMOEBA_SERIALIZATION_LIBRARY_NAME})
ADD_SUBDIRECTORY(tests)
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaAngleForce objects.
*/
class OPENMM_EXPORT AmoebaAngleForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaAngleForceProxy : public SerializationProxy {
public:
AmoebaAngleForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaBondForce objects.
*/
class OPENMM_EXPORT AmoebaBondForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaBondForceProxy : public SerializationProxy {
public:
AmoebaBondForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaGeneralizedKirkwoodForce objects.
*/
class OPENMM_EXPORT AmoebaGeneralizedKirkwoodForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaGeneralizedKirkwoodForceProxy : public SerializationProxy {
public:
AmoebaGeneralizedKirkwoodForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaInPlaneAngleForce objects.
*/
class OPENMM_EXPORT AmoebaInPlaneAngleForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaInPlaneAngleForceProxy : public SerializationProxy {
public:
AmoebaInPlaneAngleForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaMultipoleForce objects.
*/
class OPENMM_EXPORT AmoebaMultipoleForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaMultipoleForceProxy : public SerializationProxy {
public:
AmoebaMultipoleForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaOutOfPlaneBendForce objects.
*/
class OPENMM_EXPORT AmoebaOutOfPlaneBendForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaOutOfPlaneBendForceProxy : public SerializationProxy {
public:
AmoebaOutOfPlaneBendForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
......@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
namespace OpenMM {
......@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaPiTorsionForce objects.
*/
class OPENMM_EXPORT AmoebaPiTorsionForceProxy : public SerializationProxy {
class OPENMM_EXPORT_AMOEBA_SERIALIZATION AmoebaPiTorsionForceProxy : public SerializationProxy {
public:
AmoebaPiTorsionForceProxy();
void serialize(const void* object, SerializationNode& node) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment