-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·72 lines (64 loc) · 2.18 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash -e
. /etc/profile.d/modules.sh
# dependencies
module add ci
module add cmake
module add gcc/${GCC_VERSION}
module add xz
module add gsl/2.3
module add python/2.7.13-gcc-${GCC_VERSION}
module add cfitsio
module add openssl/1.0.2j
module add sqlite
module add freetype
module add fftw/3.3.4-gcc-${GCC_VERSION}-mpi-1.8.8
module add openblas/0.2.19-gcc-${GCC_VERSION}
SOURCE_FILE=${NAME}_v${VERSION}.source.tar.gz
mkdir -p ${WORKSPACE}
mkdir -p ${SRC_DIR}
mkdir -p ${SOFT_DIR}
# Download the source file
if [ ! -e ${SRC_DIR}/${SOURCE_FILE}.lock ] && [ ! -s ${SRC_DIR}/${SOURCE_FILE} ] ; then
touch ${SRC_DIR}/${SOURCE_FILE}.lock
echo "seems like this is the first build - let's geet the source"
wget --no-check-certificate https://root.cern.ch/download/${SOURCE_FILE} -O ${SRC_DIR}/${SOURCE_FILE}
echo "releasing lock"
rm -v ${SRC_DIR}/${SOURCE_FILE}.lock
elif [ -e ${SRC_DIR}/${SOURCE_FILE}.lock ] ; then
# Someone else has the file, wait till it's released
while [ -e ${SRC_DIR}/${SOURCE_FILE}.lock ] ; do
echo " There seems to be a download currently under way, will check again in 5 sec"
sleep 5
done
else
echo "continuing from previous builds, using source at " ${SRC_DIR}/${SOURCE_FILE}
fi
mkdir -p ${WORKSPACE}/${NAME}-${VERSION}/build-${BUILD_NUMBER}
tar xzf ${SRC_DIR}/${SOURCE_FILE} -C ${WORKSPACE}/${NAME}-${VERSION} --skip-old-files --strip-components=1
cd ${WORKSPACE}/${NAME}-${VERSION}/build-${BUILD_NUMBER}
export CPPFLAGS="$CPPFLAGS -I${OPENSSL_DIR}/include -L${OPENSSL_DIR}/lib"
export LDFLAGS="$LDFLAGS -L${OPENSSL_DIR}/lib"
# Using CMAKE. See https://root.cern.ch/installing-root-source
cmake ../ -G"Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=${SOFT_DIR}-gcc-${GCC_VERSION} \
-Dbuiltin_freetype=OFF \
-Dbuiltin_zlib=ON \
-Dbuiltin_tbb=ON \
-Dbuiltin_lzma=OFF \
-DLZMA_INCLUDE_DIR=${XZ_DIR}/include \
-DLZMA_LIBRARY=${XZ_DIR}/lib/liblzma.so \
-Dx11=OFF \
-Dbuiltin_gsl=OFF \
-Dgsl_shared=ON \
-DGSL_DIR=${GSL_DIR} \
-Dbuiltin_cfitsio=OFF \
-Dfitsio=ON \
-DCFITSIO_INCLUDE_DIR=${CFITSIO_DIR}/include \
-DCFITSIO_LIBRARY=${CFITSIO_DIR}/lib/libcfitsio.so \
-DCFITSIO=${CFITSIO_DIR} \
-Dhdfs=OFF \
-Dfortran=ON \
-Droofit=ON \
-Droottest=ON \
-Dtest=ON
OS="Linux" make