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

# Build script for Linux 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
INSTALL=`pwd`/install
13
14
15
16
if [ -e $INSTALL ]; then
    rm -rf $INSTALL
fi

17
18
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$INSTALL"

19
20
21
22
23
24
# Don't build tests
CMAKE_FLAGS+=" -DBUILD_TESTING=OFF"

# Ensure we build a release
CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=Release"

25
26
# setting the rpath so that libOpenMMPME.so finds the right libfftw3
#CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
27
# Use NVIDIA CUDA 8.0
jchodera's avatar
jchodera committed
28
29
30
31
32
CMAKE_FLAGS+=" -DCUDA_CUDART_LIBRARY=/usr/local/cuda-8.0/lib64/libcudart.so"
CMAKE_FLAGS+=" -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-8.0/bin/nvcc"
CMAKE_FLAGS+=" -DCUDA_SDK_ROOT_DIR=/usr/local/cuda-8.0/"
CMAKE_FLAGS+=" -DCUDA_TOOLKIT_INCLUDE=/usr/local/cuda-8.0/include"
CMAKE_FLAGS+=" -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0/"
33
# Use AMD APP SDK 3.0
34
35
CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include/"
CMAKE_FLAGS+=" -DOPENCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so"
36
# Generate API docs
peastman's avatar
peastman committed
37
CMAKE_FLAGS+=" -DOPENMM_GENERATE_API_DOCS=ON"
38
# Set location for FFTW3
39
PREFIX="$WORKSPACE/miniconda"
40
41
42
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.so"
CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.so"
43
44
# Necessary to find GL headers
CMAKE_FLAGS+=" -DCMAKE_CXX_FLAGS_RELEASE=-I/usr/include/nvidia/"
45
46

# Build in subdirectory.
47
48
49
if [ -e build ]; then
    rm -rf build
fi
50
51
52
mkdir build
cd build
cmake ../openmm $CMAKE_FLAGS
53
54
make -j4 all install
make -j4 PythonInstall C++ApiDocs PythonApiDocs sphinxpdf
55
56

# Install.
57
make install
jchodera's avatar
jchodera committed
58
59

cd ..