iexciting-0.9.224
[exciting.git] / setup
blob8dbc27b2c02de365c735fea130baea2ee591f386
1 #! /bin/sh
2 # Setup script for the EXCITING Code
4 # generic values
5 MAKE="make"
6 F90="f90"
7 F90_OPTS=""
8 F77=$F90
9 F77_OPTS=$F90_OPTS
10 AR="ar"
11 LIB_SYS=""
12 LIB_LPK="lapack.a blas.a"
13 LIB_FFT="fftlib.a"
15 # get system type from user
16 GETSYS ()
18 clear
19 echo "Choose system type:"
20 echo
21 echo " 1. HP-UX, It2, HP Fortran 2. Linux, x86, Intel Fortran 7"
22 echo " 3. Linux, x86, Intel Fortran 8-10 4. Linux, x86, NAG Fortran"
23 echo " 5. Tru64, HP/Compaq Fortran 6. HP-UX, It2, HP Fortran, OpenMP"
24 echo " 7. AIX, XL Fortran 8. Linux, x86, g95"
25 echo " 9. Linux, x86, PGI 10. Fujitsu VPP"
26 echo "11. Hitachi SR8000 12. IBM AIX, RISC6000"
27 echo "13. SGI Origin 2000/3000 14. SUN workstations"
28 echo "15. Cray-T3E 16. OSX, G4/5, Absoft Fortran"
29 echo "17. OSX, G4/5, NAG Fortran 18. Linux, x86, GFortran"
30 echo
31 echo " o. Other x. Exit"
32 echo
33 read SYS
34 if [ "$SYS" = x ] ; then
35 exit 0
36 elif [ "$SYS" = o ] ; then
37 echo "Enter Fortran 90 compiler command:"
38 read F90
39 echo "Enter Fortran 90 compiler options:"
40 read F90_OPTS
41 echo "Enter Fortran 77 compiler command:"
42 read F77
43 echo "Enter Fortran 77 compiler options:"
44 read F77_OPTS
45 elif [ "$SYS" = 1 ] ; then
46 F90="f90"
47 F90_OPTS="+Ofast +DD64"
48 F77=$F90
49 F77_OPTS=$F90_OPTS
50 elif [ "$SYS" = 2 ] ; then
51 F90="ifc"
52 F90_OPTS="-O3 -ip -unroll -prefetch -scalar_rep -w90"
53 F77=$F90
54 F77_OPTS=$F90_OPTS
55 elif [ "$SYS" = 3 ] ; then
56 F90="ifort"
57 F90_OPTS="-O3 -ip -unroll -prefetch -scalar_rep -w90"
58 F77=$F90
59 F77_OPTS=$F90_OPTS
60 elif [ "$SYS" = 4 ] ; then
61 F90="f95"
62 F90_OPTS="-O4 -kind=byte -dusty -dcfuns"
63 F77=$F90
64 F77_OPTS=$F90_OPTS
65 elif [ "$SYS" = 5 ] ; then
66 F90="f90"
67 F90_OPTS="-O5 -fast"
68 F77=$F90
69 F77_OPTS=$F90_OPTS
70 elif [ "$SYS" = 6 ] ; then
71 F90="f90"
72 F90_OPTS="+Ofast +Oopenmp +DD64"
73 F77=$F90
74 F77_OPTS=$F90_OPTS
75 elif [ "$SYS" = 7 ] ; then
76 F90="xlf90"
77 F90_OPTS="-O4"
78 F77="xlf77"
79 F77_OPTS=$F90_OPTS
80 elif [ "$SYS" = 8 ] ; then
81 F90="g95"
82 F90_OPTS="-O3 -funroll-loops -ffast-math"
83 F77=$F90
84 F77_OPTS=$F90_OPTS
85 elif [ "$SYS" = 9 ] ; then
86 F90="pgf90"
87 F90_OPTS="-fast"
88 F77=$F90
89 F77_OPTS=$F90_OPTS
90 elif [ "$SYS" = 10 ] ; then
91 F90="frt"
92 F90_OPTS="-O4"
93 F77=$F90
94 F77_OPTS=$F90_OPTS
95 elif [ "$SYS" = 11 ] ; then
96 F90="f90"
97 F90_OPTS="-O4"
98 elif [ "$SYS" = 12 ] ; then
99 F90="xlf"
100 F90_OPTS="-O3 -qsuffix=f=f90 -qfree=f90"
101 F77=$F90
102 F77_OPTS="-O3"
103 elif [ "$SYS" = 13 ] ; then
104 F90="f90"
105 F90_OPTS="-mips4 -64 -O2"
106 F77=$F90
107 F77_OPTS=$F90_OPTS
108 elif [ "$SYS" = 14 ] ; then
109 F90="f90"
110 F90_OPTS="-fast -dalign"
111 F77=$F90
112 F77_OPTS=$F90_OPTS
113 elif [ "$SYS" = 15 ] ; then
114 F90="f90"
115 F90_OPTS="-O3"
116 F77=$F90
117 F77_OPTS=$F90_OPTS
118 elif [ "$SYS" = 16 ] ; then
119 F90="f90"
120 F90_OPTS="-O"
121 F77=$F90
122 F77_OPTS=$F90_OPTS
123 elif [ "$SYS" = 17 ] ; then
124 F90="f95"
125 F90_OPTS="-O4 -kind=byte -dusty -dcfuns"
126 F77=$F90
127 F77_OPTS=$F90_OPTS
128 elif [ "$SYS" = 18 ] ; then
129 F90="gfortran"
130 F90_OPTS="-O3 -funroll-loops -ffast-math"
131 F77=$F90
132 F77_OPTS=$F90_OPTS
133 else
134 GETSYS
138 GETSYS
140 # produce the make.inc file
141 echo "MAKE = $MAKE" > make.inc
142 echo "F90 = $F90" >> make.inc
143 echo "F90_OPTS = $F90_OPTS" >> make.inc
144 echo "F77 = $F77" >> make.inc
145 echo "F77_OPTS = $F77_OPTS" >> make.inc
146 echo "AR = $AR" >> make.inc
147 echo "LIB_SYS = $LIB_SYS" >> make.inc
148 echo "LIB_LPK = $LIB_LPK" >> make.inc
149 echo "LIB_FFT = $LIB_FFT" >> make.inc
151 echo
152 echo "You can now edit the compiler options in \"make.inc\" for optimal"
153 echo "performance on your system as well as enabling OpenMP parallelisation."
154 echo
155 echo "Then run \"make\" to compile code."
156 echo