-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·153 lines (147 loc) · 4.64 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#! /bin/csh -f
#
# (C) Rasmus Munk Larsen, Stanford, 2004
#
set OS = `uname -s`
set HW = `uname -m`
set PLAT = UNKNOWN
set SUB_PLAT
@ i = 1
while ($i <= $#argv )
set arg = $argv[$i]
switch("$arg")
case "-icc":
set ICC
breaksw
case "-openmp":
set OPENMP
set SUB_PLAT = _OMP
breaksw
case "-keep":
set KEEP
breaksw
default:
echo Unknown option '"'$arg'"'.
set ERROR
endsw
@ i++
end
if ( $?ERROR ) then
echo "Usage: configure [-icc] [-openmp] [-keep]"
echo " -icc: Use the Intel compilers. Only availably on ia32 and ia64 systems."
echo " -openmp: Produce parallel executable using OpenMP. Only available on IRIX and IBM systems, and on ia32 and ia64 systems in conjuction with -icc."
echo " -keep: Do not delete .o files from a previous build, only update make options."
exit(0)
endif
switch ($OS)
case AIX*
if ( $?OPENMP ) then
echo 'OPENMP = -qsmp=omp' > make.inc
echo 'SUB_PLAT = _OMP' >> make.inc
else
echo 'OPENMP =' > make.inc
echo 'SUB_PLAT = ' >> make.inc
endif
cat Make/make.ibm >> make.inc
endif
set PLAT = IBM$SUB_PLAT
breaksw
case Darwin*
echo 'OPENMP =' > make.inc
echo 'SUB_PLAT = ' >> make.inc
set PLAT = DARWIN$SUB_PLAT
cat Make/make.darwin_xlf >> make.inc
breaksw
case IRIX*
if ( $?OPENMP ) then
echo 'OPENMP = -mp' > make.inc
echo 'SUB_PLAT = _OMP' >> make.inc
else
echo 'OPENMP =' > make.inc
echo 'SUB_PLAT = ' >> make.inc
endif
echo "CPUOPT = -Ofast="$HW >> make.inc
cat Make/make.irix >> make.inc
endif
set PLAT = IRIX$SUB_PLAT
breaksw
case Linux*
if ( $?OPENMP && ! $?ICC ) then
echo "OpenMP requires the Intel compiler. Adding option -icc."
set ICC
endif
if ( $?ICC ) then
if ( $?OPENMP ) then
echo 'OPENMP = -openmp' > make.inc
echo 'SUB_PLAT = _OMP' >> make.inc
else
echo 'OPENMP =' > make.inc
echo 'SUB_PLAT = ' >> make.inc
endif
if ( $HW == "ia64" ) then
set PLAT = LINUX_ICC_IA64$SUB_PLAT
cat Make/make.linux_icc_ia64 >> make.inc
else if ( $HW == "x86_64" ) then
set PLAT = LINUX_ICC_X86_64$SUB_PLAT
if ( `cat /proc/cpuinfo | grep sse3 | wc -c` > 0 ) then
# Pentium 4/Xeon with SSE3?
echo "CPUOPT = -xP" >> make.inc
else
# Pentium 4/Xeon without SSE3?
echo "CPUOPT = -xW" >> make.inc
endif
cat Make/make.linux_icc_x86_64 >> make.inc
else
if ( `cat /proc/cpuinfo | grep sse2 | wc -c` > 0 ) then
# Pentium 4?
echo "CPUOPT = -xN" >> make.inc
else if ( `cat /proc/cpuinfo | grep sse | wc -c` > 0 ) then
# Pentium III?
echo "CPUOPT = -xK" >> make.inc
else
# Pentium II?
echo "CPUOPT = -xi" >> make.inc
endif
set PLAT = LINUX_ICC_IA32$SUB_PLAT
cat Make/make.linux_icc_ia32 >> make.inc
endif
else
if ( $HW == "ia64" ) then
echo "*************************************************************"
echo WARNING: Using the GCC compiler for the Itanium architecture
echo produces very sub-optimal code. We recommend using the Intel
echo compilers if available. Rerun configure with option "-icc" if
echo the Intel compilers are installed on your system.
echo "*************************************************************"
set PLAT = LINUX_GCC_IA64
cp Make/make.linux_gcc_ia64 make.inc
else if ( $HW == "x86_64" ) then
set PLAT = LINUX_GCC_X86_64$SUB_PLAT
echo "CPUOPT = -march=nocona -mfpmath=sse" > make.inc
cat Make/make.linux_gcc_x86_64 >> make.inc
else
if ( `cat /proc/cpuinfo | grep sse2 | wc -c` > 0 ) then
# Pentium 4?
echo "CPUOPT = -march=pentium4 -mfpmath=sse" > make.inc
else if ( `cat /proc/cpuinfo | grep sse | wc -c` > 0 ) then
# Pentium III?
echo "CPUOPT = -march=pentium3 -mfpmath=sse" > make.inc
else
# Pentium II?
echo "CPUOPT = -march=pentium2" > make.inc
endif
set PLAT = LINUX_GCC_IA32
cat Make/make.linux_gcc_ia32 >> make.inc
endif
endif
breaksw
case SunOS*
cp Make/make.sunos make.inc
set PLAT = SUNOS
breaksw
endsw
if ( ! $?KEEP ) then
echo "Removing .o and other temporary files from previous install."
make clean >& /dev/null
endif
echo Platform = $PLAT