forked from ECCC-ASTD-MRD/gem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.initial_setup
34 lines (29 loc) · 1009 Bytes
/
.initial_setup
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
#!/bin/bash
# Source this file to:
# - Create the build and work directories for the specific architecture and compiler versions
# according to the existence or not of the storage_model environment variable
if [ -n "${GEM_DIR}" -a -n "${GEM_ARCH}" -a -n "${GEM_WORK}" ] ; then
if [ -n "${storage_model}" ] ; then
/bin/rm -rf ${GEM_DIR} build-${GEM_ARCH} ${GEM_WORK}
mkdir -p ${GEM_DIR}/work
mkdir -p ${GEM_DIR}/build
ln -sf ${GEM_DIR}/build ${PWD}/build-${GEM_ARCH}
ln -sf ${GEM_DIR}/work ${PWD}/${GEM_WORK}
else
/bin/rm -rf build-${GEM_ARCH} ${GEM_WORK}
mkdir -p build-${GEM_ARCH} ${GEM_WORK}
fi
if [ "$COMPILER_SUITE" == "intel" ] ; then
SETUP_FILE=.eccc_setup_intel
else
SETUP_FILE=.eccc_setup_gnu
fi
cat > ${PWD}/${GEM_WORK}/.eccc_setup <<EOF
ici=\$PWD
cd ${GEM_GIT_DIR}
. $SETUP_FILE
cd \$ici
EOF
else
echo "GEM environment variables not set! Make sure you use .common_setup script first."
fi