Skip to content

Commit

Permalink
Merged changes from main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
peastman committed Feb 22, 2017
2 parents a783b99 + b84e22b commit cd874b2
Show file tree
Hide file tree
Showing 112 changed files with 6,697 additions and 2,183 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -108,6 +108,11 @@ before_install:
brew install doxygen fftw;
sudo easy_install pytest;
fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz";
mkdir $HOME/cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C $HOME/cmake;
export PATH=${HOME}/cmake/bin:${PATH};
fi
- if [[ "$OPENCL" == "true" ]]; then
wget http://s3.amazonaws.com/omnia-ci/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2;
tar -xjf AMD-APP-SDK*.tar.bz2;
Expand Down
153 changes: 14 additions & 139 deletions CMakeLists.txt
Expand Up @@ -21,39 +21,18 @@ IF( NOT PROJECT_NAME )
PROJECT (OpenMM)
ENDIF( NOT PROJECT_NAME )

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
if("${CMAKE_VERSION}" VERSION_GREATER "3.0" OR "${CMAKE_VERSION}" VERSION_EQUAL "3.0")
CMAKE_POLICY(SET CMP0042 OLD)
endif()
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
CMAKE_POLICY(SET CMP0042 OLD)
CMAKE_POLICY(SET CMP0003 NEW)
CMAKE_POLICY(SET CMP0005 NEW)
CMAKE_POLICY(SET CMP0011 NEW)

#SET(CMAKE_VERBOSE_MAKEFILE 1)

# CMake 2.4 on dart server only needs to know about Dart
INCLUDE(Dart)
MARK_AS_ADVANCED(DART_ROOT)

# Avoid dart server problem with cmake 2.4 --cmb
set(cmv "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
IF(NOT cmv EQUAL "2.4") # This whole file...

# We have custom cmake modules for FindOpenMM and running python tests
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")

# Older cmake versions do not have cmake_policy command
# Cmake 2.4.5, the default cmake on red hat linux, has the
# cmake_policy command, but it does not work
# "if(POLICY ..." does not work with cmake 2.4.[56] on red hat
# (cmake 2.4.7 is OK)
if(COMMAND cmake_policy)
if(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 5)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0005 NEW)
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 5)
if(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 6 OR CMAKE_PATCH_VERSION GREATER 2)
cmake_policy(SET CMP0011 NEW)
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 6 OR CMAKE_PATCH_VERSION GREATER 2)
endif(COMMAND cmake_policy)

# Where to install
IF(WIN32)
IF(NOT OPENMM_INSTALL_PREFIX)
Expand All @@ -69,6 +48,9 @@ IF(WIN32)
ADD_DEFINITIONS(-DWIN32)
ENDIF(WIN32)

# What type of libraries to build
SET(OPENMM_BUILD_SHARED_LIB ON CACHE BOOL "Whether to build shared OpenMM libraries")
SET(OPENMM_BUILD_STATIC_LIB OFF CACHE BOOL "Whether to build static OpenMM libraries")

# Include CPU-Features for Android
IF (ANDROID)
Expand Down Expand Up @@ -98,22 +80,7 @@ ELSE(WIN32)
ENDIF (NOT ANDROID)
ENDIF(WIN32)

# The build system will set ARCH64 for 64 bit builds, which require
# use of the lib64/ library directories rather than lib/.
#SET( ARCH64 OFF CACHE BOOL "ON for 64bit builds, OFF for 32bit builds")
#MARK_AS_ADVANCED( ARCH64 )
#IF (ARCH64)
# SET(LIB64 64)
#ELSE (ARCH64)
# SET(LIB64) # nothing
#ENDIF (ARCH64)

IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET( LIB64 64 )
ELSE( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET( LIB64 )
ENDIF( CMAKE_SIZEOF_VOID_P EQUAL 8 )

SET (CMAKE_CXX_STANDARD 11)

IF (APPLE AND (NOT PNACL))
# Build 64 bit binaries compatible with OS X 10.7
Expand Down Expand Up @@ -177,37 +144,11 @@ SET(OPENMM_MAJOR_VERSION 7)
SET(OPENMM_MINOR_VERSION 1)
SET(OPENMM_BUILD_VERSION 0)

SET(OPENMM_COPYRIGHT_YEARS "2008-2015")

# underbar separated list of dotted authors, no spaces or commas
SET(OPENMM_AUTHORS "Peter.Eastman")

ADD_DEFINITIONS(-DOPENMM_LIBRARY_NAME=${OPENMM_LIBRARY_NAME}
-DOPENMM_MAJOR_VERSION=${OPENMM_MAJOR_VERSION}
-DOPENMM_MINOR_VERSION=${OPENMM_MINOR_VERSION}
-DOPENMM_BUILD_VERSION=${OPENMM_BUILD_VERSION})

# CMake quotes automatically when building Visual Studio projects but we need
# to add them ourselves for Linux or Cygwin. Two cases to avoid duplicate quotes
# in Visual Studio which end up in the binary.

IF (MSVC)
SET(NEED_QUOTES FALSE)
ELSE (MSVC)
SET(NEED_QUOTES TRUE)
ENDIF (MSVC)

##TODO: doesn't work without quotes in nightly build
SET(NEED_QUOTES TRUE)

IF(NEED_QUOTES)
ADD_DEFINITIONS(-DOPENMM_COPYRIGHT_YEARS="${OPENMM_COPYRIGHT_YEARS}"
-DOPENMM_AUTHORS="${OPENMM_AUTHORS}")
ELSE(NEED_QUOTES)
ADD_DEFINITIONS(-DOPENMM_COPYRIGHT_YEARS=${OPENMM_COPYRIGHT_YEARS}
-DOPENMM_AUTHORS=${OPENMM_AUTHORS})
ENDIF(NEED_QUOTES)

# -DOPENMM_TYPE has to be defined in the target subdirectories.
# -Dsimbody_EXPORTS defined automatically when Windows DLL build is being done.

Expand Down Expand Up @@ -283,7 +224,7 @@ IF (ANDROID OR PNACL)
ELSE (ANDROID OR PNACL)
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))
IF (NOT (ANDROID OR PNACL OR (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})
Expand All @@ -302,8 +243,6 @@ ENDIF(OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS)

INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)

SET(OPENMM_BUILD_SHARED_LIB ON CACHE BOOL "Whether to build shared OpenMM libraries")

SET(EXTRA_LINK_FLAGS ${EXTRA_COMPILE_FLAGS})
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
IF (NOT ANDROID)
Expand All @@ -319,7 +258,6 @@ IF(OPENMM_BUILD_SHARED_LIB)
SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES LINK_FLAGS "${EXTRA_LINK_FLAGS}" COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY -DPTHREAD_BUILDING_SHARED_LIBRARY")
ENDIF(OPENMM_BUILD_SHARED_LIB)

SET(OPENMM_BUILD_STATIC_LIB OFF CACHE BOOL "Whether to build static OpenMM libraries")
IF(OPENMM_BUILD_STATIC_LIB)
ADD_LIBRARY(${STATIC_TARGET} STATIC ${SOURCE_FILES} ${SOURCE_INCLUDE_FILES} ${API_ABS_INCLUDE_FILES})
SET(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -DOPENMM_USE_STATIC_LIBRARIES -DLEPTON_USE_STATIC_LIBRARIES -DPTW32_STATIC_LIB")
Expand Down Expand Up @@ -363,63 +301,19 @@ IF(BUILD_TESTING AND OPENMM_BUILD_REFERENCE_TESTS)
ADD_SUBDIRECTORY(platforms/reference/tests)
ENDIF(BUILD_TESTING AND OPENMM_BUILD_REFERENCE_TESTS)

# Which hardware platforms to build
# CUDA platform

# A bit of tedium because we are using custom FindCUDA files that happen to work...
SET(FINDCUDA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindCUDA")
SET(CUDA_BUILD_CUBIN OFF)
FIND_PACKAGE(CUDA QUIET)
IF(CUDA_FOUND)
IF(NOT CUDA_NVCC_FLAGS)
SET(FLAGS "")
# Note that cmake will insert semicolons between these item automatically...
SET(FLAGS ${FLAGS} -gencode arch=compute_11,code=sm_11)
SET(FLAGS ${FLAGS} -gencode arch=compute_12,code=sm_12)
SET(FLAGS ${FLAGS} -gencode arch=compute_13,code=sm_13)
SET(FLAGS ${FLAGS} -gencode arch=compute_20,code=sm_20)
SET(FLAGS ${FLAGS} -use_fast_math)
IF(MSVC)
# Unfortunately the variables CUDA_NVCC_FLAGS_RELEASE and CUDA_NVCC_FLAGS_DEBUG
# appear to be unused, at least in CMake 2.6
# Release /MD linkage
set(FLAGS ${FLAGS} "-Xcompiler \"/MD\" -DOPENMMCUDA_BUILDING_SHARED_LIBRARY")
ENDIF(MSVC)
SET(CUDA_NVCC_FLAGS "${FLAGS}"
CACHE STRING "Semicolon delimit multiple arguments")
ENDIF(NOT CUDA_NVCC_FLAGS)
SET(OPENMM_BUILD_CUDA_LIB ON CACHE BOOL "Build OpenMMCuda library for Nvidia GPUs")

# I wish I was not hardcoding /MD here
# Avoid strange windows link error with cuda free energy
# plugin by specifying /MD to CUDA_NVCC_FLAGS
MARK_AS_ADVANCED(CLEAR CUDA_NVCC_FLAGS)
IF(MSVC)
# Unfortunately the variables CUDA_NVCC_FLAGS_RELEASE and CUDA_NVCC_FLAGS_DEBUG
# appear to be unused, at least in CMake 2.6
# Release /MD linkage
SET(HAS_NVCC_FLAG FALSE)
IF(CUDA_NVCC_FLAGS MATCHES "-Xcompiler")
SET(HAS_NVCC_FLAG TRUE)
ENDIF(CUDA_NVCC_FLAGS MATCHES "-Xcompiler")
IF(NOT HAS_NVCC_FLAG)
set(new_flags "-Xcompiler \"/MD\" -DOPENMMCUDA_BUILDING_SHARED_LIBRARY")
if(CUDA_NVCC_FLAGS)
set(new_flags "${CUDA_NVCC_FLAGS};${new_flags}")
endif(CUDA_NVCC_FLAGS)
SET(CUDA_NVCC_FLAGS "${new_flags}"
CACHE STRING "Semicolon delimit multiple arguments" FORCE)
ENDIF(NOT HAS_NVCC_FLAG)
ENDIF(MSVC)
ELSE(CUDA_FOUND)
SET(OPENMM_BUILD_CUDA_LIB OFF CACHE BOOL "Build OpenMMCuda library for Nvidia GPUs")
ENDIF(CUDA_FOUND)
IF(OPENMM_BUILD_CUDA_LIB)
ADD_SUBDIRECTORY(platforms/cuda)
ENDIF(OPENMM_BUILD_CUDA_LIB)
MARK_AS_ADVANCED(CUDA_VERBOSE_BUILD)
MARK_AS_ADVANCED(CUDA_BUILD_CUBIN)
MARK_AS_ADVANCED(CUDA_BUILD_EMULATION)
MARK_AS_ADVANCED(CUDA_HOST_COMPILER CUDA_HOST_COMPILER_OPTIONS)

# OpenCL platform

FIND_PACKAGE(OpenCL QUIET)
IF(OPENCL_FOUND)
Expand Down Expand Up @@ -517,7 +411,7 @@ INSTALL_FILES(/include/sfmt FILES ${SFMT_HEADERS})

ADD_SUBDIRECTORY(serialization)
FILE(GLOB serialization_files ${CMAKE_SOURCE_DIR}/serialization/src/*.cpp)
SET_SOURCE_FILES_PROPERTIES(${serialization_files} PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY -DTIXML_USE_STL -DIEEE_8087")
SET_SOURCE_FILES_PROPERTIES(${serialization_files} PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY -DIEEE_8087")

# Python wrappers

Expand All @@ -535,23 +429,6 @@ IF(OPENMM_BUILD_PYTHON_WRAPPERS)
ADD_SUBDIRECTORY(wrappers/python)
ENDIF(OPENMM_BUILD_PYTHON_WRAPPERS)




#
# Allow automated build and dashboard.
#
# redundant INCLUDE(Dart) statement
# INCLUDE (Dart)

#IF (UNIX AND NOT CYGWIN AND NOT APPLE)
# IF (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
# ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
# LINK_LIBRARIES(gcov)
# ENDIF (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
#ENDIF (UNIX AND NOT CYGWIN AND NOT APPLE)


#
# Testing
#
Expand All @@ -573,5 +450,3 @@ SET(OPENMM_BUILD_EXAMPLES ON CACHE BOOL "Build example executables")
IF(OPENMM_BUILD_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF(OPENMM_BUILD_EXAMPLES)

ENDIF(NOT cmv EQUAL "2.4") # This whole file...
12 changes: 7 additions & 5 deletions appveyor.yml
@@ -1,14 +1,16 @@
os: Windows Server 2012 R2
os: Visual Studio 2015
platform: x64
configuration: Release
shallow_clone: true
install:

# Setup shell for VS2010, x64, release mode
- >
"%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release
# Setup shell for VS2015, x64
- call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
# Set path to python, git-bash tools.
- "set PATH=C:\\Python34-x64;C:\\Python34-x64\\Scripts;%PATH%"
- "set PATH=C:\\Python35-x64;C:\\Python35-x64\\Scripts;%PATH%"
- "set PATH=C:\\Program Files (x86)\\Git\\bin;%PATH%"
- pip install pytest
- pip install numpy

# 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
Expand Down
12 changes: 6 additions & 6 deletions devtools/packaging/scripts/windows/prepare.ps1
@@ -1,9 +1,5 @@
cd C:\Users\vagrant

# Install everything we can with choco.

choco install -y doxygen.portable swig cmake doxygen.install vcbuildtools git jom

# Install CUDA.

wget https://developer.nvidia.com/compute/cuda/8.0/prod/network_installers/cuda_8.0.44_win10_network-exe -UseBasicParsing -OutFile cuda_8.0.44_win10_network.exe
Expand All @@ -21,5 +17,9 @@ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe -U

# Install software with conda.

& "C:\Miniconda3\Scripts\conda.exe" install -y -c omnia fftw3f jinja2 lxml sphinx sphinxcontrib-autodoc_doxygen sphinxcontrib-lunrsearch conda-build
& "C:\Miniconda3\Scripts\pip.exe" install sphinxcontrib.bibtex
& "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\pip.exe" install sphinxcontrib.bibtex

# Install software with choco.

choco install -y doxygen.portable swig cmake doxygen.install vcbuildtools git jom
7 changes: 4 additions & 3 deletions docs-source/usersguide/application.rst
Expand Up @@ -916,8 +916,9 @@ Value Meaning
:code:`NoCutoff` No cutoff is applied.
:code:`CutoffNonPeriodic` The reaction field method is used to eliminate all interactions beyond a cutoff distance. Not valid for AMOEBA.
:code:`CutoffPeriodic` The reaction field method is used to eliminate all interactions beyond a cutoff distance. Periodic boundary conditions are applied, so each atom interacts only with the nearest periodic copy of every other atom. Not valid for AMOEBA.
:code:`Ewald` Periodic boundary conditions are applied. Ewald summation is used to compute long range interactions. (This option is rarely used, since PME is much faster for all but the smallest systems.) Not valid for AMOEBA.
:code:`PME` Periodic boundary conditions are applied. The Particle Mesh Ewald method is used to compute long range interactions.
:code:`Ewald` Periodic boundary conditions are applied. Ewald summation is used to compute long range Coulomb interactions. (This option is rarely used, since PME is much faster for all but the smallest systems.) Not valid for AMOEBA.
:code:`PME` Periodic boundary conditions are applied. The Particle Mesh Ewald method is used to compute long range Coulomb interactions.
:code:`LJPME` Periodic boundary conditions are applied. The Particle Mesh Ewald method is used to compute long range interactions for both Coulomb and Lennard-Jones.
========================= ===========================================================================================================================================================================================================================================


Expand All @@ -926,7 +927,7 @@ cutoff distance. Be sure to specify units, as shown in the examples above. For
example, :code:`nonbondedCutoff=1.5*nanometers` or
:code:`nonbondedCutoff=12*angstroms` are legal values.

When using :code:`Ewald` or :code:`PME`\ , you can optionally specify an
When using :code:`Ewald`, :code:`PME`, or :code:`LJPME`\ , you can optionally specify an
error tolerance for the force computation. For example:
::

Expand Down
4 changes: 2 additions & 2 deletions docs-source/usersguide/library.rst
Expand Up @@ -404,7 +404,7 @@ version of Visual Studio.
Install CMake
=============

CMake is the build system used for OpenMM. You must install CMake version 2.8
CMake is the build system used for OpenMM. You must install CMake version 3.1
or higher before attempting to build OpenMM from source. You can get CMake from
http://www.cmake.org/. If you choose to build CMake from source on Linux, make
sure you have the curses library installed beforehand, so that you will be able
Expand Down Expand Up @@ -509,7 +509,7 @@ Windows

On Windows, perform the following steps:

#. Click Start->All Programs->CMake 2.8->CMake
#. Click Start->All Programs->CMake 3.1->CMake
#. In the box labeled "Where is the source code:" browse to OpenMM src directory
(containing top CMakeLists.txt)
#. In the box labeled "Where to build the binaries" browse to your build_openmm
Expand Down
12 changes: 12 additions & 0 deletions docs-source/usersguide/references.bib
Expand Up @@ -517,3 +517,15 @@ @article{Wang2014
year = {2014},
type = {Journal Article}
}

@article{Wennberg2015
author = {Wennberg, Christian L. and Murtola, Teemu and Páll, Szilárd and Abraham, Mark J. and Hess, Berk and Lindahl, Erik},
title = {Direct-Space Corrections Enable Fast and Accurate {Lorentz–Berthelot} Combination Rule {Lennard-Jones} Lattice Summation},
journal = {Journal of Chemical Theory and Computation},
volume = {11},
number = {12},
pages = {5737-5746},
year = {2015},
type = {Journal Article}
}

0 comments on commit cd874b2

Please sign in to comment.