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
6d356ddc
Commit
6d356ddc
authored
Jan 08, 2014
by
peastman
Browse files
Merge pull request #277 from peastman/winvec
Fixed lots of compilation errors on Windows
parents
a4f7ac48
72e81e04
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
93 additions
and
175 deletions
+93
-175
plugins/amoeba/serialization/include/openmm/serialization/AmoebaGeneralizedKirkwoodForceProxy.h
...penmm/serialization/AmoebaGeneralizedKirkwoodForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaInPlaneAngleForceProxy.h
...clude/openmm/serialization/AmoebaInPlaneAngleForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaMultipoleForceProxy.h
.../include/openmm/serialization/AmoebaMultipoleForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaOutOfPlaneBendForceProxy.h
...ude/openmm/serialization/AmoebaOutOfPlaneBendForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaPiTorsionForceProxy.h
.../include/openmm/serialization/AmoebaPiTorsionForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaStretchBendForceProxy.h
...nclude/openmm/serialization/AmoebaStretchBendForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaTorsionTorsionForceProxy.h
...ude/openmm/serialization/AmoebaTorsionTorsionForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaVdwForceProxy.h
...zation/include/openmm/serialization/AmoebaVdwForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/AmoebaWcaDispersionForceProxy.h
...lude/openmm/serialization/AmoebaWcaDispersionForceProxy.h
+2
-2
plugins/amoeba/serialization/include/openmm/serialization/internal/windowsExportAmoebaSerialization.h
...serialization/internal/windowsExportAmoebaSerialization.h
+0
-41
plugins/amoeba/serialization/src/AmoebaSerializationProxyRegistration.cpp
...erialization/src/AmoebaSerializationProxyRegistration.cpp
+2
-3
plugins/amoeba/wrappers/generateAmoebaWrappers.py
plugins/amoeba/wrappers/generateAmoebaWrappers.py
+22
-21
plugins/drude/serialization/include/openmm/serialization/DrudeForceProxy.h
...ialization/include/openmm/serialization/DrudeForceProxy.h
+2
-2
plugins/drude/serialization/include/openmm/serialization/DrudeLangevinIntegratorProxy.h
...clude/openmm/serialization/DrudeLangevinIntegratorProxy.h
+2
-2
plugins/drude/serialization/include/openmm/serialization/internal/windowsExportDrudeSerialization.h
.../serialization/internal/windowsExportDrudeSerialization.h
+0
-41
plugins/drude/serialization/src/DrudeSerializationProxyRegistration.cpp
...serialization/src/DrudeSerializationProxyRegistration.cpp
+2
-3
wrappers/generateWrappers.py
wrappers/generateWrappers.py
+44
-43
wrappers/python/src/swig_doxygen/doxygen/Doxyfile.in
wrappers/python/src/swig_doxygen/doxygen/Doxyfile.in
+1
-1
No files found.
plugins/amoeba/serialization/include/openmm/serialization/AmoebaGeneralizedKirkwoodForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaGeneralizedKirkwoodForce objects.
* This is a proxy for serializing AmoebaGeneralizedKirkwoodForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaGeneralizedKirkwoodForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaGeneralizedKirkwoodForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaGeneralizedKirkwoodForceProxy
();
AmoebaGeneralizedKirkwoodForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaInPlaneAngleForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaInPlaneAngleForce objects.
* This is a proxy for serializing AmoebaInPlaneAngleForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaInPlaneAngleForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaInPlaneAngleForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaInPlaneAngleForceProxy
();
AmoebaInPlaneAngleForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaMultipoleForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaMultipoleForce objects.
* This is a proxy for serializing AmoebaMultipoleForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaMultipoleForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaMultipoleForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaMultipoleForceProxy
();
AmoebaMultipoleForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaOutOfPlaneBendForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaOutOfPlaneBendForce objects.
* This is a proxy for serializing AmoebaOutOfPlaneBendForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaOutOfPlaneBendForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaOutOfPlaneBendForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaOutOfPlaneBendForceProxy
();
AmoebaOutOfPlaneBendForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaPiTorsionForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaPiTorsionForce objects.
* This is a proxy for serializing AmoebaPiTorsionForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaPiTorsionForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaPiTorsionForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaPiTorsionForceProxy
();
AmoebaPiTorsionForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaStretchBendForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaStretchBendForce objects.
* This is a proxy for serializing AmoebaStretchBendForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaStretchBendForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaStretchBendForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaStretchBendForceProxy
();
AmoebaStretchBendForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaTorsionTorsionForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaTorsionTorsionForce objects.
* This is a proxy for serializing AmoebaTorsionTorsionForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaTorsionTorsionForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaTorsionTorsionForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaTorsionTorsionForceProxy
();
AmoebaTorsionTorsionForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaVdwForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaVdwForce objects.
* This is a proxy for serializing AmoebaVdwForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaVdwForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaVdwForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaVdwForceProxy
();
AmoebaVdwForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/AmoebaWcaDispersionForceProxy.h
View file @
6d356ddc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/
serialization/
internal/windowsExportAmoeba
Serialization
.h"
#include "openmm/internal/windowsExportAmoeba.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing AmoebaWcaDispersionForce objects.
* This is a proxy for serializing AmoebaWcaDispersionForce objects.
*/
*/
class
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
AmoebaWcaDispersionForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_AMOEBA
AmoebaWcaDispersionForceProxy
:
public
SerializationProxy
{
public:
public:
AmoebaWcaDispersionForceProxy
();
AmoebaWcaDispersionForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/amoeba/serialization/include/openmm/serialization/internal/windowsExportAmoebaSerialization.h
deleted
100644 → 0
View file @
a4f7ac48
#ifndef OPENMM_WINDOWSEXPORTAMOEBASERIALIZATION_H_
#define OPENMM_WINDOWSEXPORTAMOEBASERIALIZATION_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_SERIALIZATION_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_SERIALIZATION_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION __declspec(dllexport)
#elif defined(OPENMM_AMOEBA_SERIALIZATION_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_SERIALIZATION_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION
#else
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION __declspec(dllimport) // i.e., a client of a shared library
#endif
#else
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION // Linux, Mac
#endif
#endif // OPENMM_WINDOWSEXPORTAMOEBASERIALIZATION_H_
plugins/amoeba/serialization/src/AmoebaSerializationProxyRegistration.cpp
View file @
6d356ddc
...
@@ -65,11 +65,10 @@
...
@@ -65,11 +65,10 @@
#include "openmm/serialization/AmoebaTorsionTorsionForceProxy.h"
#include "openmm/serialization/AmoebaTorsionTorsionForceProxy.h"
#include "openmm/serialization/AmoebaVdwForceProxy.h"
#include "openmm/serialization/AmoebaVdwForceProxy.h"
#include "openmm/serialization/AmoebaWcaDispersionForceProxy.h"
#include "openmm/serialization/AmoebaWcaDispersionForceProxy.h"
#include "openmm/serialization/internal/windowsExportAmoebaSerialization.h"
#if defined(WIN32)
#if defined(WIN32)
#include <windows.h>
#include <windows.h>
extern
"C"
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
void
registerAmoebaSerializationProxies
();
extern
"C"
OPENMM_EXPORT_AMOEBA
void
registerAmoebaSerializationProxies
();
BOOL
WINAPI
DllMain
(
HANDLE
hModule
,
DWORD
ul_reason_for_call
,
LPVOID
lpReserved
)
{
BOOL
WINAPI
DllMain
(
HANDLE
hModule
,
DWORD
ul_reason_for_call
,
LPVOID
lpReserved
)
{
if
(
ul_reason_for_call
==
DLL_PROCESS_ATTACH
)
if
(
ul_reason_for_call
==
DLL_PROCESS_ATTACH
)
registerAmoebaSerializationProxies
();
registerAmoebaSerializationProxies
();
...
@@ -81,7 +80,7 @@
...
@@ -81,7 +80,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT_AMOEBA
_SERIALIZATION
void
registerAmoebaSerializationProxies
()
{
extern
"C"
OPENMM_EXPORT_AMOEBA
void
registerAmoebaSerializationProxies
()
{
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaGeneralizedKirkwoodForce
),
new
AmoebaGeneralizedKirkwoodForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaGeneralizedKirkwoodForce
),
new
AmoebaGeneralizedKirkwoodForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaBondForce
),
new
AmoebaBondForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaBondForce
),
new
AmoebaBondForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaAngleForce
),
new
AmoebaAngleForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaAngleForce
),
new
AmoebaAngleForceProxy
());
...
...
plugins/amoeba/wrappers/generateAmoebaWrappers.py
View file @
6d356ddc
from
__future__
import
print_function
import
sys
,
os
import
sys
,
os
import
time
import
time
import
getopt
import
getopt
...
@@ -305,16 +306,16 @@ class CHeaderGenerator(WrapperGenerator):
...
@@ -305,16 +306,16 @@ class CHeaderGenerator(WrapperGenerator):
return
type
return
type
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
#ifndef AMOEBA_OPENMM_CWRAPPER_H_
#ifndef AMOEBA_OPENMM_CWRAPPER_H_
#define AMOEBA_OPENMM_CWRAPPER_H_
#define AMOEBA_OPENMM_CWRAPPER_H_
#ifndef OPENMM_EXPORT_AMOEBA
#ifndef OPENMM_EXPORT_AMOEBA
#define OPENMM_EXPORT_AMOEBA
#define OPENMM_EXPORT_AMOEBA
#endif"""
#endif"""
,
file
=
self
.
out
)
self
.
writeGlobalConstants
()
self
.
writeGlobalConstants
()
self
.
writeTypeDeclarations
()
self
.
writeTypeDeclarations
()
print
>>
self
.
out
,
"""
print
(
"""
typedef struct OpenMM_2D_IntArray_struct OpenMM_2D_IntArray;
typedef struct OpenMM_2D_IntArray_struct OpenMM_2D_IntArray;
typedef struct OpenMM_3D_DoubleArray_struct OpenMM_3D_DoubleArray;
typedef struct OpenMM_3D_DoubleArray_struct OpenMM_3D_DoubleArray;
...
@@ -325,16 +326,16 @@ extern "C" {
...
@@ -325,16 +326,16 @@ extern "C" {
/* OpenMM_3D_DoubleArray */
/* OpenMM_3D_DoubleArray */
OPENMM_EXPORT_AMOEBA OpenMM_3D_DoubleArray* OpenMM_3D_DoubleArray_create(int size1, int size2, int size3);
OPENMM_EXPORT_AMOEBA OpenMM_3D_DoubleArray* OpenMM_3D_DoubleArray_create(int size1, int size2, int size3);
OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_set(OpenMM_3D_DoubleArray* array, int index1, int index2, OpenMM_DoubleArray* values);
OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_set(OpenMM_3D_DoubleArray* array, int index1, int index2, OpenMM_DoubleArray* values);
OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_destroy( OpenMM_3D_DoubleArray* array);"""
OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_destroy( OpenMM_3D_DoubleArray* array);"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"""
print
(
"""
#if defined(__cplusplus)
#if defined(__cplusplus)
}
}
#endif
#endif
#endif /*AMOEBA_OPENMM_CWRAPPER_H_*/"""
#endif /*AMOEBA_OPENMM_CWRAPPER_H_*/"""
,
file
=
self
.
out
)
class
CSourceGenerator
(
WrapperGenerator
):
class
CSourceGenerator
(
WrapperGenerator
):
...
@@ -556,7 +557,7 @@ class CSourceGenerator(WrapperGenerator):
...
@@ -556,7 +557,7 @@ class CSourceGenerator(WrapperGenerator):
return
'reinterpret_cast<%s>(%s)'
%
(
type
,
value
)
return
'reinterpret_cast<%s>(%s)'
%
(
type
,
value
)
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
#include "OpenMM.h"
#include "OpenMM.h"
#include "OpenMMAmoeba.h"
#include "OpenMMAmoeba.h"
#include "../../../wrappers/OpenMMCWrapper.h"
#include "../../../wrappers/OpenMMCWrapper.h"
...
@@ -634,10 +635,10 @@ OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_set(OpenMM_3D_DoubleArray* array
...
@@ -634,10 +635,10 @@ OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_set(OpenMM_3D_DoubleArray* array
OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_destroy( OpenMM_3D_DoubleArray* array) {
OPENMM_EXPORT_AMOEBA void OpenMM_3D_DoubleArray_destroy( OpenMM_3D_DoubleArray* array) {
delete reinterpret_cast<std::vector<std::vector<std::vector<double> > >*>(array);
delete reinterpret_cast<std::vector<std::vector<std::vector<double> > >*>(array);
}"""
}"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"}
\n
"
print
(
"}
\n
"
,
file
=
self
.
out
)
class
FortranHeaderGenerator
(
WrapperGenerator
):
class
FortranHeaderGenerator
(
WrapperGenerator
):
"""This class generates the header file for the Fortran API wrappers."""
"""This class generates the header file for the Fortran API wrappers."""
...
@@ -845,33 +846,33 @@ class FortranHeaderGenerator(WrapperGenerator):
...
@@ -845,33 +846,33 @@ class FortranHeaderGenerator(WrapperGenerator):
return
type
return
type
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
MODULE OpenMM_Types
MODULE OpenMM_Types
implicit none
implicit none
"""
"""
,
file
=
self
.
out
)
self
.
writeGlobalConstants
()
self
.
writeGlobalConstants
()
self
.
writeTypeDeclarations
()
self
.
writeTypeDeclarations
()
print
>>
self
.
out
,
"""
print
(
"""
! Enumerations
! Enumerations
integer*4, parameter :: OpenMM_False = 0
integer*4, parameter :: OpenMM_False = 0
integer*4, parameter :: OpenMM_True = 1"""
integer*4, parameter :: OpenMM_True = 1"""
,
file
=
self
.
out
)
for
classNode
in
self
.
_orderedClassNodes
:
for
classNode
in
self
.
_orderedClassNodes
:
self
.
writeEnumerations
(
classNode
)
self
.
writeEnumerations
(
classNode
)
print
>>
self
.
out
,
"""
print
(
"""
END MODULE OpenMM_Types
END MODULE OpenMM_Types
MODULE OpenMM
MODULE OpenMM
use OpenMM_Types; implicit none
use OpenMM_Types; implicit none
interface
interface
"""
"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"""
print
(
"""
end interface
end interface
END MODULE OpenMM"""
END MODULE OpenMM"""
,
file
=
self
.
out
)
class
FortranSourceGenerator
(
WrapperGenerator
):
class
FortranSourceGenerator
(
WrapperGenerator
):
...
@@ -974,7 +975,7 @@ class FortranSourceGenerator(WrapperGenerator):
...
@@ -974,7 +975,7 @@ class FortranSourceGenerator(WrapperGenerator):
if
methodName
in
(
shortClassName
,
destructorName
):
if
methodName
in
(
shortClassName
,
destructorName
):
continue
continue
if
'~'
in
methodName
:
if
'~'
in
methodName
:
print
'***'
,
methodName
,
destructorName
print
(
'***'
,
methodName
,
destructorName
)
if
self
.
shouldHideMethod
(
methodNode
):
if
self
.
shouldHideMethod
(
methodNode
):
continue
continue
isConstMethod
=
(
methodNode
.
attrib
[
'const'
]
==
'yes'
)
isConstMethod
=
(
methodNode
.
attrib
[
'const'
]
==
'yes'
)
...
@@ -1143,7 +1144,7 @@ class FortranSourceGenerator(WrapperGenerator):
...
@@ -1143,7 +1144,7 @@ class FortranSourceGenerator(WrapperGenerator):
return
False
return
False
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
#include "OpenMM.h"
#include "OpenMM.h"
#include "OpenMMAmoeba.h"
#include "OpenMMAmoeba.h"
#include "../../../wrappers/OpenMMCWrapper.h"
#include "../../../wrappers/OpenMMCWrapper.h"
...
@@ -1171,10 +1172,10 @@ static string makeString(const char* fsrc, int length) {
...
@@ -1171,10 +1172,10 @@ static string makeString(const char* fsrc, int length) {
}
}
extern "C" {
extern "C" {
"""
"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"}"
print
(
"}"
,
file
=
self
.
out
)
inputDirname
=
sys
.
argv
[
1
]
inputDirname
=
sys
.
argv
[
1
]
builder
=
CHeaderGenerator
(
inputDirname
,
open
(
os
.
path
.
join
(
sys
.
argv
[
2
],
'AmoebaOpenMMCWrapper.h'
),
'w'
))
builder
=
CHeaderGenerator
(
inputDirname
,
open
(
os
.
path
.
join
(
sys
.
argv
[
2
],
'AmoebaOpenMMCWrapper.h'
),
'w'
))
...
...
plugins/drude/serialization/include/openmm/serialization/DrudeForceProxy.h
View file @
6d356ddc
...
@@ -32,8 +32,8 @@
...
@@ -32,8 +32,8 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/serialization/internal/windowsExportDrudeSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/internal/windowsExportDrude.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing DrudeForce objects.
* This is a proxy for serializing DrudeForce objects.
*/
*/
class
OPENMM_EXPORT_DRUDE
_SERIALIZATION
DrudeForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_DRUDE
DrudeForceProxy
:
public
SerializationProxy
{
public:
public:
DrudeForceProxy
();
DrudeForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/drude/serialization/include/openmm/serialization/DrudeLangevinIntegratorProxy.h
View file @
6d356ddc
...
@@ -32,8 +32,8 @@
...
@@ -32,8 +32,8 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/serialization/internal/windowsExportDrudeSerialization.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/internal/windowsExportDrude.h"
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -41,7 +41,7 @@ namespace OpenMM {
...
@@ -41,7 +41,7 @@ namespace OpenMM {
* This is a proxy for serializing DrudeLangevinIntegrator objects.
* This is a proxy for serializing DrudeLangevinIntegrator objects.
*/
*/
class
OPENMM_EXPORT_DRUDE
_SERIALIZATION
DrudeLangevinIntegratorProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT_DRUDE
DrudeLangevinIntegratorProxy
:
public
SerializationProxy
{
public:
public:
DrudeLangevinIntegratorProxy
();
DrudeLangevinIntegratorProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
...
...
plugins/drude/serialization/include/openmm/serialization/internal/windowsExportDrudeSerialization.h
deleted
100644 → 0
View file @
a4f7ac48
#ifndef OPENMM_WINDOWSEXPORTDRUDESERIALIZATION_H_
#define OPENMM_WINDOWSEXPORTDRUDESERIALIZATION_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_DRUDE_SERIALIZATION_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_DRUDE_SERIALIZATION_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_DRUDE_SERIALIZATION __declspec(dllexport)
#elif defined(OPENMM_DRUDE_SERIALIZATION_BUILDING_STATIC_LIBRARY) || defined(OPENMM_DRUDE_SERIALIZATION_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_DRUDE_SERIALIZATION
#else
#define OPENMM_EXPORT_DRUDE_SERIALIZATION __declspec(dllimport) // i.e., a client of a shared library
#endif
#else
#define OPENMM_EXPORT_DRUDE_SERIALIZATION // Linux, Mac
#endif
#endif // OPENMM_WINDOWSEXPORTDRUDESERIALIZATION_H_
plugins/drude/serialization/src/DrudeSerializationProxyRegistration.cpp
View file @
6d356ddc
...
@@ -47,11 +47,10 @@
...
@@ -47,11 +47,10 @@
#include "openmm/serialization/DrudeForceProxy.h"
#include "openmm/serialization/DrudeForceProxy.h"
#include "openmm/serialization/DrudeLangevinIntegratorProxy.h"
#include "openmm/serialization/DrudeLangevinIntegratorProxy.h"
#include "openmm/serialization/internal/windowsExportDrudeSerialization.h"
#if defined(WIN32)
#if defined(WIN32)
#include <windows.h>
#include <windows.h>
extern
"C"
OPENMM_EXPORT_DRUDE
_SERIALIZATION
void
registerDrudeSerializationProxies
();
extern
"C"
OPENMM_EXPORT_DRUDE
void
registerDrudeSerializationProxies
();
BOOL
WINAPI
DllMain
(
HANDLE
hModule
,
DWORD
ul_reason_for_call
,
LPVOID
lpReserved
)
{
BOOL
WINAPI
DllMain
(
HANDLE
hModule
,
DWORD
ul_reason_for_call
,
LPVOID
lpReserved
)
{
if
(
ul_reason_for_call
==
DLL_PROCESS_ATTACH
)
if
(
ul_reason_for_call
==
DLL_PROCESS_ATTACH
)
registerDrudeSerializationProxies
();
registerDrudeSerializationProxies
();
...
@@ -63,7 +62,7 @@
...
@@ -63,7 +62,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
extern
"C"
OPENMM_EXPORT_DRUDE
_SERIALIZATION
void
registerDrudeSerializationProxies
()
{
extern
"C"
OPENMM_EXPORT_DRUDE
void
registerDrudeSerializationProxies
()
{
SerializationProxy
::
registerProxy
(
typeid
(
DrudeForce
),
new
DrudeForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
DrudeForce
),
new
DrudeForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
DrudeLangevinIntegrator
),
new
DrudeLangevinIntegratorProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
DrudeLangevinIntegrator
),
new
DrudeLangevinIntegratorProxy
());
}
}
wrappers/generateWrappers.py
View file @
6d356ddc
from
__future__
import
print_function
import
sys
,
os
import
sys
,
os
import
time
import
time
import
getopt
import
getopt
...
@@ -303,17 +304,17 @@ class CHeaderGenerator(WrapperGenerator):
...
@@ -303,17 +304,17 @@ class CHeaderGenerator(WrapperGenerator):
return
type
return
type
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
#ifndef OPENMM_CWRAPPER_H_
#ifndef OPENMM_CWRAPPER_H_
#define OPENMM_CWRAPPER_H_
#define OPENMM_CWRAPPER_H_
#ifndef OPENMM_EXPORT
#ifndef OPENMM_EXPORT
#define OPENMM_EXPORT
#define OPENMM_EXPORT
#endif
#endif
"""
"""
,
file
=
self
.
out
)
self
.
writeGlobalConstants
()
self
.
writeGlobalConstants
()
self
.
writeTypeDeclarations
()
self
.
writeTypeDeclarations
()
print
>>
self
.
out
,
"""
print
(
"""
typedef struct OpenMM_Vec3Array_struct OpenMM_Vec3Array;
typedef struct OpenMM_Vec3Array_struct OpenMM_Vec3Array;
typedef struct OpenMM_StringArray_struct OpenMM_StringArray;
typedef struct OpenMM_StringArray_struct OpenMM_StringArray;
typedef struct OpenMM_BondArray_struct OpenMM_BondArray;
typedef struct OpenMM_BondArray_struct OpenMM_BondArray;
...
@@ -366,12 +367,12 @@ extern OPENMM_EXPORT double OpenMM_ParameterArray_get(const OpenMM_ParameterArra
...
@@ -366,12 +367,12 @@ extern OPENMM_EXPORT double OpenMM_ParameterArray_get(const OpenMM_ParameterArra
/* OpenMM_PropertyArray */
/* OpenMM_PropertyArray */
extern OPENMM_EXPORT int OpenMM_PropertyArray_getSize(const OpenMM_PropertyArray* array);
extern OPENMM_EXPORT int OpenMM_PropertyArray_getSize(const OpenMM_PropertyArray* array);
extern OPENMM_EXPORT const char* OpenMM_PropertyArray_get(const OpenMM_PropertyArray* array, const char* name);"""
extern OPENMM_EXPORT const char* OpenMM_PropertyArray_get(const OpenMM_PropertyArray* array, const char* name);"""
,
file
=
self
.
out
)
for
type
in
(
'double'
,
'int'
):
for
type
in
(
'double'
,
'int'
):
name
=
'OpenMM_%sArray'
%
type
.
capitalize
()
name
=
'OpenMM_%sArray'
%
type
.
capitalize
()
values
=
{
'type'
:
type
,
'name'
:
name
}
values
=
{
'type'
:
type
,
'name'
:
name
}
print
>>
self
.
out
,
"""
print
(
"""
/* %(name)s */
/* %(name)s */
extern OPENMM_EXPORT %(name)s* %(name)s_create(int size);
extern OPENMM_EXPORT %(name)s* %(name)s_create(int size);
extern OPENMM_EXPORT void %(name)s_destroy(%(name)s* array);
extern OPENMM_EXPORT void %(name)s_destroy(%(name)s* array);
...
@@ -379,19 +380,19 @@ extern OPENMM_EXPORT int %(name)s_getSize(const %(name)s* array);
...
@@ -379,19 +380,19 @@ extern OPENMM_EXPORT int %(name)s_getSize(const %(name)s* array);
extern OPENMM_EXPORT void %(name)s_resize(%(name)s* array, int size);
extern OPENMM_EXPORT void %(name)s_resize(%(name)s* array, int size);
extern OPENMM_EXPORT void %(name)s_append(%(name)s* array, %(type)s value);
extern OPENMM_EXPORT void %(name)s_append(%(name)s* array, %(type)s value);
extern OPENMM_EXPORT void %(name)s_set(%(name)s* array, int index, %(type)s value);
extern OPENMM_EXPORT void %(name)s_set(%(name)s* array, int index, %(type)s value);
extern OPENMM_EXPORT %(type)s %(name)s_get(const %(name)s* array, int index);"""
%
values
extern OPENMM_EXPORT %(type)s %(name)s_get(const %(name)s* array, int index);"""
%
values
,
file
=
self
.
out
)
for
type
in
(
'int'
,):
for
type
in
(
'int'
,):
name
=
'OpenMM_%sSet'
%
type
.
capitalize
()
name
=
'OpenMM_%sSet'
%
type
.
capitalize
()
values
=
{
'type'
:
type
,
'name'
:
name
}
values
=
{
'type'
:
type
,
'name'
:
name
}
print
>>
self
.
out
,
"""
print
(
"""
/* %(name)s */
/* %(name)s */
extern OPENMM_EXPORT %(name)s* %(name)s_create();
extern OPENMM_EXPORT %(name)s* %(name)s_create();
extern OPENMM_EXPORT void %(name)s_destroy(%(name)s* set);
extern OPENMM_EXPORT void %(name)s_destroy(%(name)s* set);
extern OPENMM_EXPORT int %(name)s_getSize(const %(name)s* set);
extern OPENMM_EXPORT int %(name)s_getSize(const %(name)s* set);
extern OPENMM_EXPORT void %(name)s_insert(%(name)s* set, %(type)s value);"""
%
values
extern OPENMM_EXPORT void %(name)s_insert(%(name)s* set, %(type)s value);"""
%
values
,
file
=
self
.
out
)
print
>>
self
.
out
,
"""
print
(
"""
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
extern OPENMM_EXPORT OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types, int enforcePeriodicBox);
extern OPENMM_EXPORT OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types, int enforcePeriodicBox);
...
@@ -401,16 +402,16 @@ extern OPENMM_EXPORT char* OpenMM_XmlSerializer_serializeState(const OpenMM_Stat
...
@@ -401,16 +402,16 @@ extern OPENMM_EXPORT char* OpenMM_XmlSerializer_serializeState(const OpenMM_Stat
extern OPENMM_EXPORT char* OpenMM_XmlSerializer_serializeIntegrator(const OpenMM_Integrator* integrator);
extern OPENMM_EXPORT char* OpenMM_XmlSerializer_serializeIntegrator(const OpenMM_Integrator* integrator);
extern OPENMM_EXPORT OpenMM_System* OpenMM_XmlSerializer_deserializeSystem(const char* xml);
extern OPENMM_EXPORT OpenMM_System* OpenMM_XmlSerializer_deserializeSystem(const char* xml);
extern OPENMM_EXPORT OpenMM_State* OpenMM_XmlSerializer_deserializeState(const char* xml);
extern OPENMM_EXPORT OpenMM_State* OpenMM_XmlSerializer_deserializeState(const char* xml);
extern OPENMM_EXPORT OpenMM_Integrator* OpenMM_XmlSerializer_deserializeIntegrator(const char* xml);"""
extern OPENMM_EXPORT OpenMM_Integrator* OpenMM_XmlSerializer_deserializeIntegrator(const char* xml);"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"""
print
(
"""
#if defined(__cplusplus)
#if defined(__cplusplus)
}
}
#endif
#endif
#endif /*OPENMM_CWRAPPER_H_*/"""
#endif /*OPENMM_CWRAPPER_H_*/"""
,
file
=
self
.
out
)
class
CSourceGenerator
(
WrapperGenerator
):
class
CSourceGenerator
(
WrapperGenerator
):
...
@@ -630,7 +631,7 @@ class CSourceGenerator(WrapperGenerator):
...
@@ -630,7 +631,7 @@ class CSourceGenerator(WrapperGenerator):
return
'reinterpret_cast<%s>(%s)'
%
(
type
,
value
)
return
'reinterpret_cast<%s>(%s)'
%
(
type
,
value
)
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
#include "OpenMM.h"
#include "OpenMM.h"
#include "OpenMMCWrapper.h"
#include "OpenMMCWrapper.h"
#include <cstdlib>
#include <cstdlib>
...
@@ -742,12 +743,12 @@ OPENMM_EXPORT const char* OpenMM_PropertyArray_get(const OpenMM_PropertyArray* a
...
@@ -742,12 +743,12 @@ OPENMM_EXPORT const char* OpenMM_PropertyArray_get(const OpenMM_PropertyArray* a
if (iter == params->end())
if (iter == params->end())
throw OpenMMException("OpenMM_PropertyArray_get: No such property");
throw OpenMMException("OpenMM_PropertyArray_get: No such property");
return iter->second.c_str();
return iter->second.c_str();
}"""
}"""
,
file
=
self
.
out
)
for
type
in
(
'double'
,
'int'
):
for
type
in
(
'double'
,
'int'
):
name
=
'OpenMM_%sArray'
%
type
.
capitalize
()
name
=
'OpenMM_%sArray'
%
type
.
capitalize
()
values
=
{
'type'
:
type
,
'name'
:
name
}
values
=
{
'type'
:
type
,
'name'
:
name
}
print
>>
self
.
out
,
"""
print
(
"""
/* %(name)s */
/* %(name)s */
OPENMM_EXPORT %(name)s* %(name)s_create(int size) {
OPENMM_EXPORT %(name)s* %(name)s_create(int size) {
return reinterpret_cast<%(name)s*>(new vector<%(type)s>(size));
return reinterpret_cast<%(name)s*>(new vector<%(type)s>(size));
...
@@ -769,12 +770,12 @@ OPENMM_EXPORT void %(name)s_set(%(name)s* array, int index, %(type)s value) {
...
@@ -769,12 +770,12 @@ OPENMM_EXPORT void %(name)s_set(%(name)s* array, int index, %(type)s value) {
}
}
OPENMM_EXPORT %(type)s %(name)s_get(const %(name)s* array, int index) {
OPENMM_EXPORT %(type)s %(name)s_get(const %(name)s* array, int index) {
return (*reinterpret_cast<const vector<%(type)s>*>(array))[index];
return (*reinterpret_cast<const vector<%(type)s>*>(array))[index];
}"""
%
values
}"""
%
values
,
file
=
self
.
out
)
for
type
in
(
'int'
,):
for
type
in
(
'int'
,):
name
=
'OpenMM_%sSet'
%
type
.
capitalize
()
name
=
'OpenMM_%sSet'
%
type
.
capitalize
()
values
=
{
'type'
:
type
,
'name'
:
name
}
values
=
{
'type'
:
type
,
'name'
:
name
}
print
>>
self
.
out
,
"""
print
(
"""
/* %(name)s */
/* %(name)s */
OPENMM_EXPORT %(name)s* %(name)s_create() {
OPENMM_EXPORT %(name)s* %(name)s_create() {
return reinterpret_cast<%(name)s*>(new set<%(type)s>());
return reinterpret_cast<%(name)s*>(new set<%(type)s>());
...
@@ -787,9 +788,9 @@ OPENMM_EXPORT int %(name)s_getSize(const %(name)s* s) {
...
@@ -787,9 +788,9 @@ OPENMM_EXPORT int %(name)s_getSize(const %(name)s* s) {
}
}
OPENMM_EXPORT void %(name)s_insert(%(name)s* s, %(type)s value) {
OPENMM_EXPORT void %(name)s_insert(%(name)s* s, %(type)s value) {
reinterpret_cast<set<%(type)s>*>(s)->insert(value);
reinterpret_cast<set<%(type)s>*>(s)->insert(value);
}"""
%
values
}"""
%
values
,
file
=
self
.
out
)
print
>>
self
.
out
,
"""
print
(
"""
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
OPENMM_EXPORT OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types, int enforcePeriodicBox) {
OPENMM_EXPORT OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types, int enforcePeriodicBox) {
...
@@ -836,9 +837,9 @@ OPENMM_EXPORT OpenMM_Integrator* OpenMM_XmlSerializer_deserializeIntegrator(cons
...
@@ -836,9 +837,9 @@ OPENMM_EXPORT OpenMM_Integrator* OpenMM_XmlSerializer_deserializeIntegrator(cons
string input(xml);
string input(xml);
stringstream stream(input);
stringstream stream(input);
return reinterpret_cast<OpenMM_Integrator*>(OpenMM::XmlSerializer::deserialize<OpenMM::Integrator>(stream));
return reinterpret_cast<OpenMM_Integrator*>(OpenMM::XmlSerializer::deserialize<OpenMM::Integrator>(stream));
}"""
}"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"}
\n
"
print
(
"}
\n
"
,
file
=
self
.
out
)
class
FortranHeaderGenerator
(
WrapperGenerator
):
class
FortranHeaderGenerator
(
WrapperGenerator
):
"""This class generates the header file for the Fortran API wrappers."""
"""This class generates the header file for the Fortran API wrappers."""
...
@@ -1049,13 +1050,13 @@ class FortranHeaderGenerator(WrapperGenerator):
...
@@ -1049,13 +1050,13 @@ class FortranHeaderGenerator(WrapperGenerator):
return
type
return
type
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
MODULE OpenMM_Types
MODULE OpenMM_Types
implicit none
implicit none
"""
"""
,
file
=
self
.
out
)
self
.
writeGlobalConstants
()
self
.
writeGlobalConstants
()
self
.
writeTypeDeclarations
()
self
.
writeTypeDeclarations
()
print
>>
self
.
out
,
"""
print
(
"""
type OpenMM_Vec3Array
type OpenMM_Vec3Array
integer*8 :: handle = 0
integer*8 :: handle = 0
end type
end type
...
@@ -1091,10 +1092,10 @@ MODULE OpenMM_Types
...
@@ -1091,10 +1092,10 @@ MODULE OpenMM_Types
! Enumerations
! Enumerations
integer*4, parameter :: OpenMM_False = 0
integer*4, parameter :: OpenMM_False = 0
integer*4, parameter :: OpenMM_True = 1"""
integer*4, parameter :: OpenMM_True = 1"""
,
file
=
self
.
out
)
for
classNode
in
self
.
_orderedClassNodes
:
for
classNode
in
self
.
_orderedClassNodes
:
self
.
writeEnumerations
(
classNode
)
self
.
writeEnumerations
(
classNode
)
print
>>
self
.
out
,
"""
print
(
"""
END MODULE OpenMM_Types
END MODULE OpenMM_Types
MODULE OpenMM
MODULE OpenMM
...
@@ -1250,12 +1251,12 @@ MODULE OpenMM
...
@@ -1250,12 +1251,12 @@ MODULE OpenMM
type (OpenMM_PropertyArray) target
type (OpenMM_PropertyArray) target
character(*) name
character(*) name
character(*) result
character(*) result
end subroutine"""
end subroutine"""
,
file
=
self
.
out
)
arrayTypes
=
{
'OpenMM_DoubleArray'
:
'real*8'
,
'OpenMM_IntArray'
:
'integer*4'
}
arrayTypes
=
{
'OpenMM_DoubleArray'
:
'real*8'
,
'OpenMM_IntArray'
:
'integer*4'
}
for
name
in
arrayTypes
:
for
name
in
arrayTypes
:
values
=
{
'type'
:
arrayTypes
[
name
],
'name'
:
name
}
values
=
{
'type'
:
arrayTypes
[
name
],
'name'
:
name
}
print
>>
self
.
out
,
"""
print
(
"""
! %(name)s
! %(name)s
subroutine %(name)s_create(result, size)
subroutine %(name)s_create(result, size)
use OpenMM_Types; implicit none
use OpenMM_Types; implicit none
...
@@ -1292,9 +1293,9 @@ MODULE OpenMM
...
@@ -1292,9 +1293,9 @@ MODULE OpenMM
type (%(name)s) target
type (%(name)s) target
integer*4 index
integer*4 index
%(type)s result
%(type)s result
end subroutine"""
%
values
end subroutine"""
%
values
,
file
=
self
.
out
)
print
>>
self
.
out
,
"""
print
(
"""
! These methods need to be handled specially, since their C++ APIs cannot be directly translated to Fortran.
! These methods need to be handled specially, since their C++ APIs cannot be directly translated to Fortran.
! Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself.
! Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself.
subroutine OpenMM_Context_getState(target, types, enforcePeriodicBox, result)
subroutine OpenMM_Context_getState(target, types, enforcePeriodicBox, result)
...
@@ -1341,11 +1342,11 @@ MODULE OpenMM
...
@@ -1341,11 +1342,11 @@ MODULE OpenMM
use OpenMM_Types; implicit none
use OpenMM_Types; implicit none
character(*) xml
character(*) xml
type(OpenMM_Integrator) result
type(OpenMM_Integrator) result
end subroutine"""
end subroutine"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"""
print
(
"""
end interface
end interface
contains
contains
...
@@ -1404,7 +1405,7 @@ contains
...
@@ -1404,7 +1405,7 @@ contains
end do
end do
end subroutine
end subroutine
END MODULE OpenMM"""
END MODULE OpenMM"""
,
file
=
self
.
out
)
class
FortranSourceGenerator
(
WrapperGenerator
):
class
FortranSourceGenerator
(
WrapperGenerator
):
...
@@ -1505,7 +1506,7 @@ class FortranSourceGenerator(WrapperGenerator):
...
@@ -1505,7 +1506,7 @@ class FortranSourceGenerator(WrapperGenerator):
if
methodName
in
(
shortClassName
,
destructorName
):
if
methodName
in
(
shortClassName
,
destructorName
):
continue
continue
if
'~'
in
methodName
:
if
'~'
in
methodName
:
print
'***'
,
methodName
,
destructorName
print
(
'***'
,
methodName
,
destructorName
)
if
self
.
shouldHideMethod
(
methodNode
):
if
self
.
shouldHideMethod
(
methodNode
):
continue
continue
isConstMethod
=
(
methodNode
.
attrib
[
'const'
]
==
'yes'
)
isConstMethod
=
(
methodNode
.
attrib
[
'const'
]
==
'yes'
)
...
@@ -1674,7 +1675,7 @@ class FortranSourceGenerator(WrapperGenerator):
...
@@ -1674,7 +1675,7 @@ class FortranSourceGenerator(WrapperGenerator):
return
False
return
False
def
writeOutput
(
self
):
def
writeOutput
(
self
):
print
>>
self
.
out
,
"""
print
(
"""
#include "OpenMM.h"
#include "OpenMM.h"
#include "OpenMMCWrapper.h"
#include "OpenMMCWrapper.h"
#include <cstring>
#include <cstring>
...
@@ -1883,12 +1884,12 @@ OPENMM_EXPORT const char* openmm_propertyarray_get_(const OpenMM_PropertyArray*
...
@@ -1883,12 +1884,12 @@ OPENMM_EXPORT const char* openmm_propertyarray_get_(const OpenMM_PropertyArray*
}
}
OPENMM_EXPORT const char* OPENMM_PROPERTYARRAY_GET(const OpenMM_PropertyArray* const& array, const char* name, int length) {
OPENMM_EXPORT const char* OPENMM_PROPERTYARRAY_GET(const OpenMM_PropertyArray* const& array, const char* name, int length) {
return OpenMM_PropertyArray_get(array, makeString(name, length).c_str());
return OpenMM_PropertyArray_get(array, makeString(name, length).c_str());
}"""
}"""
,
file
=
self
.
out
)
for
type
in
(
'double'
,
'int'
):
for
type
in
(
'double'
,
'int'
):
name
=
'OpenMM_%sArray'
%
type
.
capitalize
()
name
=
'OpenMM_%sArray'
%
type
.
capitalize
()
values
=
{
'type'
:
type
,
'name'
:
name
,
'name_lower'
:
name
.
lower
(),
'name_upper'
:
name
.
upper
()}
values
=
{
'type'
:
type
,
'name'
:
name
,
'name_lower'
:
name
.
lower
(),
'name_upper'
:
name
.
upper
()}
print
>>
self
.
out
,
"""
print
(
"""
/* %(name)s */
/* %(name)s */
OPENMM_EXPORT void %(name_lower)s_create_(%(name)s*& result, const int& size) {
OPENMM_EXPORT void %(name_lower)s_create_(%(name)s*& result, const int& size) {
result = %(name)s_create(size);
result = %(name)s_create(size);
...
@@ -1933,12 +1934,12 @@ OPENMM_EXPORT void %(name_lower)s_get_(const %(name)s* const& array, const int&
...
@@ -1933,12 +1934,12 @@ OPENMM_EXPORT void %(name_lower)s_get_(const %(name)s* const& array, const int&
}
}
OPENMM_EXPORT void %(name_upper)s_GET(const %(name)s* const& array, const int& index, %(type)s& result) {
OPENMM_EXPORT void %(name_upper)s_GET(const %(name)s* const& array, const int& index, %(type)s& result) {
result = %(name)s_get(array, index-1);
result = %(name)s_get(array, index-1);
}"""
%
values
}"""
%
values
,
file
=
self
.
out
)
for
type
in
(
'int'
,
):
for
type
in
(
'int'
,
):
name
=
'OpenMM_%sSet'
%
type
.
capitalize
()
name
=
'OpenMM_%sSet'
%
type
.
capitalize
()
values
=
{
'type'
:
type
,
'name'
:
name
,
'name_lower'
:
name
.
lower
(),
'name_upper'
:
name
.
upper
()}
values
=
{
'type'
:
type
,
'name'
:
name
,
'name_lower'
:
name
.
lower
(),
'name_upper'
:
name
.
upper
()}
print
>>
self
.
out
,
"""
print
(
"""
/* %(name)s */
/* %(name)s */
OPENMM_EXPORT void %(name_lower)s_create_(%(name)s*& result) {
OPENMM_EXPORT void %(name_lower)s_create_(%(name)s*& result) {
result = %(name)s_create();
result = %(name)s_create();
...
@@ -1965,9 +1966,9 @@ OPENMM_EXPORT void %(name_lower)s_insert_(%(name)s* const& array, const %(type)s
...
@@ -1965,9 +1966,9 @@ OPENMM_EXPORT void %(name_lower)s_insert_(%(name)s* const& array, const %(type)s
}
}
OPENMM_EXPORT void %(name_upper)s_INSERT(%(name)s* const& array, const %(type)s& value) {
OPENMM_EXPORT void %(name_upper)s_INSERT(%(name)s* const& array, const %(type)s& value) {
%(name)s_insert(array, value);
%(name)s_insert(array, value);
}"""
%
values
}"""
%
values
,
file
=
self
.
out
)
print
>>
self
.
out
,
"""
print
(
"""
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
OPENMM_EXPORT void openmm_context_getstate_(const OpenMM_Context*& target, int const& types, int const& enforcePeriodicBox, OpenMM_State*& result) {
OPENMM_EXPORT void openmm_context_getstate_(const OpenMM_Context*& target, int const& types, int const& enforcePeriodicBox, OpenMM_State*& result) {
...
@@ -2017,10 +2018,10 @@ OPENMM_EXPORT void openmm_xmlserializer_deserializeintegrator_(const char* xml,
...
@@ -2017,10 +2018,10 @@ OPENMM_EXPORT void openmm_xmlserializer_deserializeintegrator_(const char* xml,
}
}
OPENMM_EXPORT void OPENMM_XMLSERIALIZER_DESERIALIZEINTEGRATOR(const char* xml, OpenMM_Integrator*& result, int length) {
OPENMM_EXPORT void OPENMM_XMLSERIALIZER_DESERIALIZEINTEGRATOR(const char* xml, OpenMM_Integrator*& result, int length) {
result = OpenMM_XmlSerializer_deserializeIntegrator(makeString(xml, length).c_str());
result = OpenMM_XmlSerializer_deserializeIntegrator(makeString(xml, length).c_str());
}"""
}"""
,
file
=
self
.
out
)
self
.
writeClasses
()
self
.
writeClasses
()
print
>>
self
.
out
,
"}"
print
(
"}"
,
file
=
self
.
out
)
inputDirname
=
sys
.
argv
[
1
]
inputDirname
=
sys
.
argv
[
1
]
builder
=
CHeaderGenerator
(
inputDirname
,
open
(
os
.
path
.
join
(
sys
.
argv
[
2
],
'OpenMMCWrapper.h'
),
'w'
))
builder
=
CHeaderGenerator
(
inputDirname
,
open
(
os
.
path
.
join
(
sys
.
argv
[
2
],
'OpenMMCWrapper.h'
),
'w'
))
...
...
wrappers/python/src/swig_doxygen/doxygen/Doxyfile.in
View file @
6d356ddc
...
@@ -600,7 +600,7 @@ RECURSIVE = YES
...
@@ -600,7 +600,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
EXCLUDE =
*Impl.h
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
# directories that are symbolic links (a Unix filesystem feature) are excluded
...
...
Prev
1
2
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