-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmake_build.bash
More file actions
71 lines (58 loc) · 1.49 KB
/
cmake_build.bash
File metadata and controls
71 lines (58 loc) · 1.49 KB
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
#!/bin/bash
echo 'BEGIN BUILD SCRIPT'
jenkins_jobs_dir=$(dirname "$WORKSPACE")
this_job_name=$(basename "$WORKSPACE")
build_type=''
up_job_name=''
if [[ $this_job_name == *dev* ]]; then
build_type=dev
up_job_name=checkout-dev
elif [[ $this_job_name == *stable* ]]; then
build_type=stable
up_job_name=checkout-stable
else
echo "ERROR: UNKOWN BUILD TYPE"
exit 1
fi
upstream_dir=$jenkins_jobs_dir/$up_job_name
charmm_build_vars=$*
echo "DETECTED: build type ${build_type}"
echo "DETECTED: upstream job name ${up_job_name}"
echo "DETECTED: charmm build vars ${charmm_build_vars}"
echo "begin configuring environment..."
if [[ "$this_job_name" == *intel* ]]; then
echo "an intel build"
source scripts/load_modules.bash intel
else
echo "a gcc build"
source scripts/load_modules.bash gcc
fi
echo "...finished configuring environment"
if [[ -d bld ]]; then
echo "removing an old build dir"
rm -rf bld;
fi
if [[ -d inst ]]; then
echo "removing an old charmm install"
rm -rf inst;
fi
echo "making a new build dir"
mkdir bld
echo "switching to the new build dir"
pushd bld || exit
echo "start configure script..."
"$upstream_dir"/configure -p ../inst $charmm_build_vars --with-ninja
echo "... configure script finished"
echo "begin compile using ninja..."
ninja install
echo "... finished with ninja"
popd || exit
echo "exited build directory"
if [[ -d bld ]]; then
echo "removing the build dir"
rm -rf bld;
fi
if [[ -d scripts ]]; then
rm -rf scripts
fi
echo 'END BUILD SCRIPT'