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
17d1268c
Commit
17d1268c
authored
Jun 18, 2009
by
Michael Sherman
Browse files
Move wrappers into examples directory to make it easier to build them.
parent
93ebe185
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
36 deletions
+37
-36
examples/CMakeLists.txt
examples/CMakeLists.txt
+34
-33
examples/HelloArgonInC.c
examples/HelloArgonInC.c
+1
-1
examples/HelloSodiumChlorideInC.c
examples/HelloSodiumChlorideInC.c
+1
-1
examples/Makefile
examples/Makefile
+1
-1
examples/OpenMM_CWrapper.cpp
examples/OpenMM_CWrapper.cpp
+0
-0
examples/OpenMM_CWrapper.h
examples/OpenMM_CWrapper.h
+0
-0
examples/OpenMM_Module.f90
examples/OpenMM_Module.f90
+0
-0
No files found.
examples/CMakeLists.txt
View file @
17d1268c
...
@@ -13,21 +13,20 @@
...
@@ -13,21 +13,20 @@
# versions of the executable.
# versions of the executable.
SET
(
OpenMM_CWRAPPER_LIB
"OpenMM_CWrapper"
)
SET
(
OpenMM_CWRAPPER
"OpenMM_CWrapper"
)
SET
(
OpenMM_FMODULE
"OpenMM_Module"
)
ADD_SUBDIRECTORY
(
wrappers
)
SET
(
CPP_EXAMPLES HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox
)
SET
(
C_EXAMPLES HelloArgonInC HelloSodiumChlorideInC
)
SET
(
F_EXAMPLES HelloArgonInFortran HelloSodiumChlorideInFortran
)
SET
(
BUILD_TESTING_SHARED 1
)
SET
(
BUILD_TESTING_SHARED 1
)
SET
(
BUILD_TESTING_STATIC 1
)
SET
(
BUILD_TESTING_STATIC 1
)
FILE
(
GLOB EXAMPLES
"*.cpp"
)
FOREACH
(
EX_ROOT
${
CPP_EXAMPLES
}
)
FOREACH
(
EX_PROG
${
EXAMPLES
}
)
GET_FILENAME_COMPONENT
(
EX_SRC
${
EX_PROG
}
NAME
)
GET_FILENAME_COMPONENT
(
EX_ROOT
${
EX_PROG
}
NAME_WE
)
IF
(
BUILD_TESTING_SHARED
)
IF
(
BUILD_TESTING_SHARED
)
# Link with shared library
# Link with shared library
ADD_EXECUTABLE
(
${
EX_ROOT
}
${
EX_
P
RO
G
}
)
ADD_EXECUTABLE
(
${
EX_ROOT
}
${
EX_RO
OT
}
.cpp
)
SET_TARGET_PROPERTIES
(
${
EX_ROOT
}
SET_TARGET_PROPERTIES
(
${
EX_ROOT
}
PROPERTIES
PROPERTIES
PROJECT_LABEL
"Example -
${
EX_ROOT
}
"
)
PROJECT_LABEL
"Example -
${
EX_ROOT
}
"
)
...
@@ -37,7 +36,7 @@ FOREACH(EX_PROG ${EXAMPLES})
...
@@ -37,7 +36,7 @@ FOREACH(EX_PROG ${EXAMPLES})
IF
(
BUILD_TESTING_STATIC
)
IF
(
BUILD_TESTING_STATIC
)
# Link with static library
# Link with static library
SET
(
EX_STATIC
${
EX_ROOT
}
Static
)
SET
(
EX_STATIC
${
EX_ROOT
}
Static
)
ADD_EXECUTABLE
(
${
EX_STATIC
}
${
EX_
P
RO
G
}
)
ADD_EXECUTABLE
(
${
EX_STATIC
}
${
EX_RO
OT
}
.cpp
)
SET_TARGET_PROPERTIES
(
${
EX_STATIC
}
SET_TARGET_PROPERTIES
(
${
EX_STATIC
}
PROPERTIES
PROPERTIES
COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES"
COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES"
...
@@ -45,39 +44,41 @@ FOREACH(EX_PROG ${EXAMPLES})
...
@@ -45,39 +44,41 @@ FOREACH(EX_PROG ${EXAMPLES})
TARGET_LINK_LIBRARIES
(
${
EX_STATIC
}
${
STATIC_TARGET
}
)
TARGET_LINK_LIBRARIES
(
${
EX_STATIC
}
${
STATIC_TARGET
}
)
ENDIF
(
BUILD_TESTING_STATIC
)
ENDIF
(
BUILD_TESTING_STATIC
)
INSTALL
(
FILES
${
EX_SRC
}
DESTINATION examples
)
INSTALL
(
FILES
${
EX_ROOT
}
.cpp DESTINATION examples
)
ENDFOREACH
(
EX_PROG
${
ADHOC_TESTS
}
)
FILE
(
GLOB EXAMPLES
"*.c"
)
ENDFOREACH
(
EX_PROG
${
CPP_EXAMPLES
}
)
FOREACH
(
EX_PROG
${
EXAMPLES
}
)
GET_FILENAME_COMPONENT
(
EX_SRC
${
EX_PROG
}
NAME
)
GET_FILENAME_COMPONENT
(
EX_ROOT
${
EX_PROG
}
NAME_WE
)
FOREACH
(
EX_ROOT
${
C_EXAMPLES
}
)
IF
(
BUILD_TESTING_SHARED
)
IF
(
BUILD_TESTING_SHARED
)
# Link with shared library
# Link with shared library
ADD_EXECUTABLE
(
${
EX_ROOT
}
${
EX_
PROG
}
)
ADD_EXECUTABLE
(
${
EX_ROOT
}
${
EX_
ROOT
}
.c
${
OpenMM_CWRAPPER
}
.cpp
)
SET_TARGET_PROPERTIES
(
${
EX_ROOT
}
SET_TARGET_PROPERTIES
(
${
EX_ROOT
}
PROPERTIES
PROPERTIES
PROJECT_LABEL
"Example C -
${
EX_ROOT
}
"
)
PROJECT_LABEL
"Example C -
${
EX_ROOT
}
"
)
TARGET_LINK_LIBRARIES
(
${
EX_ROOT
}
TARGET_LINK_LIBRARIES
(
${
EX_ROOT
}
${
SHARED_TARGET
}
)
${
OpenMM_CWRAPPER_LIB
}
${
SHARED_TARGET
}
)
ENDIF
(
BUILD_TESTING_SHARED
)
ENDIF
(
BUILD_TESTING_SHARED
)
# IF (BUILD_TESTING_STATIC)
IF
(
BUILD_TESTING_STATIC
)
# # Link with static library
# Link with static library
# SET(EX_STATIC ${EX_ROOT}Static)
SET
(
EX_STATIC
${
EX_ROOT
}
Static
)
# ADD_EXECUTABLE(${EX_STATIC} ${EX_PROG})
ADD_EXECUTABLE
(
${
EX_STATIC
}
${
EX_ROOT
}
.c
${
OpenMM_CWRAPPER
}
.cpp
)
# SET_TARGET_PROPERTIES(${EX_STATIC}
SET_TARGET_PROPERTIES
(
${
EX_STATIC
}
# PROPERTIES
PROPERTIES
# COMPILE_FLAGS "-DOPENMM_USE_STATIC_LIBRARIES"
COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES"
# PROJECT_LABEL "Example C - ${EX_STATIC}")
PROJECT_LABEL
"Example C -
${
EX_STATIC
}
"
)
# TARGET_LINK_LIBRARIES(${EX_STATIC}
TARGET_LINK_LIBRARIES
(
${
EX_STATIC
}
${
STATIC_TARGET
}
)
# ${OpenMM_CWRAPPER_LIB} ${STATIC_TARGET})
ENDIF
(
BUILD_TESTING_STATIC
)
# ENDIF (BUILD_TESTING_STATIC)
INSTALL
(
FILES
${
EX_ROOT
}
.c DESTINATION examples
)
ENDFOREACH
(
EX_PROG
${
C_EXAMPLES
}
)
INSTALL
(
FILES
${
EX_SRC
}
DESTINATION examples
)
FOREACH
(
EX_ROOT
${
F_EXAMPLES
}
)
INSTALL
(
FILES
${
EX_ROOT
}
.f90 DESTINATION examples
)
ENDFOREACH
(
EX_PROG
${
F_EXAMPLES
}
)
ENDFOREACH
(
EX_PROG
${
ADHOC_TESTS
}
)
INSTALL
(
FILES
${
OpenMM_CWRAPPER
}
.h
${
OpenMM_CWRAPPER
}
.cpp DESTINATION examples
)
INSTALL
(
FILES
${
OpenMM_FMODULE
}
.f90 DESTINATION examples
)
INSTALL
(
FILES README.txt DESTINATION examples
)
INSTALL
(
FILES README.txt DESTINATION examples
)
\ No newline at end of file
INSTALL
(
FILES Makefile DESTINATION examples
)
examples/HelloArgonInC.c
View file @
17d1268c
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
* other visualization tool to produce an animation of the resulting trajectory.
* other visualization tool to produce an animation of the resulting trajectory.
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "
wrappers/
OpenMM_CWrapper.h"
#include "OpenMM_CWrapper.h"
#include <stdio.h>
#include <stdio.h>
/* Forward declaration of routine for printing one frame of the
/* Forward declaration of routine for printing one frame of the
...
...
examples/HelloSodiumChlorideInC.c
View file @
17d1268c
...
@@ -158,7 +158,7 @@ int main() {
...
@@ -158,7 +158,7 @@ int main() {
* can use the implementation from the C++ version of this example if you
* can use the implementation from the C++ version of this example if you
* want. However, the methods are reimplemented in C below in case you prefer.
* want. However, the methods are reimplemented in C below in case you prefer.
*/
*/
#include "
wrappers/
OpenMM_CWrapper.h"
#include "OpenMM_CWrapper.h"
struct
MyOpenMMData_s
{
struct
MyOpenMMData_s
{
...
...
examples/Makefile
View file @
17d1268c
...
@@ -17,7 +17,7 @@ FFLAGS = -g
...
@@ -17,7 +17,7 @@ FFLAGS = -g
LIB_DIR
=
$(OpenMM_INSTALL_DIR)
/lib
LIB_DIR
=
$(OpenMM_INSTALL_DIR)
/lib
INCLUDE_DIR
=
$(OpenMM_INSTALL_DIR)
/include
INCLUDE_DIR
=
$(OpenMM_INSTALL_DIR)
/include
# assume local directory for C and Fortran wrappers
# assume local directory for C and Fortran wrappers
WRAPPER_DIR
=
.
/wrappers
WRAPPER_DIR
=
.
LIBS
=
-lOpenMM
$(DEBUG)
LIBS
=
-lOpenMM
$(DEBUG)
ALL_CPP_EXAMPLES
=
HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox
ALL_CPP_EXAMPLES
=
HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox
...
...
examples/
wrappers/
OpenMM_CWrapper.cpp
→
examples/OpenMM_CWrapper.cpp
View file @
17d1268c
File moved
examples/
wrappers/
OpenMM_CWrapper.h
→
examples/OpenMM_CWrapper.h
View file @
17d1268c
File moved
examples/
wrappers/
OpenMM_Module.f90
→
examples/OpenMM_Module.f90
View file @
17d1268c
File moved
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