forked from epifanovsky/libtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·112 lines (101 loc) · 2.26 KB
/
configure
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
CC0=
CXX0=
BUILD_TYPE=
DEFAULT_BLAS=
BLAS=
WITH_XM=0
CTF_INCLUDE=
CTF_LIB=
GENERATOR_UNIX="Unix Makefiles"
GENERATOR_MINGW32="MinGW Makefiles"
GENERATOR=$GENERATOR_UNIX
function set_compilers() {
if [ "x$CC0" != "x" ]; then
echo "Choose only one compiler option."
exit 1
fi
CC0=$1
CXX0=$2
if [ "x$3" != "x" ]; then
GENERATOR=$3
fi
}
function set_build_type() {
if [ "x$BUILD_TYPE" != "x" ]; then
echo "Choose only one build type."
exit 1
fi
BUILD_TYPE=$1
}
function set_default_blas() {
if [ "x$DEFAULT_BLAS" == "x" ]; then
DEFAULT_BLAS=$1
fi
}
while [ $# -gt 0 ]; do
case $1 in
gcc ) set_compilers "gcc" "g++"
;;
mingw32 ) set_compilers "gcc" "g++" "$GENERATOR_MINGW"
;;
intel ) set_compilers "icc" "icpc"
set_default_blas "mkl"
;;
open64 ) set_compilers "opencc" "openCC"
;;
pgi ) set_compilers "pgcc" "pgCC"
;;
ibm ) set_compilers "xlc" "xlC"
;;
mkl ) BLAS=mkl
;;
acml ) BLAS=acml
;;
essl ) BLAS=essl
;;
atlas ) BLAS=atlas
;;
openblas ) BLAS=openblas
;;
debug ) set_build_type "DEBUG"
;;
release ) set_build_type "RELEASE"
;;
relwdeb ) set_build_type "RELWITHDEBINFO"
;;
--with-xm )
WITH_XM=1
;;
--with-ctf=* )
CTF_INCLUDE="${1#--with-ctf=}/include"
CTF_LIB="${1#--with-ctf=}/lib"
;;
--with-ctf-include=* )
CTF_INCLUDE="${1#--with-ctf-include=}"
;;
--with-ctf-lib=* )
CTF_LIB="${1#--with-ctf-lib=}"
;;
esac
shift
done
CC0_SPEC=1
if [ "x$CC0" == "x" ]; then
CC0_SPEC=0
fi
if [ "x$CC" != "x" -o "x$CXX" != "x" ]; then
if [ $CC0_SPEC -eq 0 ]; then
CC0=$CC
CXX0=$CXX
fi
fi
if [ "x$BLAS" == "x" ]; then
BLAS=$DEFAULT_BLAS
fi
mkdir build
cd build
if [ -e CMakeCache.txt ]; then
rm CMakeCache.txt
fi
CC="$CC0" CXX="$CXX0" cmake -G "$GENERATOR" -D CMAKE_BUILD_TYPE="$BUILD_TYPE" -D WITH_BLAS="$BLAS" -D WITH_XM=$WITH_XM -D CTF_INCLUDE="$CTF_INCLUDE" -D CTF_LIB="$CTF_LIB" ..