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
04042076
Commit
04042076
authored
Aug 02, 2019
by
Andreas Krämer
Browse files
Merge branch 'master' into charmmfixes
parents
d59f19e4
2ff59259
Changes
474
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
351 additions
and
96 deletions
+351
-96
.travis.yml
.travis.yml
+10
-5
CMakeLists.txt
CMakeLists.txt
+38
-22
appveyor.yml
appveyor.yml
+4
-2
cmake_modules/TargetArch.cmake
cmake_modules/TargetArch.cmake
+159
-0
devtools/Jenkinsfile
devtools/Jenkinsfile
+53
-0
devtools/ci/jenkins/Dockerfile
devtools/ci/jenkins/Dockerfile
+11
-0
devtools/ci/jenkins/install.sh
devtools/ci/jenkins/install.sh
+12
-33
devtools/ci/jenkins/install_and_test_cpu.sh
devtools/ci/jenkins/install_and_test_cpu.sh
+10
-0
devtools/ci/jenkins/test.sh
devtools/ci/jenkins/test.sh
+3
-0
devtools/packaging/install.sh
devtools/packaging/install.sh
+2
-2
devtools/packaging/scripts/windows/Vagrantfile
devtools/packaging/scripts/windows/Vagrantfile
+1
-1
devtools/packaging/scripts/windows/prepare.ps1
devtools/packaging/scripts/windows/prepare.ps1
+6
-4
devtools/run-ctest.py
devtools/run-ctest.py
+22
-10
docs-source/api-python/process-docstring.py
docs-source/api-python/process-docstring.py
+5
-1
docs-source/developerguide/conf.py
docs-source/developerguide/conf.py
+1
-1
docs-source/developerguide/developer.rst
docs-source/developerguide/developer.rst
+2
-2
docs-source/developerguide/license.rst
docs-source/developerguide/license.rst
+1
-1
docs-source/images/OpenMMSetup.png
docs-source/images/OpenMMSetup.png
+0
-0
docs-source/images/ScriptBuilder.png
docs-source/images/ScriptBuilder.png
+0
-0
docs-source/sphinx/autonumber.py
docs-source/sphinx/autonumber.py
+11
-12
No files found.
.travis.yml
View file @
04042076
...
...
@@ -65,6 +65,7 @@ matrix:
-
language
:
objective-c
os
:
osx
osx_image
:
xcode9.3
env
:
==OSX==
OPENCL=false
CUDA=false
...
...
@@ -108,9 +109,10 @@ before_install:
-
wget http://anaconda.org/omnia/ccache/3.2.4/download/${TRAVIS_OS_NAME}-64/ccache-3.2.4-0.tar.bz2
-
mkdir -p $HOME/ccache && tar xf ccache-3.2.4-0.tar.bz2 -C $HOME/ccache
-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew cask uninstall oclint;
brew install fftw;
brew install -y https://raw.githubusercontent.com/Homebrew/homebrew-core/5b680fb58fedfb00cd07a7f69f5a621bb9240f3b/Formula/doxygen.rb;
sudo
easy_
install pytest;
sudo
pip
install
-U
pytest
--ignore-installed six
;
fi
-
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz";
...
...
@@ -130,9 +132,9 @@ before_install:
${AMDAPPSDK}/bin/x86_64/clinfo;
sudo apt-get install -y libgl1-mesa-dev;
fi
# Install
swig
for Python wrappers. However, testing CUDA and
OpenCL, we
# skip the Python wrapper for speed. We're not using anaconda
python,
# but this is a fast way to get an apparently functional precompiled
# Install
SWIG and Cython
for Python wrappers. However, testing CUDA and
#
OpenCL, we
skip the Python wrapper for speed. We're not using anaconda
#
python,
but this is a fast way to get an apparently functional precompiled
# build of swig that's more modern than what's in apt.
-
if [[ "$OPENCL" == "false" && "$CUDA" == "false" && "$TRAVIS_OS_NAME" == "linux" ]]; then
wget http://anaconda.org/omnia/swig/3.0.7/download/linux-64/swig-3.0.7-0.tar.bz2;
...
...
@@ -140,6 +142,7 @@ before_install:
tar -xjvf swig-3.0.7-0.tar.bz2 -C $HOME/swig;
export PATH=$HOME/swig/bin:$PATH;
export SWIG_LIB=$HOME/swig/share/swig/3.0.7;
pip install cython;
fi
-
if [[ "$OPENCL" == "false" && "$CUDA" == "false" && "$TRAVIS_OS_NAME" == "osx" ]]; then
wget http://anaconda.org/omnia/swig/3.0.7/download/osx-64/swig-3.0.7-0.tar.bz2;
...
...
@@ -147,6 +150,7 @@ before_install:
tar -xjvf swig-3.0.7-0.tar.bz2 -C $HOME/swig;
export PATH=$HOME/swig/bin:$PATH;
export SWIG_LIB=$HOME/swig/share/swig/3.0.7;
sudo pip install cython;
fi
-
if [[ "$CUDA" == "true" ]]; then
...
...
@@ -181,8 +185,9 @@ script:
-
python devtools/run-ctest.py --start-time $START_TIME
-
if [[ ! -z "${DOCS_DEPLOY}" && "${DOCS_DEPLOY}" = "true" ]]; then
pip install sphinx
==1.5.6
sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen;
pip install sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen;
make sphinxhtml;
make sphinxpdf;
make C++ApiDocs PythonApiDocs;
mkdir -p api-docs;
mv sphinx-docs/userguide/html api-docs/userguide;
...
...
CMakeLists.txt
View file @
04042076
...
...
@@ -33,6 +33,21 @@ MARK_AS_ADVANCED(DART_ROOT)
# We have custom cmake modules for FindOpenMM and running python tests
SET
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake_modules"
)
# Determine what architecture we are compiling for.
INCLUDE
(
TargetArch
)
target_architecture
(
TARGET_ARCH
)
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"x86_64|i386"
)
set
(
X86 ON
)
endif
()
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"arm"
)
set
(
ARM ON
)
add_compile_definitions
(
__ARM__=1
)
endif
()
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"ppc"
)
set
(
PPC ON
)
add_compile_definitions
(
__PPC__=1
)
endif
()
# Where to install
IF
(
WIN32
)
IF
(
NOT OPENMM_INSTALL_PREFIX
)
...
...
@@ -69,7 +84,10 @@ ENDIF(${CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT})
# The source is organized into subdirectories, but we handle them all from
# this CMakeLists file rather than letting CMake visit them as SUBDIRS.
SET
(
OPENMM_SOURCE_SUBDIRS . openmmapi olla libraries/jama libraries/quern libraries/lepton libraries/sfmt libraries/lbfgs libraries/hilbert libraries/csha1 platforms/reference serialization libraries/irrxml libraries/vecmath
)
SET
(
OPENMM_SOURCE_SUBDIRS . openmmapi olla libraries/jama libraries/quern libraries/lepton libraries/sfmt libraries/lbfgs libraries/hilbert libraries/csha1 platforms/reference serialization libraries/irrxml
)
IF
(
X86 OR ARM
)
SET
(
OPENMM_SOURCE_SUBDIRS
${
OPENMM_SOURCE_SUBDIRS
}
libraries/vecmath
)
ENDIF
()
IF
(
WIN32
)
SET
(
OPENMM_SOURCE_SUBDIRS
${
OPENMM_SOURCE_SUBDIRS
}
libraries/pthreads
)
ELSE
(
WIN32
)
...
...
@@ -82,7 +100,7 @@ ENDIF(WIN32)
SET
(
CMAKE_CXX_STANDARD 11
)
IF
(
APPLE
AND
(
NOT PNACL
)
)
IF
(
APPLE
)
# Build 64 bit binaries compatible with OS X 10.7
IF
(
NOT CMAKE_OSX_DEPLOYMENT_TARGET
)
SET
(
CMAKE_OSX_DEPLOYMENT_TARGET
"10.7"
CACHE STRING
"The minimum version of OS X to support"
FORCE
)
...
...
@@ -102,19 +120,17 @@ IF (APPLE AND (NOT PNACL))
# Improve the linking behavior of Mac libraries
SET
(
CMAKE_INSTALL_NAME_DIR
"@rpath"
)
SET
(
EXTRA_COMPILE_FLAGS
"-msse2 -stdlib=libc++"
)
ELSE
(
APPLE
AND
(
NOT PNACL
))
IF
(
MSVC OR ANDROID OR PNACL
)
SET
(
EXTRA_COMPILE_FLAGS
)
IF
(
MSVC
)
# Use warning level 2, not whatever warning level CMake picked.
STRING
(
REGEX REPLACE
"/W[0-4]"
"/W2"
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
# Explicitly suppress warnings 4305 and 4244.
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/wd4305 /wd4244"
)
ENDIF
(
MSVC
)
ELSE
(
MSVC OR ANDROID OR PNACL
)
SET
(
EXTRA_COMPILE_FLAGS
"-msse2"
)
ENDIF
(
MSVC OR ANDROID OR PNACL
)
ENDIF
(
APPLE
AND
(
NOT PNACL
))
ELSEIF
(
MSVC
)
SET
(
EXTRA_COMPILE_FLAGS
)
# Use warning level 2, not whatever warning level CMake picked.
STRING
(
REGEX REPLACE
"/W[0-4]"
"/W2"
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
# Explicitly suppress warnings 4305 and 4244.
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/wd4305 /wd4244"
)
ELSEIF
(
X86
)
SET
(
EXTRA_COMPILE_FLAGS
"-msse2"
)
ELSE
()
SET
(
EXTRA_COMPILE_FLAGS
)
ENDIF
()
IF
(
UNIX AND NOT CMAKE_BUILD_TYPE
)
SET
(
CMAKE_BUILD_TYPE Release CACHE STRING
"Debug or Release build"
FORCE
)
...
...
@@ -141,7 +157,7 @@ ENDIF (NOT CMAKE_CXX_FLAGS_RELEASE)
SET
(
OPENMM_LIBRARY_NAME OpenMM
)
SET
(
OPENMM_MAJOR_VERSION 7
)
SET
(
OPENMM_MINOR_VERSION
2
)
SET
(
OPENMM_MINOR_VERSION
4
)
SET
(
OPENMM_BUILD_VERSION 0
)
ADD_DEFINITIONS
(
-DOPENMM_LIBRARY_NAME=
${
OPENMM_LIBRARY_NAME
}
...
...
@@ -219,19 +235,19 @@ FOREACH(subdir ${OPENMM_SOURCE_SUBDIRS})
## OpenMM was previously installed there.
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
ENDFOREACH
(
subdir
)
IF
(
ANDROID OR PNACL
)
SET_SOURCE_FILES_PROPERTIES
(
${
CMAKE_SOURCE_DIR
}
/libraries/sfmt/src/SFMT.cpp PROPERTIES COMPILE_FLAGS
"-UHAVE_SSE2"
)
ELSE
(
ANDROID OR PNACL
)
IF
(
X86
)
SET_SOURCE_FILES_PROPERTIES
(
${
CMAKE_SOURCE_DIR
}
/libraries/sfmt/src/SFMT.cpp PROPERTIES COMPILE_FLAGS
"-DHAVE_SSE2=1"
)
ENDIF
(
ANDROID OR PNACL
)
IF
(
NOT
(
ANDROID OR PNACL
OR
(
WIN32 AND OPENMM_BUILD_STATIC_LIB
)))
ELSE
()
SET_SOURCE_FILES_PROPERTIES
(
${
CMAKE_SOURCE_DIR
}
/libraries/sfmt/src/SFMT.cpp PROPERTIES COMPILE_FLAGS
"-UHAVE_SSE2"
)
ENDIF
()
IF
(
X86 AND
NOT
(
WIN32 AND OPENMM_BUILD_STATIC_LIB
))
FILE
(
GLOB src_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/libraries/asmjit/*/*.cpp
)
FILE
(
GLOB incl_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/libraries/asmjit/*.h
)
SET
(
SOURCE_FILES
${
SOURCE_FILES
}
${
src_files
}
)
SET
(
SOURCE_INCLUDE_FILES
${
SOURCE_INCLUDE_FILES
}
${
incl_files
}
)
INCLUDE_DIRECTORIES
(
BEFORE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libraries/asmjit"
)
SET
(
EXTRA_COMPILE_FLAGS
"
${
EXTRA_COMPILE_FLAGS
}
-DLEPTON_USE_JIT"
)
ENDIF
(
NOT
(
ANDROID OR PNACL
OR
(
WIN32 AND OPENMM_BUILD_STATIC_LIB
))
)
ENDIF
(
)
# If API wrappers are being generated, and add them to the build.
SET
(
OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS ON CACHE BOOL
"Build wrappers for C and Fortran"
)
...
...
appveyor.yml
View file @
04042076
...
...
@@ -11,6 +11,7 @@ install:
-
"
set
PATH=C:
\\
Program
Files
(x86)
\\
Git
\\
bin;%PATH%"
-
pip install pytest
-
pip install numpy
-
pip install cython
# Use cclash for compiler caching (experimental)
-
ps
:
wget https://github.com/inorton/cclash/releases/download/0.3.14/cclash-0.3.14.zip -OutFile cclash-0.3.14.zip
...
...
@@ -27,9 +28,10 @@ install:
-
"
set
PATH=C:
\\
fftw;%PATH%"
# Download and install some OpenMM build dependencies (doxygen, swig)
-
choco install -y doxygen.
portable
swig >
null
-
choco install -y doxygen.
install
swig >
null
# Download OpenCL Headers and build the ICD loader
-
ps
:
"
[System.Net.ServicePointManager]::SecurityProtocol
=
[System.Net.SecurityProtocolType]::Tls12;"
-
ps
:
$opencl_registry = "https://www.khronos.org/registry/cl"
-
ps
:
$opencl_github = "KhronosGroup/OpenCL-Headers"
-
ps
:
mkdir C:/opencl > $null
...
...
@@ -39,7 +41,7 @@ install:
-
ps
:
7z x opencl-icd-1.2.11.0.tar > $null
-
ps
:
mv .\icd\* .
-
ps
:
mkdir inc/CL > $null
-
ps
:
wget https://github.com/$opencl_github/tree/master/
opencl20/CL
| select -ExpandProperty links | where {$_.href -like "*.h*"} | select -ExpandProperty
outerText
| foreach{ wget https://raw.githubusercontent.com/$opencl_github/master/
opencl20/
CL/$_ -OutFile inc/CL/$_ }
-
ps
:
wget https://github.com/$opencl_github/tree/master/
CL -UseBasicParsing
| select -ExpandProperty links | where {$_.href -like "*.h*"} | select -ExpandProperty
title
| foreach{ wget https://raw.githubusercontent.com/$opencl_github/master/CL/$_ -OutFile inc/CL/$_
-UseBasicParsing
}
-
ps
:
mkdir lib > $null
-
ps
:
cd lib
-
cmake -G "NMake Makefiles" ..
...
...
cmake_modules/TargetArch.cmake
0 → 100644
View file @
04042076
# This is from Solar CMake (https://github.com/axr/solar-cmake).
#
# Copyright (c) 2012 Petroules Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
# Based on the Qt 5 processor detection code, so should be very accurate
# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h
# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64)
# Regarding POWER/PowerPC, just as is noted in the Qt source,
# "There are many more known variants/revisions that we do not handle/detect."
set
(
archdetect_c_code
"
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#if defined(__ARM_ARCH_7__)
\\
|| defined(__ARM_ARCH_7A__)
\\
|| defined(__ARM_ARCH_7R__)
\\
|| defined(__ARM_ARCH_7M__)
\\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
#error cmake_ARCH armv7
#elif defined(__ARM_ARCH_6__)
\\
|| defined(__ARM_ARCH_6J__)
\\
|| defined(__ARM_ARCH_6T2__)
\\
|| defined(__ARM_ARCH_6Z__)
\\
|| defined(__ARM_ARCH_6K__)
\\
|| defined(__ARM_ARCH_6ZK__)
\\
|| defined(__ARM_ARCH_6M__)
\\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
#error cmake_ARCH armv6
#elif defined(__ARM_ARCH_5TEJ__)
\\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
#error cmake_ARCH armv5
#else
#error cmake_ARCH arm
#endif
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__)
\\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC)
\\
|| defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error cmake_ARCH ppc64
#else
#error cmake_ARCH ppc
#endif
#endif
#error cmake_ARCH unknown
"
)
# Set ppc_support to TRUE before including this file or ppc and ppc64
# will be treated as invalid architectures since they are no longer supported by Apple
function
(
target_architecture output_var
)
if
(
APPLE AND CMAKE_OSX_ARCHITECTURES
)
# On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
# First let's normalize the order of the values
# Note that it's not possible to compile PowerPC applications if you are using
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
# disable it by default
# See this page for more information:
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
foreach
(
osx_arch
${
CMAKE_OSX_ARCHITECTURES
}
)
if
(
"
${
osx_arch
}
"
STREQUAL
"ppc"
AND ppc_support
)
set
(
osx_arch_ppc TRUE
)
elseif
(
"
${
osx_arch
}
"
STREQUAL
"i386"
)
set
(
osx_arch_i386 TRUE
)
elseif
(
"
${
osx_arch
}
"
STREQUAL
"x86_64"
)
set
(
osx_arch_x86_64 TRUE
)
elseif
(
"
${
osx_arch
}
"
STREQUAL
"ppc64"
AND ppc_support
)
set
(
osx_arch_ppc64 TRUE
)
else
()
message
(
FATAL_ERROR
"Invalid OS X arch name:
${
osx_arch
}
"
)
endif
()
endforeach
()
# Now add all the architectures in our normalized order
if
(
osx_arch_ppc
)
list
(
APPEND ARCH ppc
)
endif
()
if
(
osx_arch_i386
)
list
(
APPEND ARCH i386
)
endif
()
if
(
osx_arch_x86_64
)
list
(
APPEND ARCH x86_64
)
endif
()
if
(
osx_arch_ppc64
)
list
(
APPEND ARCH ppc64
)
endif
()
else
()
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/arch.c"
"
${
archdetect_c_code
}
"
)
enable_language
(
C
)
# Detect the architecture in a rather creative way...
# This compiles a small C program which is a series of ifdefs that selects a
# particular #error preprocessor directive whose message string contains the
# target architecture. The program will always fail to compile (both because
# file is not a valid C program, and obviously because of the presence of the
# #error preprocessor directives... but by exploiting the preprocessor in this
# way, we can detect the correct target architecture even when cross-compiling,
# since the program itself never needs to be run (only the compiler/preprocessor)
try_run
(
run_result_unused
compile_result_unused
"
${
CMAKE_BINARY_DIR
}
"
"
${
CMAKE_BINARY_DIR
}
/arch.c"
COMPILE_OUTPUT_VARIABLE ARCH
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=
${
CMAKE_OSX_ARCHITECTURES
}
)
# Parse the architecture name from the compiler output
string
(
REGEX MATCH
"cmake_ARCH ([a-zA-Z0-9_]+)"
ARCH
"
${
ARCH
}
"
)
# Get rid of the value marker leaving just the architecture name
string
(
REPLACE
"cmake_ARCH "
""
ARCH
"
${
ARCH
}
"
)
# If we are compiling with an unknown architecture this variable should
# already be set to "unknown" but in the case that it's empty (i.e. due
# to a typo in the code), then set it to unknown
if
(
NOT ARCH
)
set
(
ARCH unknown
)
endif
()
endif
()
set
(
${
output_var
}
"
${
ARCH
}
"
PARENT_SCOPE
)
endfunction
()
devtools/Jenkinsfile
0 → 100644
View file @
04042076
pipeline
{
agent
any
stages
{
stage
(
"Build and test"
)
{
parallel
{
stage
(
"Build and test CUDA platform"
)
{
agent
{
label
"cuda"
}
steps
{
sh
'''#!/bin/bash -lex
git clean -fxd && git checkout .
env
module load cuda conda
export OPENMM_CUDA_COMPILER=`which nvcc`
bash -e devtools/ci/jenkins/install.sh
bash -e devtools/ci/jenkins/test.sh -R 'TestCuda' --parallel 2
'''
}
}
stage
(
"Build and test OpenCL platform"
)
{
agent
{
label
"cuda"
}
steps
{
sh
'''#!/bin/bash -lex
git clean -fxd && git checkout .
env
module load cuda conda
export OPENMM_CUDA_COMPILER=`which nvcc`
bash -e devtools/ci/jenkins/install.sh
bash -e devtools/ci/jenkins/test.sh -R 'TestOpenCL' --parallel 2
'''
}
}
stage
(
"Build/test CPU platforms"
)
{
agent
{
dockerfile
{
dir
"devtools/ci/jenkins"
label
"docker"
}
}
steps
{
sh
'''#!/bin/bash -lex
git clean -fxd && git checkout .
bash -e devtools/ci/jenkins/install_and_test_cpu.sh
'''
}
}
}
// parallel
}
}
}
devtools/ci/jenkins/Dockerfile
0 → 100644
View file @
04042076
FROM
ubuntu:xenial
ENV
PATH="/opt/miniconda/bin:${PATH}"
RUN
apt-get update
&&
\
apt-get
install
-y
wget git gromacs doxygen gfortran libfftw3-dev gcc g++ bzip2 automake make lsb-core
&&
\
wget https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh
-O
miniconda.sh
&&
\
bash miniconda.sh
-b
-p
"/opt/miniconda"
&&
\
rm
-f
miniconda.sh
&&
\
mkdir
/.conda
&&
chmod
-R
777 /.conda
&&
chmod
-R
777 /opt/miniconda
&&
\
conda
install
-y
cmake numpy scipy pytest swig cython
devtools/ci/jenkins/install.sh
View file @
04042076
...
...
@@ -8,36 +8,15 @@ swig -version
echo
"Using cmake (
`
which cmake
`
) version"
:
cmake
--version
echo
"Using clang (
`
which clang
`
) version:"
clang
--version
module load cuda conda/jenkins
# Constants
CONDAENV
=
openmm-test-3.5
INSTALL_DIRECTORY
=
"
${
WORKSPACE
}
/openmm-install"
SRC_DIRECTORY
=
"
${
WORKSPACE
}
/openmm-src"
# set in the Jenkins configuration
export
OPENMM_CUDA_COMPILER
=
`
which nvcc
`
# Create a conda environment, but clean up after one first. If it doesn't exist, don't complain.
# But since we are invoking this shell with -e (exit on all errors), we need || true to prevent this
# command from crashing the whole shell
conda remove
-yn
${
CONDAENV
}
--all
--quiet
||
true
conda create
-yn
${
CONDAENV
}
python
=
3.5
--no-default-packages
--quiet
conda
install
-yn
${
CONDAENV
}
numpy scipy pytest
--quiet
source
activate
${
CONDAENV
}
# enter our new environment
# Build OpenMM
cd
"
${
SRC_DIRECTORY
}
"
cmake
-DCMAKE_INSTALL_PREFIX
=
"
${
INSTALL_DIRECTORY
}
"
-DCMAKE_CXX_COMPILER
=
clang++
-DCMAKE_C_COMPILER
=
clang
.
make
-j4
install
make PythonInstall
# Now run the tests
python
-m
simtk.testInstallation
cd
python/tests
&&
py.test
-v
&&
cd
../..
python devtools/run-ctest.py
--job-duration
=
120
--timeout
300
# Now remove the conda environment
source
deactivate
conda remove
-yn
${
CONDAENV
}
--all
--quiet
\ No newline at end of file
echo
"Using g++ (
`
which g++
`
) version:"
g++
--version
if
[
!
-z
"
$OPENMM_CUDA_COMPILER
"
]
;
then
echo
"Using nvcc (
$OPENMM_CUDA_COMPILER
) version:"
$OPENMM_CUDA_COMPILER
--version
CUDA_ARGS
=
"-DCUDA_TOOLKIT_ROOT_DIR=
${
CUDA_HOME
}
"
fi
cmake
-DCMAKE_INSTALL_PREFIX
=
"
`
pwd
`
/install"
-DCMAKE_CXX_COMPILER
=
g++
-DCMAKE_C_COMPILER
=
gcc
\
-DSWIG_EXECUTABLE
=
`
which swig
`
$CUDA_ARGS
$EXTRA_CMAKE_ARGS
.
make
-j6
install
devtools/ci/jenkins/install_and_test_cpu.sh
0 → 100644
View file @
04042076
#!/bin/bash
EXTRA_CMAKE_ARGS
=
"-DOPENMM_BUILD_CUDA_LIB=false -DOPENMM_BUILD_OPENCL_LIB=false"
.
devtools/ci/jenkins/install.sh
python devtools/run-ctest.py
--job-duration
=
120
--timeout
300
--in-order
-R
'Test(Cpu|Reference)'
--parallel
4
# Build & test Python
make PythonInstall
python
-m
simtk.testInstallation
cd
python/tests
&&
py.test
-v
devtools/ci/jenkins/test.sh
0 → 100644
View file @
04042076
#!/bin/sh
python devtools/run-ctest.py
--job-duration
=
120
--timeout
300
--in-order
$*
\ No newline at end of file
devtools/packaging/install.sh
View file @
04042076
...
...
@@ -26,10 +26,10 @@ fi
# Make sure it's a supported Python version.
pythonOk
=
$(
${
pythonBin
}
-c
"import sys; v=sys.version_info; print((v[0]==2 and v[1]>
5
) or v[0]>2)"
)
pythonOk
=
$(
${
pythonBin
}
-c
"import sys; v=sys.version_info; print((v[0]==2 and v[1]>
6
) or v[0]>2)"
)
if
[
${
pythonOk
}
!=
"True"
]
then
echo
"Unsupported Python version. Only versions 2.
6
and higher are supported."
echo
"Unsupported Python version. Only versions 2.
7
and higher are supported."
exit
fi
...
...
devtools/packaging/scripts/windows/Vagrantfile
View file @
04042076
Vagrant
.
configure
(
"2"
)
do
|
config
|
config
.
vm
.
box
=
"gusztavvargadr/windows10
ee
"
config
.
vm
.
box
=
"gusztavvargadr/windows
-
10"
config
.
vm
.
provision
:shell
,
path:
"prepare.ps1"
config
.
vm
.
provider
:virtualbox
do
|
vb
|
...
...
devtools/packaging/scripts/windows/prepare.ps1
View file @
04042076
...
...
@@ -2,8 +2,8 @@ cd C:\Users\vagrant
# Install CUDA.
wget
https://developer.nvidia.com/compute/cuda/
8.0/p
rod/network_installers/cuda_
8.0.44
_win10_network
-
exe
-UseBasicParsing
-OutFile
cuda_
8.0.44
_win10_network.exe
.
\cuda_
8.0.44
_win10_network.exe
-s
compiler_8.0
cudart_
8.0
cufft_
8.0
cufft_dev_
8.0
nvrtc_
8.0
nvrtc_dev_
8.0
|
Out-Null
wget
https://developer.nvidia.com/compute/cuda/
10.1/P
rod/network_installers/cuda_
10.1.168
_win10_network
.
exe
-UseBasicParsing
-OutFile
cuda_
10.1.168
_win10_network.exe
.
\cuda_
10.1.168
_win10_network.exe
-s
nvcc_10.1
cudart_
10.1
cufft_
10.1
cufft_dev_
10.1
nvrtc_
10.1
nvrtc_dev_
10.1
|
Out-Null
# Install AMD APP SDK.
...
...
@@ -14,12 +14,14 @@ wget https://s3.amazonaws.com/omnia-ci/AMD-APP-SDK-v2.9-1.599.381-GA-Full-window
wget
https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe
-UseBasicParsing
-OutFile
Miniconda3-latest-Windows-x86_64.exe
.
\Miniconda3-latest-Windows-x86_64.exe
/S
/D
=
C:\Miniconda3
|
Out-Null
[
Environment
]::
SetEnvironmentVariable
(
"Path"
,
$
env
:
Path
+
";C:\Miniconda3;C:\Miniconda3\Scripts;C:\Miniconda3\Library\bin"
,
[
EnvironmentVariableTarget
]::
User
)
# Install software with conda.
&
"C:\Miniconda3\Scripts\conda.exe"
install
-y
-c
omnia
fftw3f
jinja2
lxml
sphinx
sphinxcontrib-autodoc_doxygen
sphinxcontrib-lunrsearch
conda-build
anaconda-client
&
"C:\Miniconda3\Scripts\conda.exe"
config
--add
channels
omnia
--add
channels
conda-forge
&
"C:\Miniconda3\Scripts\conda.exe"
install
-y
fftw3f
==
3.3
.
4
=
vc14_2
jinja2
lxml
sphinx
sphinxcontrib-autodoc_doxygen
sphinxcontrib-lunrsearch
conda-build
anaconda-client
&
"C:\Miniconda3\Scripts\pip.exe"
install
sphinxcontrib.bibtex
# Install software with choco.
choco
install
-y
doxygen.portable
swig
cmake
doxygen.install
vcbuildtools
git
jom
choco
install
-y
doxygen.portable
swig
cmake
doxygen.install
vcbuildtools
git
jom
patch
devtools/run-ctest.py
View file @
04042076
...
...
@@ -43,16 +43,26 @@ def main():
help
=
"Timeout for individual tests (seconds). Default=180"
,
type
=
str
,
default
=
'180'
)
parser
.
add_argument
(
'--in-order'
,
help
=
'Run the tests in order'
,
default
=
False
,
action
=
'store_true'
)
parser
.
add_argument
(
'--parallel'
,
help
=
'Number of processors to use'
,
type
=
int
,
default
=
1
)
args
=
parser
.
parse_args
()
args
,
raw_args
=
parser
.
parse_
known_
args
()
status
=
execute_tests
(
args
)
status
=
execute_tests
(
args
,
raw_args
)
if
status
!=
0
:
status
=
execute_failed_tests
(
args
)
status
=
execute_failed_tests
(
args
,
raw_args
)
return
status
def
execute_tests
(
options
):
def
execute_tests
(
options
,
raw_options
):
start_time
=
datetime
.
fromtimestamp
(
options
.
start_time
)
stop_time
=
start_time
+
timedelta
(
minutes
=
options
.
job_duration
)
...
...
@@ -68,13 +78,14 @@ def execute_tests(options):
shutil
.
rmtree
(
'Testing'
)
return
call
([
'ctest'
,
'--output-on-failure'
,
'--
schedule-random'
,
'--
parallel'
,
str
(
options
.
parallel
)
,
'-T'
,
'Test'
,
'--timeout'
,
options
.
timeout
,
'--stop-time'
,
stop_time
.
strftime
(
'%H:%M:%S'
)])
'--stop-time'
,
stop_time
.
strftime
(
'%H:%M:%S'
)]
+
raw_options
+
([
'--schedule-random'
]
if
options
.
in_order
else
[]))
def
execute_failed_tests
(
options
):
def
execute_failed_tests
(
options
,
raw_options
):
matches
=
glob
(
'Testing/*/Test.xml'
)
assert
len
(
matches
)
==
1
root
=
ElementTree
.
parse
(
matches
[
0
])
...
...
@@ -93,12 +104,13 @@ def execute_failed_tests(options):
start_time
=
datetime
.
fromtimestamp
(
options
.
start_time
)
stop_time
=
start_time
+
timedelta
(
minutes
=
options
.
job_duration
)
return
call
([
'ctest'
,
return
call
([
'ctest'
]
+
raw_options
+
[
'--output-on-failure'
,
'--
schedule-random'
,
'--
parallel'
,
str
(
options
.
parallel
)
,
'-R'
,
'|'
.
join
(
failed_tests
),
'--timeout'
,
options
.
timeout
,
'--stop-time'
,
stop_time
.
strftime
(
'%H:%M:%S'
)])
'--stop-time'
,
stop_time
.
strftime
(
'%H:%M:%S'
)]
+
([
'--schedule-random'
]
if
options
.
in_order
else
[]))
if
__name__
==
'__main__'
:
...
...
docs-source/api-python/process-docstring.py
View file @
04042076
...
...
@@ -14,8 +14,11 @@ def process_docstring(app, what, name, obj, options, lines):
s
=
m
.
group
(
1
)
if
not
s
.
startswith
(
linesep
):
s
=
linesep
+
s
newline
=
'|LINEBREAK|.. admonition:: Deprecated'
+
linesep
newline
=
'|LINEBREAK|.. admonition::
|LINEBREAK|
Deprecated'
+
linesep
return
newline
+
' '
+
s
.
replace
(
linesep
,
linesep
+
' '
)
def
repl3
(
m
):
s
=
m
.
group
(
1
)
return
'*'
+
s
+
'*'
linesep
=
'|LINEBREAK|'
joined
=
linesep
.
join
(
lines
)
...
...
@@ -23,6 +26,7 @@ def process_docstring(app, what, name, obj, options, lines):
joined
=
re
.
sub
(
r
'<tt><pre>((|LINEBREAK|)?.*?)</pre></tt>'
,
repl
,
joined
)
joined
=
re
.
sub
(
r
'<tt>(.*?)</tt>'
,
repl
,
joined
)
joined
=
re
.
sub
(
r
'@deprecated(.*?\|LINEBREAK\|)'
,
repl2
,
joined
,
flags
=
re
.
IGNORECASE
)
joined
=
re
.
sub
(
r
'<i>(.*?)</i>'
,
repl3
,
joined
)
lines
[:]
=
[(
l
if
not
l
.
isspace
()
else
''
)
for
l
in
joined
.
split
(
linesep
)]
...
...
docs-source/developerguide/conf.py
View file @
04042076
...
...
@@ -42,7 +42,7 @@ master_doc = 'index'
# General information about the project.
project
=
u
'OpenMM Developer Guide'
copyright
=
u
'2011-201
4
, Stanford University'
copyright
=
u
'2011-201
7
, Stanford University'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
...
...
docs-source/developerguide/developer.rst
View file @
04042076
...
...
@@ -325,10 +325,10 @@ look in ReferenceKernels.cpp, you will find code for extracting the correct
values of these fields. For example:
::
static vector<
Real
Vec>& extractPositions(ContextImpl& context) {
static vector<Vec
3
>& extractPositions(ContextImpl& context) {
ReferencePlatform::PlatformData* data =
reinterpret_cast<ReferencePlatform::PlatformData*>(context.getPlatformData());
return *((vector<
Real
Vec>*) data->positions);
return *((vector<Vec
3
>*) data->positions);
}
The PlatformData’s vector of forces contains one element for each particle. At
...
...
docs-source/developerguide/license.rst
View file @
04042076
Portions copyright (c) 2011-201
6
Stanford University and the Authors
Portions copyright (c) 2011-201
7
Stanford University and the Authors
Contributors: Peter Eastman
...
...
docs-source/images/OpenMMSetup.png
0 → 100644
View file @
04042076
150 KB
docs-source/images/ScriptBuilder.png
deleted
100644 → 0
View file @
d59f19e4
259 KB
docs-source/sphinx/autonumber.py
View file @
04042076
from
docutils.parsers.rst
import
roles
from
docutils.nodes
import
Text
,
reference
,
section
from
docutils.nodes
import
Text
,
reference
,
section
,
label
from
sphinx.roles
import
XRefRole
class
autonumber
(
Text
):
class
autonumber
(
label
):
pass
class
autonumber_ref
(
reference
):
pass
def
autonumber_role
(
name
,
rawtext
,
text
,
lineno
,
inliner
,
options
=
{},
content
=
[]):
return
([
autonumber
(
text
)],
[])
return
([
autonumber
(
text
=
text
)],
[])
def
doctree_resolved
(
app
,
doctree
,
docname
):
index
=
{};
refTable
=
{}
if
app
.
config
.
autonumber_by_chapter
:
# Record the number of each chapter
env
=
app
.
builder
.
env
sectionNumbers
=
{}
for
doc
in
env
.
toc_secnumbers
:
...
...
@@ -24,9 +24,9 @@ def doctree_resolved(app, doctree, docname):
for
sectionId
in
sections
:
sectionNumbers
[
sectionId
[
1
:]]
=
sections
[
sectionId
]
lastChapter
=
-
1
# Assign numbers to all the autonumbered objects.
for
node
in
doctree
.
traverse
(
autonumber
):
category
=
node
.
astext
().
split
(
','
)[
0
]
if
category
in
index
:
...
...
@@ -47,13 +47,13 @@ def doctree_resolved(app, doctree, docname):
newNode
=
Text
(
'%s %d-%d'
%
(
category
,
chapter
,
nextNumber
))
lastChapter
=
chapter
else
:
newNode
=
Text
(
'%s %d'
%
(
category
,
nextNumber
))
newNode
=
Text
(
'%s %d'
%
(
category
,
nextNumber
))
index
[
category
]
=
nextNumber
refTable
[
node
.
astext
()]
=
newNode
node
.
parent
.
replace
(
node
,
newNode
)
# Replace references with the name of the referenced object
for
ref_info
in
doctree
.
traverse
(
autonumber_ref
):
target
=
ref_info
[
'reftarget'
]
if
target
not
in
refTable
:
...
...
@@ -68,4 +68,3 @@ def setup(app):
app
.
add_role
(
'autonumref'
,
XRefRole
(
nodeclass
=
autonumber_ref
))
app
.
connect
(
'doctree-resolved'
,
doctree_resolved
)
Prev
1
2
3
4
5
…
24
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