build-gcc.sh 1.75 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
19
20
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$INSTALL"

# setting the rpath so that libOpenMMPME.so finds the right libfftw3
#CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
jchodera's avatar
jchodera committed
21
22
23
24
25
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/"
26
27
CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include/"
CMAKE_FLAGS+=" -DOPENCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so"
peastman's avatar
peastman committed
28
CMAKE_FLAGS+=" -DOPENMM_GENERATE_API_DOCS=ON"
jchodera's avatar
jchodera committed
29
30
31
32
33
34
35
# Don't build tests
CMAKE_FLAGS+=" -DBUILD_TESTING=OFF"
CMAKE_FLAGS+=" -DOPENMM_BUILD_CPU_TESTS=OFF"
CMAKE_FLAGS+=" -DOPENMM_BUILD_CUDA_TESTS=OFF"
CMAKE_FLAGS+=" -DOPENMM_BUILD_OPENCL_TESTS=OFF"
CMAKE_FLAGS+=" -DOPENMM_BUILD_REFERENCE_TESTS=OFF"
CMAKE_FLAGS+=" -DOPENMM_BUILD_SERIALIZATION_TESTS=OFF"
36
# Set location for FFTW3
37
PREFIX="$WORKSPACE/miniconda"
38
39
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"

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

# Install.
53
make install
jchodera's avatar
jchodera committed
54
55

cd ..