build.sh 1.27 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.
Saurabh Belsare's avatar
Saurabh Belsare committed
10
PATH=/Users/saurabhbelsare/software/anaconda/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
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++"
Saurabh Belsare's avatar
Saurabh Belsare committed
23
24
CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.10"
CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=/Users/saurabhbelsare/software/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"
25
26
27

# Build in subdirectory.
# Set location for FFTW3
Saurabh Belsare's avatar
Saurabh Belsare committed
28
PREFIX="/Users/saurabhbelsare/software/anaconda"
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 DoxygenApiDocs sphinxpdf
41
42

# Install.
43
make install