-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
executable file
·74 lines (67 loc) · 2.79 KB
/
deploy.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
#!/bin/bash -e
# build script for abinit
. /etc/profile.d/modules.sh
# We provide the base module which all jobs need to get their environment on the build slaves
module add deploy
module add gsl
module add gcc/${GCC_VERSION}
module add openmpi/${OPENMPI_VERSION}-gcc-${GCC_VERSION}
module add fftw/3.3.4-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION}
module add lapack/3.6.0-gcc-${GCC_VERSION}
module add netcdf/4.3.2-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION}
cd ${WORKSPACE}/${NAME}-${VERSION}/build-${BUILD_NUMBER}
rm -rf *
# Note that $SOFT_DIR is used as the target installation directory.
../configure \
--prefix=${SOFT_DIR}-mpi-${OPENMPI_VERSION}-gcc-${GCC_VERSION} \
--enable-mpi \
--enable-mpi-io \
--enable-openmp \
--with-mpi-prefix=${OPENMPI_DIR} \
--with-fft-flavor="fftw3" \
--with-fft-incs="-I${FFTW_DIR}/include" \
--with-fft-libs="-L${FFTW_DIR}/lib -lfftw3 -lfftw3f -lfftw3_mpi -lfftw3f_mpi" \
--with-linalg-flavour="netlib" \
--with-linalg-incs="-I${LAPACK_DIR}/include" \
--with-linalg-libs="-L${LAPACK_DIR}/lib -lblas -llapack" \
--enable-netcdf=yes \
--with-netcdf-incs="-I${NETCDF_DIR}/include" \
--with-netcdf-libs="-L${NETCDF_DIR}/lib -lnetcdf" \
--with-math-flavour="gsl" \
--with-math-incs="-I${GSL_DIR}/include" \
--with-math-libs="-L${GSL_DIR}/lib -lgsl"
# The build nodes have 8 core jobs. jobs are blocking, which means you can build with at least 8 core parallelism.
# this might cause instability in the builds, so it's up to you.
nice -n20 make -j2
nice -n20 make install
echo "install finished, now making the module"
mkdir -p modules
(
cat <<MODULE_FILE
#%Module1.0
## $NAME modulefile
##
proc ModulesHelp { } {
puts stderr "\\tAdds $NAME ($VERSION.) to your environment."
}
module-whatis "Sets the environment for using $NAME ($VERSION.) Built with GCC ${GCC_VERSION} and OpenMPI Version ${OPENMPI_VERSION}"
module add gcc/${GCC_VERSION}
module add openmpi/${OPENMPI_VERSION}-gcc-${GCC_VERSION}
module add gsl
module add fftw/3.3.4-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION}
module add netcdf/4.3.2-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION}
setenv ABINIT_VERSION $VERSION
setenv ABINIT_DIR $::env(CVMFS_DIR)/$::env(SITE)/$::env(OS)/$::env(ARCH)/$NAME/${VERSION}/${VERSION}-mpi-${OPENMPI_VERSION}-gcc-${GCC_VERSION}
setenv ABINIT_ROOT $::env(ABINIT_DIR)
setenv CFLAGS "$CFLAGS -I$::env(ABINIT_DIR)/include -L$::env(ABINIT_DIR)/lib"
prepend-path CPATH $::env(ABINIT_DIR)/include
prepend-path LD_LIBRARY_PATH $::env(ABINIT_DIR)/lib
prepend-path PATH $::env(ABINIT_DIR)/bin
MODULE_FILE
) > modules/${VERSION}-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION}
mkdir -p ${CHEMISTRY}/${NAME}
cp modules/${VERSION}-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION} ${CHEMISTRY}/${NAME}
echo "checking module availability"
module avail $NAME
echo "adding module"
module add ${NAME}/${VERSION}-gcc-${GCC_VERSION}-mpi-${OPENMPI_VERSION}