build.sh 1.22 KB
Newer Older
1
2
3
4
5
#!/bin/bash

# Build script for Mac OS X distribution, for use in automated packaging.
# Note that this must be run from outside the checked-out openmm/ directory.

6
7
8
# Set relative workspace path.
export WORKSPACE=`pwd`

9
# Add conda binaries to path.
10
PATH=$WORKSPACE/miniconda/bin:$PATH
11

12
# Set install directory.
13
INSTALL=`pwd`/install
14
15
16
17
if [ -e $INSTALL ]; then
    rm -rf $INSTALL
fi

18
19
20
21
22
23
24
25
26
27
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$INSTALL"

# setting the rpath so that libOpenMMPME.so finds the right libfftw3
#CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"

# Build in subdirectory.
# Set location for FFTW3
28
PREFIX="$WORKSPACE/miniconda"
29
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
30
31
CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.dylib"
CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.dylib"
32

33
34
35
36
# Build in subdirectory.
if [ -e build ]; then
    rm -rf build
fi
37
38
39
mkdir build
cd build
cmake ../openmm $CMAKE_FLAGS
40
make -j4 all C++ApiDocs PythonApiDocs sphinxpdf
41
42

# Install.
43
make install