-
Notifications
You must be signed in to change notification settings - Fork 1
/
comp
executable file
·2633 lines (2611 loc) · 97.7 KB
/
comp
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/csh
#
# 2 Aug 2013 - script to compile one GAMESS source file
# Invoke this script by './comp MODULE >& MODULE.log &'.
#
# This script no longer requires customization, as it starts off by
# reading information about the compilation from a configuration file.
#
if (-e install.info) then
source install.info
else if (-e ../install.info) then
source ../install.info
else
echo "Please run 'config' first, to set up GAMESS compiling information"
exit 4
endif
#
# the configuration file read just above provides the next two variables,
# and possibly several other GMS_XXX values that may be used below.
#
set TARGET=$GMS_TARGET
# allow for "dry run" that doesn't actually do anything
#
if ($?GMS_COMP_DRYRUN) then
echo $0 $argv
exit 0
endif
#
# allow for extra debugging flags
#
if ($?GMS_DEBUG_FLAGS == 0) then
set GMS_DEBUG_FLAGS=''
endif
#
# make sure any exotic variable touched below is not an error
#
if (!($?GMS_BG_MODEL)) set GMS_BG_MODEL=' '
#
# ---- and now the script begins...
#
unset echo
set MODULE=$1
set ACTONLY=$2 # this argument is almost always omitted
if (null$MODULE == null) then
echo No compile module name given...
exit
endif
#
# in case a module was in free format style
switch ($MODULE)
case xxx:
set MODULE_F=$MODULE.f90
breaksw
default:
set MODULE_F=$MODULE.f
breaksw
endsw
set MODULE_OBJ=$MODULE.o
#
if ( $?GMS_DO_NOT_REMOVE == 0 ) set GMS_DO_NOT_REMOVE=0
#
# AG: If a path given rather than a module name, user wants to compile
# that particular file with flags appropriate for the $TARGET,
# but without activation or even copying, and surely without removing!
# (this is probably not an active option)
set MODULE_DIR = $1:h
if ( $MODULE_DIR != $MODULE ) then
if ( $?GMS_OTHER_OBJDIR == 0 ) set GMS_OTHER_OBJDIR = $MODULE_DIR/
set GMS_OTHER_SRCDIR = $MODULE_DIR/
set GMS_DO_NOT_REMOVE = 1
set MODULE_F = $MODULE
# Guess the object file name (to test later whether it will be generated)
set MODULE_OBJ = `cd $GMS_OTHER_OBJDIR && pwd`/"$MODULE:t:r".o
endif
# AG: user may request to compile into a particular dir
if ( $?GMS_OTHER_OBJDIR ) then
chdir $GMS_OTHER_OBJDIR
else
chdir $GMS_BUILD_DIR/object
endif
#
echo ======================== $MODULE ==============================
date
#
# Let's be sure they typed the intended target correctly
#
# This also serves as a full list of compiler clauses allowed in
# this script, some of which are hidden by the gms-config. For
# example, there are a number of ancient Cray products below,
# and the NEC and Fujitsu products probably aren't well tested.
#
set OK=false
if ($TARGET == axp64) set OK=true
if ($TARGET == cray-pvp) set OK=true
if ($TARGET == cray-t3e) set OK=true
if ($TARGET == cray-x1) set OK=true
if ($TARGET == cray-xd1) set OK=true
if ($TARGET == cray-xt) set OK=true
if ($TARGET == fuji-pp32) set OK=true
if ($TARGET == fuji-pp64) set OK=true
if ($TARGET == hpux32) set OK=true
if ($TARGET == hpux64) set OK=true
if ($TARGET == ibm32) set OK=true
if ($TARGET == ibm64) set OK=true
if ($TARGET == ibm64-sp) set OK=true
if ($TARGET == ibm-bg) set OK=true
if ($TARGET == linux32) set OK=true
if ($TARGET == linux64) set OK=true
if ($TARGET == mac32) set OK=true
if ($TARGET == mac64) set OK=true
if ($TARGET == necsx) set OK=true
if ($TARGET == sgi32) set OK=true
if ($TARGET == sgi64) set OK=true
if ($TARGET == sun32) set OK=true
if ($TARGET == sun64) set OK=true
if ($TARGET == win32) set OK=true
if ($TARGET == win64) set OK=true
if ($TARGET == winazure) set OK=true
if ($OK == false) then
echo The comp script does not select a correct TARGET machine type.
echo What you typed when editing this script was $TARGET
exit 4
endif
#
# ----- Is this a vector machine? -----
#
set VECTORIZE=false
if ($TARGET == cray-pvp) set VECTORIZE=true
if ($TARGET == cray-x1) set VECTORIZE=true
if ($TARGET == necsx) set VECTORIZE=true
#
# ----- Are level 3 BLAS in a system library? -----
# If so, some matrix multiplies in MTHLIB.SRC can use DGEMM calls
# If not, print a warning to try to get people to find a BLAS library.
#
# N.B. Machines that use vector.src accomplish this business in a
# different manner, so ignore this part.
#
set BLAS3=false
if ($MODULE == mthlib) then
#
if (($TARGET == axp64) && \
((-e /usr/lib/libdxml.a)||(-e /usr/lib/libcxml.a))) set BLAS3=true
if ($TARGET == cray-t3e) set BLAS3=true
if ($TARGET == cray-x1) set BLAS3=true
if ($TARGET == cray-xt) set BLAS3=true
if ($TARGET == cray-xd1) then
if (-e $ACML_DIR) set BLAS3=true
if (-e $PGI/linux86-64/$PGI_VERS_STR/lib/libblas.a) set BLAS3=true
endif
if ($TARGET == fuji-pp32) set BLAS3=true
if ($TARGET == fuji-pp64) set BLAS3=true
if ($TARGET == hpux32) set BLAS3=true
if ($TARGET == hpux64) set BLAS3=true
if ($TARGET == ibm32) set BLAS3=true
if ($TARGET == ibm64) set BLAS3=true
if ($TARGET == ibm64-sp) set BLAS3=true
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 == mac32) set BLAS3=true
if ($TARGET == mac64) set BLAS3=true
if ($TARGET == sgi32) set BLAS3=true
if ($TARGET == sgi64) set BLAS3=true
if (($TARGET == sun32) && (-e /opt/SUNWspro/lib/libsunperf.so)) set BLAS3=true
if (($TARGET == sun64) && (-e /opt/SUNWspro/lib/libsunperf.so)) set BLAS3=true
if ($TARGET == win32) then
switch ($GMS_FORTRAN)
case pgfortran:
if ($GMS_MATHLIB == blas ) then
if (-e $PGI\\win32\\13.4\\lib\\libblas.lib) set BLAS3=true
endif
if ($GMS_MATHLIB == acml ) then
if (-e $PGI\\win32\\13.4\\lib\\libacml.lib) set BLAS3=true
endif
breaksw
case ifort:
if ($GMS_MATHLIB == mkl) then
set BLAS3=true
endif
breaksw
endsw
endif
if (($TARGET == win64) || ($TARGET == winazure)) then
switch ($GMS_FORTRAN)
case pgfortran:
if ($GMS_MATHLIB == blas ) then
if (-e $PGI\\win64\\13.4\\lib\\libblas.lib) set BLAS3=true
endif
if ($GMS_MATHLIB == acml ) then
if (-e $PGI\\win64\\13.4\\lib\\libacml.lib) set BLAS3=true
endif
breaksw
case ifort:
if ($GMS_MATHLIB == mkl) then
set BLAS3=true
echo "Using Intel's blas library for BLAS3"
endif
breaksw
endsw
endif
#
if ($BLAS3 == true) then
echo Compiling matrix multiply routines to use a system BLAS library...
else
echo "--------------------------------------------------------------"
echo ' Warning\! Warning\! Warning\! Warning\!'
echo "No mathematical library containing the BLAS has been detected."
echo "Use of a DGEMM from a good library will speed up computations"
echo "at the MP2, CCSD, or similar correlated levels, perhaps a lot."
echo "In the meantime, mthlib.src and all other calls to DGEMM will"
echo "rely on the slower blas.src provided with GAMESS."
echo "--------------------------------------------------------------"
endif
endif
#
# Normally we are sitting above the source code and objects,
# and want to make sure they go in their normal directory.
#
# N.B. A few places below prepare temporary copies of the
# code being compiled in the current directory level (.),
# and these are always deleted at the end of this script.
# These places are vector, valence bond, and sed hacking.
#
set SRCDIR=$GMS_PATH/source
set OBJDIR=$GMS_BUILD_DIR/object
# AG: if we want the other object directory, we must point to it.
if ( $?GMS_OTHER_OBJDIR ) then
set OBJDIR = $GMS_OTHER_OBJDIR
endif
#
# a few source files are kept in non-standard places, defined here
#
if ($MODULE == blaswrap) set SRCDIR=$GMS_PATH/misc
if ($MODULE == serial) set SRCDIR=$GMS_PATH/misc
if ($MODULE == vbdum) set SRCDIR=$GMS_PATH/misc
if ($MODULE == ddi) set SRCDIR=$GMS_PATH/ddi/olddi/v1
if ($MODULE == ddishm) set SRCDIR=$GMS_PATH/ddi/olddi/shmem
if ($MODULE == ddit3e) set SRCDIR=$GMS_PATH/ddi/olddi/shmem
if ($MODULE == ddio3k) set SRCDIR=$GMS_PATH/ddi/olddi/shmem
if ($MODULE == ddixt3) set SRCDIR=$GMS_PATH/ddi/olddi/shmem
# AG: if we want the other source directory, we must point to it.
if ($?GMS_OTHER_SRCDIR) then
set SRCDIR=$GMS_OTHER_SRCDIR
endif
#
# ----- delete scalar code before compiling on vector systems -----
# UNIX's 'ld' loader is incapable of loading two copies of the
# object code for a routine, and simply using the first one.
# So, if we are using VECTOR.SRC on this machine, we must split
# up some of the modules, delete the scalar code for the routines
# which are found in VECTOR.SRC, and then recombine the rest of
# the code in that module. Ugh!
# Note that some of Cray's fsplit's are no longer able to work
# with any extension except .f.
#
if ($VECTORIZE == true) then
rm -f *.f
if ($TARGET == cray-x1) alias fsplit ftnsplit
switch ($MODULE)
case int2a:
echo Deleting scalar code forms, genral
cp source/int2a.src xxxxxx.f
fsplit xxxxxx.f
rm -f xxxxxx.f
if (-e forms.f) rm -f forms.f genral.f
if (-e FORMS.f) rm -f FORMS.f GENRAL.f
cat *.f > int2a.src
rm -f *.f
set SRCDIR=.
breaksw
case grd2c:
echo Deleting scalar code dspdfv, jdxyzv, jkgnmv, jkxyzv
cp source/grd2c.src xxxxxx.f
fsplit xxxxxx.f
rm -f xxxxxx.f
if (-e dspdfv.f) rm -f dspdfv.f jdxyzv.f jkgnmv.f jkxyzv.f
if (-e DSPDFV.f) rm -f DSPDFV.f JDXYZV.f JKGNMV.f JKXYZV.f
cat *.f > grd2c.src
rm -f *.f
set SRCDIR=.
breaksw
case hss2b:
echo Deleting scalar code jddspd.f
cp source/hss2b.src xxxxxx.f
fsplit xxxxxx.f
rm -f xxxxxx.f
if (-e jddspd.f) rm -f jddspd.f
if (-e JDDSPD.f) rm -f JDDSPD.f
cat *.f > hss2b.src
rm -f *.f
set SRCDIR=.
breaksw
case eigen:
echo Deleting scalar code gldiag.f
cp source/eigen.src xxxxxx.f
fsplit xxxxxx.f
rm -f xxxxxx.f
if (-e gldiag.f) rm -f gldiag.f
if (-e GLDIAG.f) rm -f GLDIAG.f
cat *.f > eigen.src
rm -f *.f
set SRCDIR=.
breaksw
case mthlib:
echo Deleting scalar code mtarbr, tfsqb, tftri.
cp source/mthlib.src xxxxxx.f
fsplit xxxxxx.f
rm -f xxxxxx.f
if (-e mtarbr.f) rm -f mtarbr.f tfsqb.f tftri.f
if (-e MTARBR.f) rm -f MTARBR.f TFSQB.f TFTRI.f
cat *.f > mthlib.src
rm -f *.f
set SRCDIR=.
breaksw
case scflib:
echo Deleting scalar code dirfck.
cp source/scflib.src xxxxxx.f
fsplit xxxxxx.f
rm -f xxxxxx.f
if (-e dirfck.f) rm -f dirfck.f
if (-e DIRFCK.f) rm -f DIRFCK.f
cat *.f > scflib.src
rm -f *.f
set SRCDIR=.
breaksw
default:
breaksw
endsw
endif
#
# optional SIMOMM method using Tinker MM program
# if you do select this option, also set the number of MM atoms in
# the following line to match your choice in Tinker's sizes.i file
#
set TINKER=false
set NumTinkAtms=12000
#
# don't edit anything about Tinker below this point...
set TINKCODE=no
if ($MODULE == Libtad) set TINKCODE=yes
if ($MODULE == Libteac) set TINKCODE=yes
if ($MODULE == Libtedl) set TINKCODE=yes
if ($MODULE == Libtemo) set TINKCODE=yes
if ($MODULE == Libterx) set TINKCODE=yes
if ($MODULE == Libtfi) set TINKCODE=yes
if ($MODULE == Libtjo) set TINKCODE=yes
if ($MODULE == Libtpr) set TINKCODE=yes
if ($MODULE == Libtsx) set TINKCODE=yes
if ($MODULE == Tdrive) set TINKCODE=yes
if ($MODULE == Tinkin) set TINKCODE=yes
if ($MODULE == Toys) set TINKCODE=yes
# We must compile directly out of the Tinker directory,
# so that its INCLUDE statements will work.
# Note that Tinker must also skip the code deletion at end!
if ($TINKCODE == yes) then
chdir $GMS_PATH/tinker
set SRCDIR=$GMS_PATH/tinker
goto cmp
endif
#
# Valence Bond method using VB2000
# Do not edit here
# == === ==== ====
# If VB2000 is required, edit compall and lked, but not this file!
set VB2000=false
if ($MODULE == vb2000) set VB2000=true
if ($MODULE == vb2gms) set VB2000=true
# compiling in the top level directory means code is erased later
if ($VB2000 == true ) then
set VBPATH=$GMS_PATH/vb2000/SRC
echo Copying $MODULE.src from VB2000 directory named $VBPATH
if ($MODULE == vb2000) then
# Some messy sed stuff to set up.
sed "s/^CTMAP/ /g" $VBPATH/vb2000.src | \
sed "s/^CGMS/ /g" > $SRCDIR/vb2000.src
endif
if ($MODULE == vb2gms) cp $VBPATH/vb2gms.src $SRCDIR/vb2gms.src
endif
#
# Nuclear Electronic Orbital (NEO) method plugin
# Do not edit here
# == === ==== ====
# If NEO is required, edit compall and lked, but not this file!
#
set NEOCMP=false
if ($MODULE =~ neo*) set NEOCMP=true
if ($MODULE == neostb) set NEOCMP=false
if ($NEOCMP == true && $ACTONLY != true) set SRCDIR=$GMS_PATH/qmnuc/neo
#
# ----- Does this module need to be activated? -----
#
# Machines where "DOUBLE PRECISION" translates to more than a 64
# bit floating point quantity must be passed into the activation
# to ensure the source is made single precision.
#
if ($TARGET == cray-pvp) goto act
if ($TARGET == cray-t3e) goto act
if ($TARGET == cray-x1) goto act
if ($TARGET == necsx) goto act
#
# Machines needing the 64->32 bit BLAS wrappers must activate everything
# This depends on whether or not the BLAS library is OK with 64 bit
# integers in its argument, or not (in which case a sed hack to use
# a 64 to 32 bit wrapper file is needed, by always branching here).
#
if ($TARGET == fuji-pp64) goto act
if ($TARGET == ibm64) goto act
if ($TARGET == ibm-bg) goto act
if ($TARGET == ibm64-sp) goto act
if ($TARGET == mac64) goto act
if ($TARGET == sgi64) goto act
if ($TARGET == sun64) goto act
#
# Any module with machine dependent code must be activated...
#
if ($MODULE == aldeci) goto act
if ($MODULE == ccsdt) goto act
if ($MODULE == cisgrd) goto act
if ($MODULE == cphf) goto act
if ($MODULE == cpmchf) goto act
if ($MODULE == cprohf) goto act
if ($MODULE == dcint2) goto act
if ($MODULE == dcmp2) goto act
if ($MODULE == dctran) goto act
if ($MODULE == ddi) goto act
if ($MODULE == ddit3e) goto act
if ($MODULE == dft) goto act
if ($MODULE == dftint) goto act
if ($MODULE == efpaul) goto act
if ($MODULE == eftei) goto act
if ($MODULE == elgscf) goto act
if ($MODULE == fmogrd) goto act
if ($MODULE == gmcpt) goto act
if ($MODULE == grd2a) goto act
if ($MODULE == gugdga) goto act
if ($MODULE == gugdgb) goto act
if ($MODULE == gugdm2) goto act
if ($MODULE == gugem) goto act
if ($MODULE == gugsrt) goto act
if ($MODULE == gvb) goto act
if ($MODULE == gvvpt2) goto act
if ($MODULE == hss2a) goto act
if ($MODULE == inputa) goto act
if ($MODULE == inputb) goto act
if ($MODULE == int2a) goto act
if ($MODULE == iolib) goto act
if ($MODULE == ivocas) goto act
if ($MODULE == lagran) goto act
if ($MODULE == local) goto act
if ($MODULE == locpol) goto act
if ($MODULE == mccas) goto act
if ($MODULE == mcqdpt) goto act
if ($MODULE == mcqud) goto act
if ($MODULE == mcscf) goto act
if ($MODULE == mctwo) goto act
if ($MODULE == morokm) goto act
if ($MODULE == mp2) goto act
if ($MODULE == mp2grd) goto act
if ($MODULE =~ neo*) goto act
if ($MODULE == nmr) goto act
if ($MODULE == ordint) goto act
if ($MODULE == qmmm) goto act
if ($MODULE == rhfuhf) goto act
if ($MODULE == rohfcc) goto act
if ($MODULE == sfdft) goto act
if ($MODULE == tddint) goto act
if ($MODULE == tdhf) goto act
if ($MODULE == trans) goto act
if ($MODULE == trfdm2) goto act
if ($MODULE == unport) goto act
if ($MODULE == utddft) goto act
if ($MODULE == vb2gms) goto act
if ($MODULE == vector) goto act
if ($MODULE == xmvb) goto act
#
# We may need to do a hack below on the matrix multiply routines
#
if (($BLAS3 == true) && ($MODULE == mthlib)) goto act
#
# AG: If module is not to be removed, it is not to be activated or
# copied either. It avoids irritating situation when errors are
# reported NOT in the file where they are to be fixed!
# (this probably is not an active option)
if ( $GMS_DO_NOT_REMOVE ) goto cmp
#
# All other modules are straight FORTRAN, just copy them.
#
echo Copying source code, $MODULE.src does not require activation.
cp $SRCDIR/$MODULE.src $MODULE_F
goto cmp
#
# ----- Choose which version is to be activated -----
# The setting for 'ddi' applies to the possible use of the first version
# of the Distributed Data Interface, and probably should be sockets only.
# Most machines use the 2nd version of DDI, implemented entirely in C,
# and compiled by the separate 'compddi' script.
# In contrast, machines using the SHMEM library will compile a
# confusing mixture of old SHMEM support files (see their readme).
#
act:
#
if ($TARGET == axp64) then
setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*DEC'
endif
# the old Cray vector systems would use TCP/IP sockets in DDI
if ($TARGET == cray-pvp) then
setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*CRY'
if ($MODULE == vector) setenv MACHIN '*CRY'
endif
# the CRAY T3E has a special SHMEM implementation of DDI
if ($TARGET == cray-t3e) then
setenv MACHIN '*I64'
if ($MODULE == ddit3e) setenv MACHIN '*T3E'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*T3E'
endif
# the CRAY X1 has a special SHMEM implementation of DDI
if ($TARGET == cray-x1) then
setenv MACHIN '*I64'
if ($MODULE == ddit3e) setenv MACHIN '*CX1'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*CX1'
if ($MODULE == vector) setenv MACHIN '*CRY'
endif
# the CRAY XD1 uses TCP/IP sockets, until GPSHMEM is working
if ($TARGET == cray-xd1) then
setenv MACHIN '*I64'
if ($MODULE == ddit3e) setenv MACHIN '*XD1'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*L64'
endif
# the CRAY XT is using pure MPI, from the standard DDI version
if ($TARGET == cray-xt) then
setenv MACHIN '*I64'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*L64'
endif
if (($TARGET == fuji-pp32) || ($TARGET == fuji-pp64)) then
setenv MACHIN '*I32'
if ($TARGET == fuji-pp64) setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*SUN'
endif
if (($TARGET == hpux32) || ($TARGET == hpux64)) then
setenv MACHIN '*I32'
if ($TARGET == hpux64) setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*HP '
endif
if (($TARGET == ibm32) || ($TARGET == ibm64) || ($TARGET == ibm64-sp)) then
setenv MACHIN '*I64'
if ($TARGET == ibm32) setenv MACHIN '*I32'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*AIX'
endif
#
if ($TARGET == ibm-bg) then
setenv MACHIN '*I32'
if ($MODULE == ddi) setenv MACHIN '*MPI'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*AIX'
endif
#
if ($TARGET == linux32) 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 == linux64) 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'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*L32'
endif
if ($TARGET == mac64) then
setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*L64'
endif
#
if ($TARGET == necsx) then
setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*MPI'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*NEC'
if ($MODULE == vector) setenv MACHIN '*NEC'
endif
#
if (($TARGET == sgi32) || ($TARGET == sgi64)) then
setenv MACHIN '*I32'
if ($TARGET == sgi64) setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*SGI'
endif
#
if (($TARGET == sun32) || ($TARGET == sun64)) then
setenv MACHIN '*I32'
if ($TARGET == sun64) setenv MACHIN '*I64'
if ($MODULE == ddi) setenv MACHIN '*SOC'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*SUN'
endif
#
if ($TARGET == win32) then
setenv MACHIN '*I32'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) setenv MACHIN '*W32'
endif
#
if (($TARGET == win64) || ($TARGET == winazure)) then
setenv MACHIN '*I64'
if ($MODULE == iolib) setenv MACHIN '*UNX'
if ($MODULE == unport) then
if ($GMS_FORTRAN == ifort) then
setenv MACHIN '*I64'
else
setenv MACHIN '*W64'
endif
endif
endif
#
# Check to see if the configuration step has built actvte.x
#
if (!(-x $GMS_BUILD_DIR/tools/actvte.x)) then
echo "Something went wrong with 'config', so that the source code"
echo "activation program was not correctly compiled. Please repeat"
echo "the 'config' step, so that tools/actvte.x is created."
exit 8
endif
#
# ----- Activate the source code to produce FORTRAN -----
# Some big machines will probably refuse to allow you to run a compiled
# program on a head node. The three mentioned below do not need the
# extra support included in the activation program (e.g. DDOT to SDOT
# conversion, or exponent D to E changing), so 'sed' suffices.
#
echo "Activating $SRCDIR/$MODULE.src to create $MODULE_F for target $TARGET..."
#
setenv SRCIN $SRCDIR/$MODULE.src
setenv CODEOUT $MODULE_F
if (-e $MODULE_F) rm -f $MODULE_F
#
if (($TARGET == win32) || ($TARGET == win64) || ($TARGET == winazure)) then
setenv SRCIN c:/cygwin/$SRCDIR/$MODULE.src
endif
#
switch ($MODULE_F:e)
case f:
switch ($TARGET)
case ibm64-sp:
case ibm-bg:
case cray-xt:
sed -e "s/^$MACHIN/ /" $SRCIN > $CODEOUT
breaksw
default:
$GMS_BUILD_DIR/tools/actvte.x > /dev/null
breaksw
endsw
breaksw
case f90:
cp $SRCIN $CODEOUT
breaksw
endsw
#
unsetenv SRCIN
unsetenv CODEOUT
#
# --------------- special machine "sed hacks" --------------------
# Not everything can be done with ACTVTE, so we use "sed" (ugh!).
#
# The "record length" hack.
# Direct access record length is measured in bytes on most Unix,
# but some compilers insist in measuring 4-byte words. This changes
# only one line in RAOPEN and one line in OPENDA in IOLIB.SRC.
# SGI's f90 should not execute the following, but SGI's f77 must.
#
if ($MODULE == iolib) then
set reclhack=false
if ($TARGET == axp64) set reclhack=true
if (($TARGET == sgi31) || ($TARGET == sgi64)) then
if ($GMS_FORTRAN == f77) set reclhack=true
endif
#
if ($reclhack == true) then
mv -f iolib.f iolib.junk
sed -e "s/ \* RECL=8\*IRECLN/ * RECL=2*IRECLN/" \
iolib.junk > iolib.f
rm -f iolib.junk
endif
endif
#
# The "I'm no longer a 32 bit company" hack.
# For 64 bit machines which also have a traditional 32 bit product
# line, the source code typically assumes 32 bits. This change lets
# the source code know it is going to be running as a 64 bit machine.
#
if (($MODULE == unport) && \
(($TARGET == fuji-pp64) || \
($TARGET == hpux64) || \
($TARGET == ibm64) || \
($TARGET == ibm64-sp) || \
($TARGET == sgi64) || \
($TARGET == sun64))) then
mv -f unport.f unport.junk
sed -e "s/ NWDVAR = 2/ NWDVAR = 1/" unport.junk > unport.f
rm -f unport.junk
endif
#
# The "old matrix multiply can be BLAS" hack.
# If "BLAS3" is set, indicating a math library is found, change a
# few of the oldest matrix multiply routines to call BLAS routines.
#
if (($MODULE == mthlib) && ($BLAS3 == true)) then
mv -f mthlib.f mthlib.junk
sed -e "s/\*BL3/ /" mthlib.junk > mthlib.f
rm -f mthlib.junk
endif
#
# The "64 to 32 bit math library" hack.
# This one is necessary if compiler flags below request the use of
# 64 bit integers in GAMESS -AND- if the vendor's BLAS library
# insists any integer arguments passed to it be 32 bit quantities.
# There is a special wrapper file gamess/misc/blaswrap.src that deals
# with this problem, if we change the source to call the wrappers.
#
set mathhack=false
if ($TARGET == fuji-pp64) set mathhack=true
if ($TARGET == ibm64) set mathhack=true
if ($TARGET == ibm64-sp) set mathhack=true
if ($TARGET == mac64) then
switch ($GMS_MAC_OSX_VERNO)
case 10.4:
case 10.5:
set mathhack=true
breaksw
case 10.7:
case 10.6:
default:
set mathhack=false
breaksw
endsw
endif
if ($TARGET == sgi64) set mathhack=true
if ($TARGET == sun64) set mathhack=true
#
if ($mathhack == true) then
set par="("
switch ($MODULE)
#
# blaswrap.src carefully copies 64 bit ints to 32 bit ints,
# and then calls the real BLAS routines, so it
# must not be altered here.
case blaswrap:
breaksw
# blas.src has to learn it will be receiving 32 bit integer args,
# in case the system math library is for some reason not
# installed, and we unfortunately end up using blas.src!
# Note that it is OK to also change its local integers
# when we change the IMPLICIT, but we must ensure any
# integer function present returns 64 bits to GAMESS.
case blas:
sed -e "s/INTEGER FUNCTION/INTEGER*8 FUNCTION/g" \
-e "s/INTEGER(I-N)/INTEGER*4(I-N)/g" \
blas.f > blas.munged
mv -f blas.munged blas.f
breaksw
# A few files have annoying type and/or EXTERNAL declarations,
# which lack parentheses, causing woes if we don't omit it.
# These are then allowed to fall into the default sed change,
# w/o an open parenthesis to help ensure string uniqueness.
case dgeev:
case dgesvd:
case tdx:
case tdxitr:
case tdxni:
case zheev:
set par=""
# Most files will attempt to change a string including an
# open parenthesis (set above), such as DDOT(... to XDOT(...
# This is not a perfect strategy, imagine an unrelated
# routine named MDSCAL, which will be caught up in this!
default:
sed -e "s/DASUM$par/XASUM$par/g" -e "s/dasum$par/XASUM$par/g" \
-e "s/DAXPY$par/XAXPY$par/g" -e "s/daxpy$par/XAXPY$par/g" \
-e "s/DCOPY$par/XCOPY$par/g" -e "s/dcopy$par/XCOPY$par/g" \
-e "s/DDOT$par/XDOT$par/g" -e "s/ddot$par/XDOT$par/g" \
-e "s/DNRM2$par/XNRM2$par/g" -e "s/dnrm2$par/XNRM2$par/g" \
-e "s/DROT$par/XROT$par/g" -e "s/drot$par/XROT$par/g" \
-e "s/DROTG$par/XROTG$par/g" -e "s/drotg$par/XROTG$par/g" \
-e "s/DSCAL$par/XSCAL$par/g" -e "s/dscal$par/XSCAL$par/g" \
-e "s/DSWAP$par/XSWAP$par/g" -e "s/dswap$par/XSWAP$par/g" \
-e "s/IDAMAX$par/IXAMAX$par/g" -e "s/idamax$par/IXAMAX$par/g" \
-e "s/DGER$par/XGER$par/g" -e "s/dger$par/XGER$par/g" \
-e "s/DTRMV$par/XTRMV$par/g" -e "s/dtrmv$par/XTRMV$par/g" \
-e "s/DGEMV$par/XGEMV$par/g" -e "s/dgemv$par/XGEMV$par/g" \
-e "s/DSPMV$par/XSPMV$par/g" -e "s/dspmv$par/XSPMV$par/g" \
-e "s/DSPR2$par/XSPR2$par/g" -e "s/dspr2$par/XSPR2$par/g" \
-e "s/DGEMM$par/XGEMM$par/g" -e "s/dgemm$par/XGEMM$par/g" \
-e "s/DTRMM$par/XTRMM$par/g" -e "s/dtrmm$par/XTRMM$par/g" \
-e "s/DTRSM$par/XTRSM$par/g" -e "s/dtrsm$par/XTRSM$par/g" \
-e "s/DSYRK$par/XSYRK$par/g" -e "s/dsyrk$par/XSYRK$par/g" \
$MODULE_F > $MODULE.munged
mv -f $MODULE.munged $MODULE_F
breaksw
endsw
endif
#
# IBM Blue Gene compiles w/o underscores on external names,
# then mixes up one name in our code with a 'wrap_pread' routine.
#
if ($TARGET == ibm-bg) then
sed -e "s/PREAD(/GMS_PREAD(/g" -e "s/pread(/GMS_PREAD(/g" \
$MODULE_F > $MODULE.munged
mv -f $MODULE.munged $MODULE_F
endif
#
# systems with very many processors should change default load-balancing
# from Dynamic-LB (i.e. BLANK ends up meaning DLB) to Static-LB.
#
if (($TARGET == ibm-bg) && ($MODULE == inputa)) then
sed -e "s/ BALTYP = BLANK/ BALTYP = RSLB/" \
$MODULE_F > $MODULE.munged
mv -f $MODULE.munged $MODULE_F
endif
#
# IBM Blue Gene can't run a command -after- GAMESS execution
# to rescue the various log files produced by GDDI runs, so
# we should at least make sure that the master group's log
# file is kept in 'standard output' by deleting its OPEN.
#
if (($TARGET == ibm-bg) && ($MODULE == gamess)) then
sed -e "s/ CALL SEQOPN(IW,'OUTPUT','NEW',.FALSE.,'FORMATTED')/C/" \
$MODULE_F > $MODULE.munged
mv -f $MODULE.munged $MODULE_F
endif
#
# The "file-get-environment" hack.
# This works around inadequate MPI support for environment values.
# Sometimes MPI implementations will need this, if mpirun does not pass
# the environment on to the processes it creates.
# If you want to use it, just hand-edit the state of 'FGEhack' below!
#
# IBM Blue Gene/L (but not BG/P) needs this due to a very very small
# total environment space.
#
# The change consists of changing iolib's getenv call into file_getenv,
# and activating the subroutine named file_getenv in unport. If you
# have decided to select this, recompile only iolib.src and unport.src.
#
if (($TARGET == ibm-bg) && ($GMS_BG_MODEL == P)) goto skip_fge
if ($TARGET == cray-xt) goto skip_fge
#
set FGEhack=false
if (($TARGET == ibm-bg) && ($GMS_BG_MODEL == L)) set FGEhack=true
#
if (($GMS_DDI_COMM == mpi) || ($GMS_DDI_COMM == mixed)) then
switch ($GMS_MPI_LIB)
case impi:
case mvapich2:
case myrinet:
case openmpi:
case mpt:
set FGEhack=false
breaksw
case mpich2:
set FGEhack=false
if (($TARGET == win32) || ($TARGET == win64) || ($TARGET == winazure)) set FGEhack=true
breaksw
case msmpi:
set FGEhack=true
breaksw
default:
echo "unknown MPI software requested"
exit 4
breaksw
endsw
endif
#
if ($FGEhack == true) then
if($MODULE == iolib) then
sed -e "s/CALL GETENV/CALL FILE_GETENV/g" iolib.f > iolib.munged
mv -f iolib.munged iolib.f
endif
if($MODULE == unport) then
sed -e "s/\*FGE/ /" unport.f > unport.munged
mv -f unport.munged unport.f
endif
endif
#
skip_fge:
#
# The following hack makes an Apple version print a different banner.
# The Apple version is source code identical to Linux, but we print
# something to keep MAC from looking like PC. Those TV ads demand it!
#
if (($TARGET == mac32) || ($TARGET == mac64)) then
if ($MODULE == unport) then
mv -f unport.f unport.junk
sed -e "s/BIT LINUX VERSION/BIT APPLE VERSION/" \
unport.junk > unport.f
rm -f unport.junk
endif
endif
#
# HP has a FORTRAN callable delay, we just have to change to HP's name
#
if (($TARGET == hpux32) || ($TARGET == hpux64)) then
if ($MODULE == unport) then
mv -f unport.f unport.junk
sed -e "s/NAPTIME(IDELAY)/SLEEP(IDELAY)/" \
unport.junk > unport.f
rm -f unport.junk
endif
endif
#
# the Tinker atom count hack
# this resets dimensions in /atmtyp/ and /atmst/ used to interface
# between GAMESS and Tinker. These are shipped for only ten atoms,
# so as to have no memory overhead when Tinker is not used. Note
# that the value to be used (e.g. 12,000 atoms) must match exactly
# the problem size selected in Tinker's sizes.i include file.
#
if ($TINKER == true) then
if (($MODULE == inputb) || ($MODULE == fmogrd) || ($MODULE == qmmm)) then
mv -f $MODULE_F $MODULE.junk
sed -e "s/MAXATM=10/MAXATM=$NumTinkAtms/" $MODULE.junk > $MODULE_F
rm -f $MODULE.junk
endif
endif
#
# Windows 64-Bit Timer hack
#
if (($MODULE == unport) && ($TARGET == win64)) then
if($GMS_FORTRAN == pgfortran) then
mv -f unport.f unport.junk
sed -e "s/\*64W/ /" unport.junk > unport.f
rm -f unport.junk
endif
if($GMS_FORTRAN == ifort) then
mv -f unport.f unport.junk
sed -e "s/\*64I/ /" unport.junk > unport.f
rm -f unport.junk
endif
endif
if (($MODULE == unport) && ($TARGET == winazure)) then
mv -f unport.f unport.junk
sed -e "s/\*WAZ/ /" unport.junk > unport.f
rm -f unport.junk
endif
#
# ...and this is the end of the ugly "sed hack"s.
#
# --------- Now we are ready to compile on the target machine ----------
#
cmp:
#
# Optionally, save pure FORTRAN in temporary directory for
# syntax scan by the nifty FORTRAN analysis program FTNCHEK.
#
if ($ACTONLY == true) then
#AAD since we operate within OBJDIR, the following is not required
#mv -f $MODULE_F ~/scr
if ($VB2000 == true) rm -f ../source/$MODULE.src
exit
endif
#
# --- now begins many system specific sections that actually compile ---
# Begin by erasing any previously generated object code,
# so that a failure to compile is very obvious when we can't link.
#
if (-e $OBJDIR/$MODULE_OBJ) rm -f $OBJDIR/$MODULE_OBJ
#