-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcc-config.sh
executable file
·37 lines (31 loc) · 1003 Bytes
/
gcc-config.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
: ${INSTALL_ROOT:?'INSTALL_ROOT must be set to the appropriate path'}
#if [[ -d "/etc/opt/cray/release/" ]]; then
# export CC=cc
# export CXX=CC
# export CRAYPE_LINK_TYPE=dynamic
# export XTPE_LINK_TYPE=dynamic
# echo "WARNING!!! You should switch to the gnu compiler env (module switch PrgEnv-cray/5.2.82 PrgEnv-gnu)!!!!!!!"
#else
export CC=$(which gcc)
export CXX=$(which g++)
if [[ ${NL_WITH_GCC} == ON ]]; then
export CC=${INSTALL_ROOT}/gcc/bin/gcc
export CXX=${INSTALL_ROOT}/gcc/bin/g++
export LD_LIBRARY_PATH=${INSTALL_ROOT}/gcc/lib64:${LD_LIBRARY_PATH}
fi
export CFLAGS=-fPIC
export LDCXXFLAGS="${LDFLAGS} -std=c++14 "
case $(uname -i) in
ppc64le)
export CXXFLAGS="-fPIC -mcpu=native -mtune=native -ffast-math -std=c++14 "
export LIBHPX=lib64
;;
x86_64)
export CXXFLAGS="-fPIC -march=native -ffast-math -std=c++14 "
export LIBHPX=lib
;;
*)
echo 'Unknown architecture encountered.' 2>&1
exit 1
;;
esac