-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
157 lines (151 loc) · 3.81 KB
/
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
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
154
155
156
#! /bin/sh
# Setup script for the Elk Code
# generic values
MAKE="make"
F90="f90"
F90_OPTS=""
F77=$F90
F77_OPTS=$F90_OPTS
AR="ar"
LIB_SYS=""
LIB_LPK="lapack.a blas.a"
LIB_FFT="fftlib.a"
# get system type from user
GETSYS ()
{
clear
echo "Choose system type:"
echo
echo " 1. HP-UX, It2, HP Fortran 2. Linux, x86, Intel Fortran 7"
echo " 3. Linux, x86, Intel Fortran 8-10 4. Linux, x86, NAG Fortran"
echo " 5. Tru64, HP/Compaq Fortran 6. HP-UX, It2, HP Fortran, OpenMP"
echo " 7. AIX, XL Fortran 8. Linux, x86, g95"
echo " 9. Linux, x86, PGI 10. Fujitsu VPP"
echo "11. Hitachi SR8000 12. IBM AIX, RISC6000"
echo "13. SGI Origin 2000/3000 14. SUN workstations"
echo "15. Cray-T3E 16. OSX, G4/5, Absoft Fortran"
echo "17. OSX, G4/5, NAG Fortran 18. Linux, x86, GFortran"
echo
echo " o. Other x. Exit"
echo
read SYS
if [ "$SYS" = x ] ; then
exit 0
elif [ "$SYS" = o ] ; then
echo "Enter Fortran 90 compiler command:"
read F90
echo "Enter Fortran 90 compiler options:"
read F90_OPTS
echo "Enter Fortran 77 compiler command:"
read F77
echo "Enter Fortran 77 compiler options:"
read F77_OPTS
elif [ "$SYS" = 1 ] ; then
F90="f90"
F90_OPTS="+Ofast +DD64"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 2 ] ; then
F90="ifc"
F90_OPTS="-O3 -ip -unroll -prefetch -scalar_rep -w90"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 3 ] ; then
F90="ifort"
F90_OPTS="-O3 -ip -unroll -scalar_rep -w90"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 4 ] ; then
F90="f95"
F90_OPTS="-O4 -kind=byte -dusty -dcfuns"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 5 ] ; then
F90="f90"
F90_OPTS="-O5 -fast"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 6 ] ; then
F90="f90"
F90_OPTS="+Ofast +Oopenmp +DD64"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 7 ] ; then
F90="xlf90"
F90_OPTS="-O4"
F77="xlf77"
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 8 ] ; then
F90="g95"
F90_OPTS="-O3 -funroll-loops -ffast-math"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 9 ] ; then
F90="pgf90"
F90_OPTS="-fast"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 10 ] ; then
F90="frt"
F90_OPTS="-O4"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 11 ] ; then
F90="f90"
F90_OPTS="-O4"
elif [ "$SYS" = 12 ] ; then
F90="xlf"
F90_OPTS="-O3 -qsuffix=f=f90 -qfree=f90"
F77=$F90
F77_OPTS="-O3"
elif [ "$SYS" = 13 ] ; then
F90="f90"
F90_OPTS="-mips4 -64 -O2"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 14 ] ; then
F90="f90"
F90_OPTS="-fast -dalign"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 15 ] ; then
F90="f90"
F90_OPTS="-O3"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 16 ] ; then
F90="f90"
F90_OPTS="-O"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 17 ] ; then
F90="f95"
F90_OPTS="-O4 -kind=byte -dusty -dcfuns"
F77=$F90
F77_OPTS=$F90_OPTS
elif [ "$SYS" = 18 ] ; then
F90="gfortran"
F90_OPTS="-O3 -funroll-loops -ffast-math"
F77=$F90
F77_OPTS=$F90_OPTS
else
GETSYS
fi
}
GETSYS
# produce the make.inc file
echo "MAKE = $MAKE" > make.inc
echo "F90 = $F90" >> make.inc
echo "F90_OPTS = $F90_OPTS" >> make.inc
echo "F77 = $F77" >> make.inc
echo "F77_OPTS = $F77_OPTS" >> make.inc
echo "AR = $AR" >> make.inc
echo "LIB_SYS = $LIB_SYS" >> make.inc
echo "LIB_LPK = $LIB_LPK" >> make.inc
echo "LIB_FFT = $LIB_FFT" >> make.inc
echo
echo "You can now edit the compiler options in \"make.inc\" for optimal"
echo "performance on your system as well as enabling OpenMP parallelisation."
echo
echo "Then run \"make\" to compile the code."
echo