forked from sandialabs/seacas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompiler.sh
68 lines (65 loc) · 1.25 KB
/
compiler.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
#! /usr/bin/env bash
COMPILER="${COMPILER:-gnu}"
MPI="${MPI:-NO}"
if [ "$COMPILER" == "mpi" ]
then
MPI="YES"
fi
if [ "$MPI" == "YES" ] && [ "$CRAY" = "YES" ]
then
export CC=cc
export CXX=CC
elif [ "$MPI" == "YES" ]
then
export CC=mpicc
export CXX=mpicxx
else
if [ "$COMPILER" == "gnu" ]
then
export CC=gcc
export CXX=g++
fi
if [ "$COMPILER" == "clang" ]
then
export CC=clang
export CXX=clang++
fi
if [ "$COMPILER" == "gnubrew" ]
then
VER=${VER:-10}
CXX=g++-${VER}
CC=gcc-${VER}
fi
if [ "$COMPILER" == "gnumacport" ]
then
VER=${VER:-5}
export CXX=g++-mp-${VER}
export CC=gcc-mp-${VER}
fi
if [ "$COMPILER" == "clangmacport" ]
then
VER=${VER:-7}
export CXX=clang++-mp-${VER}.0
export CC=clang-mp-${VER}.0
fi
if [ "$COMPILER" == "intel" ]
then
export CC=icc
export CXX=icc
fi
if [ "$COMPILER" == "analyzer" ]
then
export CXX=/opt/local/libexec/llvm-9.0/libexec/c++-analyzer
export CC=/opt/local/libexec/llvm-9.0/libexec/ccc-analyzer
fi
if [ "$COMPILER" == "ibm" ]
then
export CC=xlc
export CXX=xlc
fi
if [ "$COMPILER" == "nvidia" ]
then
export CXX="nvcc -x c++"
expoort CC=nvcc
fi
fi