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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
--- comp.orig 2012-12-05 05:49:41.000000000 +0900
+++ comp 2013-02-27 15:56:56.000000000 +0900
@@ -97,6 +97,8 @@
if ($TARGET == ibm-bg) set OK=true
if ($TARGET == linux32) set OK=true
if ($TARGET == linux64) set OK=true
+if ($TARGET == freebsd32) set OK=true
+if ($TARGET == freebsd64) set OK=true
if ($TARGET == mac32) set OK=true
if ($TARGET == mac64) set OK=true
if ($TARGET == necsx) set OK=true
@@ -149,6 +151,8 @@
if ($TARGET == ibm-bg) set BLAS3=true
if (($TARGET == linux32) && ($GMS_MATHLIB != none)) set BLAS3=true
if (($TARGET == linux64) && ($GMS_MATHLIB != none)) set BLAS3=true
+if (($TARGET == freebsd32) && ($GMS_MATHLIB != none)) set BLAS3=true
+if (($TARGET == freebsd64) && ($GMS_MATHLIB != none)) set BLAS3=true
if ($TARGET == mac32) set BLAS3=true
if ($TARGET == mac64) set BLAS3=true
if ($TARGET == sgi32) set BLAS3=true
@@ -579,6 +583,26 @@
endif
endif
#
+if ($TARGET == freebsd32) then
+ setenv MACHIN '*I32'
+ if ($MODULE == ddi) setenv MACHIN '*SOC'
+ if ($MODULE == iolib) setenv MACHIN '*UNX'
+ if ($MODULE == unport) setenv MACHIN '*L32'
+endif
+#
+if ($TARGET == freebsd64) then
+ setenv MACHIN '*I64'
+ if ($MODULE == ddi) setenv MACHIN '*SOC'
+ if ($MODULE == iolib) setenv MACHIN '*UNX'
+ if ($MODULE == unport) then
+ if ($GMS_FORTRAN == ifort) then
+ setenv MACHIN '*INT'
+ else
+ setenv MACHIN '*L64'
+ endif
+ endif
+endif
+
if ($TARGET == mac32) then
setenv MACHIN '*I32'
if ($MODULE == ddi) setenv MACHIN '*SOC'
@@ -1640,6 +1664,137 @@
endsw
# ... end of Linux on 32 bit processors.
endif
+if ($TARGET == freebsd32) then
+#
+# there are three supported 32 bit compilers: g77, gfortran, ifort
+# g77,
+# the gnu FORTRAN being included in older Linux distributions
+# lacks support for unit numbers over 99, or REAL*16
+# gfortran,
+# the gnu FORTRAN being included in newer Linux distributions
+# this allows unit numbers over 99, but not REAL*16
+# Intel's commercial ifort,
+# supports unit numbers above 99 and REAL*16 (runs all of GAMESS)
+
+ switch ($GMS_FORTRAN)
+#
+# The meaning of g77's flags are
+# -O0, -O1, -O2, -O3 are the optimization levels, -O means -O1
+# -Wno-globals -fno-globals together suppress argument type checking.
+# -fautomatic defeats use of static storage
+# -malign-double uses 64 bit data alignment
+# g77 does not support FORTRAN logical units above 99, or 128 bit math.
+#
+ case g77:
+ set OPT = '-O2'
+ if ($MODULE == ormas1) set OPT='-O2 -fno-move-all-movables' # RH9, g77 3.3
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+ if (($MODULE == qeigen) || ($MODULE == int2c)) then
+ mv -f $MODULE_F $MODULE.junk
+ sed -e "s/Q-/D-/g" \
+ -e "s/Q+00/D+00/g" \
+ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE_F
+ rm -f $MODULE.junk
+ endif
+ if (($MODULE == iolib) || ($MODULE == inputa) || \
+ ($MODULE == gamess) || ($MODULE == mp2ims)) then
+ mv -f $MODULE_F $MODULE.junk
+ sed -e "s/MXUNIT=299/MXUNIT=99/g" $MODULE.junk > $MODULE_F
+ rm -f $MODULE.junk
+ endif
+ set echo
+ g77 -c $OPT -malign-double -fautomatic \
+ -Wno-globals -fno-globals $MODULE_F
+ unset echo
+ breaksw
+#
+# gfortran was included with Fedora Core distributions starting around FC4.
+# This is a 32 bit version, i.e. not using -fdefault-integer-8!
+# Unlike g77, gfortran allows for unit numbers above 100.
+# Like g77, gfortran does not support quadruple precision.
+# -Ox optimization level is from the gcc back end, x can be 0,1,2,3
+# -std=legacy suppresses warnings about use of f77 constructs.
+#
+ case gfortran:
+ set OPT='-O2'
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+ if ($MODULE == pcmcv2) set OPT='-O1' # EFP+CPCM, ala Francois, v4.1.2
+ if ($GMS_GFORTRAN_VERNO == 4.6) then
+ if ($MODULE == cosmo) set OPT='-O0' # this issue seen in 4.6.x
+ if ($MODULE == tddgrd) set OPT='-O0' # this issue seen in 4.6.1
+ endif
+ if ($GMS_GFORTRAN_VERNO == 4.7) then
+ if ($MODULE == cosmo) set OPT='-O0'
+ if ($MODULE == dcscf) set OPT='-O0'
+ if ($MODULE == rohfcc) set OPT='-O0'
+ if ($MODULE == tddgrd) set OPT='-O0'
+ endif
+# as of 4.6 tested in late 2011, gfortran can do q.p.!
+ switch ($GMS_GFORTRAN_VERNO)
+ case 4.0:
+ case 4.1:
+ case 4.2:
+ case 4.3:
+ case 4.4:
+ case 4.5:
+ set extraflags=''
+ if (($MODULE == qeigen) || ($MODULE == int2c)) then
+ mv -f $MODULE_F $MODULE.junk
+ sed -e "s/Q-/D-/g" \
+ -e "s/Q+00/D+00/g" \
+ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE_F
+ rm -f $MODULE.junk
+ endif
+ breaksw
+ case 4.6:
+ case 4.7:
+ set extraflags='-fno-whole-file'
+ breaksw
+ default:
+ echo Unrecognized gfortran version
+ exit 4
+ breaksw
+ endsw
+#
+ set echo
+ %%FC%% -c $OPT -std=legacy $MODULE_F
+ unset echo
+ breaksw
+#
+# 3. Intel Fortran Compiler for Linux
+#
+# Note that this is more agressive (-O3 compared to -O2) than the
+# 64 bit compile below. If an ifort version gives you problems,
+# drop the optimization back to -O2.
+# Dmitri likes to use "-O3 -xN -ssp -unroll8 -ip -pad -opt_report",
+# but that may cause certain ifort versions to fail on some files.
+# See http://staff.aist.go.jp/d.g.fedorov/compgms.html for aggressive
+# optimizations in 32 bit mode, as a function of the ifort version.
+#
+ case ifort:
+ set OPT = '-O3'
+ if ($MODULE == delocl) set OPT='-O0' # from Cheol
+ if ($MODULE == prpamm) set OPT='-O0' # for exam13
+ if ($MODULE == zheev) set OPT='-O0'
+ set EXTRAOPT=" "
+ if ($GMS_IFORT_VERNO >= 8) set EXTRAOPT="$EXTRAOPT -assume byterecl"
+ if ($GMS_IFORT_VERNO >= 10) set EXTRAOPT="$EXTRAOPT -vec-report0"
+ if ($GMS_IFORT_VERNO < 12) set EXTRAOPT="$EXTRAOPT -w95 -cm"
+ if ($GMS_IFORT_VERNO >= 12) set EXTRAOPT="$EXTRAOPT -warn nousage -inline-level=0"
+ set echo
+ ifort -c -i4 $OPT -ftz -auto $EXTRAOPT $MODULE_F
+ unset echo
+ breaksw
+#
+ default:
+ echo "Please spell your Linux 32 bit FORTRAN compiler name correctly."
+ exit 4
+ breaksw
+ endsw
+# ... end of FreeBSD on 32 bit processors.
+endif
+
+
#
# ------ Linux on 64 bit chips ------
# This should work on any 64 bit Linux release, for any type of
@@ -1897,6 +2052,136 @@
endsw
# ... end of Linux on 64 bit processors.
endif
+
+if ($TARGET == freebsd64) then
+#
+# there are two supported 64 bit compilers: gfortran, ifort
+#
+ switch ($GMS_FORTRAN)
+
+ case gfortran:
+# -finit-real=<zero|inf|-inf|nan> could be interesting debug opt
+# -fno-automatic forces static storage of all local variables
+# -fno-whole-file suppresses argument's data type checking
+ set OPT='-O2'
+ if (".$GMS_DEBUG_FLAGS" != .) set OPT="$GMS_DEBUG_FLAGS"
+
+ if ($GMS_GFORTRAN_VERNO == 4.6) then
+ if ($MODULE == cosmo) set OPT='-O0' # this issue seen in 4.6.1
+ if ($MODULE == tddgrd) set OPT='-O0' # exam41, seen in 4.6.1
+ endif
+ if ($GMS_GFORTRAN_VERNO == 4.7) then
+ if ($MODULE == cosmo) set OPT='-O0'
+ if ($MODULE == dcscf) set OPT='-O0' # exam44, seen in 4.7 only
+ if ($MODULE == rohfcc) set OPT='-O0' # exam47, seen in 4.7 only
+ if ($MODULE == tddgrd) set OPT='-O0'
+ endif
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+
+ set EXTRAOPT=" "
+
+ if (($MODULE == cchem) || ($MODULE == ga)) then
+ mv $MODULE.f $MODULE.F
+ set MODULE_F=$MODULE.F
+ if ($GMS_LIBCCHEM == true) then
+ if ($MODULE == cchem) set EXTRAOPT="-DHAVE_CCHEM $extraflags"
+ if ($MODULE == ga) set EXTRAOPT="-I$GMS_PATH/libcchem/ga/include"
+ endif
+ endif
+#
+# as of 4.6 tested in late 2011, gfortran can do q.p.!
+ switch ($GMS_GFORTRAN_VERNO)
+ case 4.0:
+ case 4.1:
+ case 4.2:
+ case 4.3:
+ case 4.4:
+ case 4.5:
+ if (($MODULE == qeigen) || ($MODULE == int2c)) then
+ mv -f $MODULE_F $MODULE.junk
+ sed -e "s/Q-/D-/g" \
+ -e "s/Q+00/D+00/g" \
+ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE_F
+ rm -f $MODULE.junk
+ endif
+ breaksw
+ case 4.6:
+ case 4.7:
+ set EXTRAOPT="$EXTRAOPT -fno-whole-file"
+ breaksw
+ default:
+ echo Unrecognized gfortran version
+ exit 4
+ breaksw
+ endsw
+
+ set echo
+ %%FC%% -c -fdefault-integer-8 $OPT -std=legacy $EXTRAOPT $MODULE_F
+ unset echo
+ breaksw
+
+ case ifort:
+# -i4/-i8 set default integer length
+# -On can have n=1,2,3. Use of 3 caused problems with earlier
+# compilers, so it isn't being used here. Try it if you like.
+# stack storage for locals is governed by -auto versus -save.
+# -assume byterecl was introduced at ifort 8.0 (older versions will
+# print a message saying this flag is ignored). Newer versions
+# need this so that direct access file opens are measured in
+# bytes rather than the new default in v8.0, namely 4-byte units.
+# -vec-report0 suppresses loop vectorization messages (new in 10.0)
+# -w95 suppresses Hollerith initialization and other f90-like warnings
+# -cm means suppress comments about programming practices,
+# these two options spelled '-warn nousage' at version 12.
+# -WB means warn but don't fail on out-of-bounds array references
+# -ftz flushes underflow results to zero
+#
+ set OPT = '-O2'
+ if (".$GMS_DEBUG_FLAGS" != .) set OPT="$GMS_DEBUG_FLAGS"
+# alas, I'm so tired of hearing about so many versions failing to
+# diagonalize, that this time critical code is run w/o optimization.
+# Very many (all?) ifort versions have problems with eigen.src.
+ if ($MODULE == eigen) set OPT='-O0' # read note just above.
+ if ($MODULE == fmo) set OPT='-O1' # 12.0.4, exam37
+ if ($MODULE == guess) set OPT='-O0' # 10.0, exam39
+ if ($MODULE == locpol) set OPT='-O1' # 10.0, makefp/gmres
+ if ($MODULE == morokm) set OPT='-O0' # Jan Fredin
+ if ($MODULE == prpel) set OPT='-O1' # 10.0, exam13
+ if (($MODULE == rohfcc) && ($GMS_IFORT_VERNO == 12)) \
+ set OPT='-O0' # exam42+exam47 (op.sh.CC,IP-EOM)
+ if ($MODULE == tdxitr) set OPT='-O1' # 10.0, exam39
+ if ($MODULE == vscf) set OPT='-O0' # intensities for combinations
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
+
+ set EXTRAOPT=" "
+
+ if (($MODULE == cchem) || ($MODULE == ga)) then
+ mv $MODULE.f $MODULE.F
+ set MODULE_F=$MODULE.F
+ if ($GMS_LIBCCHEM == true) then
+ if ($MODULE == cchem) set EXTRAOPT="-DHAVE_CCHEM"
+ if ($MODULE == ga) set EXTRAOPT="-I$GMS_PATH/libcchem/ga/include"
+ endif
+ endif
+
+ if ($GMS_IFORT_VERNO >= 8) set EXTRAOPT="$EXTRAOPT -assume byterecl"
+ if ($GMS_IFORT_VERNO >= 10) set EXTRAOPT="$EXTRAOPT -vec-report0"
+ if ($GMS_IFORT_VERNO < 12) set EXTRAOPT="$EXTRAOPT -w95 -cm"
+ if ($GMS_IFORT_VERNO >= 12) set EXTRAOPT="$EXTRAOPT -warn nousage -inline-level=0"
+ set echo
+ ifort -c -i8 $OPT -ftz -auto $EXTRAOPT $MODULE_F
+ unset echo
+ breaksw
+#
+ default:
+ echo "Please spell your FreeBSD 64 bit FORTRAN compiler name correctly."
+ exit 4
+ breaksw
+ endsw
+# ... end of FreeBSD on 64 bit processors.
+endif
+
+
#
# Apple Macintosh system using OS X
# jargon: 10.0=cheetah, 10.1=puma, 10.2=jaguar, 10.3=panther,
|