-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_v2_min.sh
executable file
·83 lines (75 loc) · 2.37 KB
/
build_v2_min.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
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
VM=$1
OUT=$2
KEEP=$3
if [ -z $OUT ];then
echo "Usage $0 <vm> <DEB|RPM> [keep]"
exit
fi
if [ -z $PARALLEL ];then
PARALLEL=3
fi
echo "Running docker on $VM"
echo "PARALLEL=$PARALLEL"
if [ -z $KEEP ];then
KEEP="--rm"
else
KEEP=""
fi
# make sure output directory is writable to the container
mkdir -p packages/min
mkdir -p cache
mkdir -p ccache
chmod a+w packages/min
chmod a+w cache
chmod a+w ccache
docker run ${KEEP} -i -v $(pwd)/minc-toolkit-v2:/home/nistmni/minc-toolkit-v2 -v $(pwd)/packages:/home/nistmni/build -v $(pwd)/cache:/home/nistmni/cache -v $(pwd)/ccache:/ccache $VM /bin/bash <<END
set -x
export CCACHE_DIR=/ccache
mkdir src
cd src
ln -s /home/nistmni/minc-toolkit-v2
VERSION="\$(grep -o -E "MINC_TOOLKIT_PACKAGE_VERSION_MAJOR [0-9]+" minc-toolkit-v2/CMakeLists.txt | cut -d " " -f 2)"
VERSION="\${VERSION}.\$(grep -o -E "MINC_TOOLKIT_PACKAGE_VERSION_MINOR [0-9]+" minc-toolkit-v2/CMakeLists.txt | cut -d " " -f 2)"
VERSION="\${VERSION}.\$(grep -o -E "MINC_TOOLKIT_PACKAGE_VERSION_PATCH [0-9]+" minc-toolkit-v2/CMakeLists.txt | cut -d " " -f 2)"
mkdir -p build/minc-toolkit-v2
cd build/minc-toolkit-v2
ln -s /home/nistmni/cache
cmake ../../minc-toolkit-v2 \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -DNDEBUG -mtune=generic -fcommon" \
-DCMAKE_C_FLAGS_RELEASE:STRING="-O3 -DNDEBUG -mtune=generic -fcommon" \
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-O3 -DNDEBUG -mtune=generic -fcommon" \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/minc/\${VERSION} \
-DMT_BUILD_ABC:BOOL=OFF \
-DMT_BUILD_ANTS:BOOL=ON \
-DMT_BUILD_C3D:BOOL=OFF \
-DMT_BUILD_ELASTIX:BOOL=ON \
-DMT_BUILD_IM:BOOL=OFF \
-DMT_BUILD_ITK_TOOLS:BOOL=ON \
-DMT_BUILD_LITE:BOOL=OFF \
-DMT_BUILD_SHARED_LIBS:BOOL=ON \
-DMT_BUILD_VISUAL_TOOLS:BOOL=OFF \
-DMT_USE_OPENMP:BOOL=ON \
-DMT_BUILD_OPENBLAS:BOOL=ON \
-DMT_BUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DMT_BUILD_LITE:BOOL=OFF \
-DUSE_SYSTEM_GLUT:BOOL=OFF \
-DUSE_SYSTEM_FFTW3D:BOOL=OFF \
-DUSE_SYSTEM_FFTW3F:BOOL=OFF \
-DUSE_SYSTEM_GLUT:BOOL=OFF \
-DUSE_SYSTEM_GSL:BOOL=OFF \
-DUSE_SYSTEM_HDF5:BOOL=OFF \
-DUSE_SYSTEM_ITK:BOOL=OFF \
-DUSE_SYSTEM_NETCDF:BOOL=OFF \
-DUSE_SYSTEM_NIFTI:BOOL=OFF \
-DUSE_SYSTEM_PCRE:BOOL=OFF \
-DUSE_SYSTEM_ZLIB:BOOL=OFF && \
make -j${PARALLEL} &&
cpack -G ${OUT} &&
cp -v *.rpm *.deb ~/build/min/
# run tests separately
make test > ~/build/test_${VM}_v2_min.txt
END
exit