-
Notifications
You must be signed in to change notification settings - Fork 6
/
.initial_setup
37 lines (33 loc) · 1.23 KB
/
.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
35
36
37
#!/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 these directories already exist, they will be deleted, and recreated.
# Additionally, a setup file is copied in the work directory as a shortcut.
if [ -n "${GEM_STORAGE_DIR}" -a -n "${GEM_ARCH}" -a -n "${GEM_WORK}" ] ; then
if [ -n "${storage_model}" ] ; then
/bin/rm -rf ${GEM_STORAGE_DIR} build-${GEM_ARCH} ${GEM_WORK}
mkdir -p ${GEM_STORAGE_DIR}/work
mkdir -p ${GEM_STORAGE_DIR}/build
ln -sf ${GEM_STORAGE_DIR}/build ${PWD}/build-${GEM_ARCH}
ln -sf ${GEM_STORAGE_DIR}/work ${PWD}/${GEM_WORK}
else
/bin/rm -rf build-${GEM_ARCH} ${GEM_WORK}
mkdir -p build-${GEM_ARCH} ${GEM_WORK}
fi
if [ -n "${EC_ARCH}" ]; then
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_DIR}
. ./${SETUP_FILE}
cd \$ici
EOF
fi
else
echo "GEM environment variables not set! Make sure you use .common_setup script first."
fi