/
makefile.h
3050 lines (2826 loc) · 92.4 KB
/
makefile.h
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
# $Id$
#
# Common definitions for all makefiles ... these can be overridden
# either in each makefile by putting additional definitions below the
# include statement, or on the command line
#
# TOPDIR points to your top-level directory that contains
# src, lib, config, ... (SRCDIR, etc., are derived from TOPDIR)
# Do a setenv for NWCHEM_TOP to be the top level directory
#
# RELEASE is empty for the development branch of NWChem and is the
# version number for releases. If RELEASE is not empty and if NWCHEM_TOP
# does not already contain the value of RELEASE, it is appended with
# a hyphen to NWCHEM_TOP in order to derive the directory path TOPDIR.
# For development tree
RELEASE :=
# For current release tree
#RELEASE := 6.8
#
ifndef NWCHEM_TOP
error1:
$(info )
$(info You must define NWCHEM_TOP in your environment to be the path)
$(info of the top level nwchem directory ... something like)
$(info setenv NWCHEM_TOP /msrc/home/elvis/nwchem)
$(info )
$(error )
endif
# Select the old (pre-autotools version of GA) by uncommenting the next line.
# The value of OLD_GA does not matter -- it is detected as an ifdef only.
#OLD_GA = y
#
# Do a setenv for NWCHEM_TARGET to be the machine and NWCHEM_TARGET_CPU the CPU to build for
#
# NWCHEM_TARGET :
# CYGNUS (Windows under Cygwin tools)
# IBM
# LINUX NWCHEM_TARGET_CPU :
# nothing for X86 (e.g. do not set this)
# POWERPC for MkLinux
# SOLARIS NWCHEM_TARGET_CPU : not defined or ULTRA
# LAPI NWCHEM_TARGET_CPU : P2SC
# (uses thread safe libraries and LAPI)
#
#
ifndef NWCHEM_TARGET
error2:
$(info )
$(info You must define NWCHEM_TARGET in your environment to be the name)
$(info of the machine you wish to build for ... for example)
$(info setenv NWCHEM_TARGET SOLARIS)
$(info Known targets are SOLARIS, ...)
$(info See the INSTALL instructions for a complete list)
$(error )
endif
TARGET := $(NWCHEM_TARGET)
ifeq (,$(RELEASE))
TOPDIR := $(NWCHEM_TOP)
CODE_BRANCH := Development
else
ifeq (,$(findstring $(RELEASE),$(NWCHEM_TOP)))
TOPDIR := $(NWCHEM_TOP)-$(RELEASE)
else
TOPDIR := $(NWCHEM_TOP)
endif
CODE_BRANCH := $(RELEASE)
endif
#dummy:
# @echo NWCHEM_TOP=$(NWCHEM_TOP) RELEASE=$(RELEASE) TOPDIR=$(TOPDIR)
SRCDIR := $(TOPDIR)/src
ifndef NWCHEM_TARGET_CPU
LIBDIR := $(TOPDIR)/lib/$(NWCHEM_TARGET)
BINDIR := $(TOPDIR)/bin/$(NWCHEM_TARGET)
else
LIBDIR := $(TOPDIR)/lib/$(NWCHEM_TARGET)_$(NWCHEM_TARGET_CPU)
BINDIR := $(TOPDIR)/bin/$(NWCHEM_TARGET)_$(NWCHEM_TARGET_CPU)
endif
INCDIR := $(TOPDIR)/src/include
CNFDIR := $(TOPDIR)/src/config
ifdef EXTERNAL_GA_PATH
#check if ga-config is there
ifeq ("$(wildcard ${EXTERNAL_GA_PATH}/bin/ga-config)","")
$(info )
$(info invalid EXTERNAL_GA_PATH)
$(info ga-config not found)
$(info )
$(error )
endif
#check if f77 was enabled
GA_HAS_F77 = $(shell ${EXTERNAL_GA_PATH}/bin/ga-config --enable-f77 | awk '/yes/ {print "Y"}')
ifndef GA_HAS_F77
$(info NWChem requires Global Arrays built with Fortran support)
$(error )
endif
#check peigs interface
GA_HAS_PEIGS = $(shell ${EXTERNAL_GA_PATH}/bin/ga-config --enable-peigs | awk '/yes/ {print "Y"}')
ifndef GA_HAS_PEIGS
$(info NWChem requires Global Arrays built with Peigs support)
$(error )
endif
#check blas size
GA_BLAS_SIZE = $(shell ${EXTERNAL_GA_PATH}/bin/ga-config --blas_size)
ifndef BLAS_SIZE
BLAS_SIZE=8
endif
ifneq ($(BLAS_SIZE),$(GA_BLAS_SIZE))
$(info )
$(info NWChem requires Global Arrays built with same BLAS size )
$(info you asked BLAS_SIZE=${BLAS_SIZE})
$(info Global Arrays was built with BLAS size=${GA_BLAS_SIZE})
$(info )
$(error )
endif
GA_PATH=$(EXTERNAL_GA_PATH)
else
GA_PATH=$(NWCHEM_TOP)/src/tools/install
endif
#
# Define LIBPATH to be paths for libraries that you are linking in
# from precompiled sources and are not building now. These libraries
# will be searched AFTER anything you are building now.
# e.g. LIBPATH = -L/msrc/proj/mss/lib
#
LIBPATH =
ifdef OLD_GA
LIBPATH = -L$(SRCDIR)/tools/lib/$(TARGET)
else
#case guard against case when tools have not been compiled yet
ifeq ("$(wildcard ${GA_PATH}/bin/ga-config)","")
LIBPATH = -L$(SRCDIR)/tools/install/lib
else
GA_LDFLAGS= $(shell ${GA_PATH}/bin/ga-config --ldflags )
#extract GA libs location from last word in GA_LDLFLAGS
LIBPATH := $(word $(words ${GA_LDFLAGS}),${GA_LDFLAGS})
ifdef EXTERNAL_GA_PATH
LIBPATH += -L$(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib)
endif
endif
endif
#
# Define INCPATH to be directories to get includes for
# libraries that you are not building now. These directories
# will be searched AFTER anything you are building now.
#
INCPATH =
ifdef OLD_GA
INCPATH = -I$(SRCDIR)/tools/include
else
#case guard against case when tools have not been compiled yet
ifeq ("$(wildcard ${GA_PATH}/bin/ga-config)","")
INCPATH = -I$(SRCDIR)/tools/install/include
else
GA_CPPFLAGS= $(shell ${GA_PATH}/bin/ga-config --cppflags )
INCPATH := $(word $(words ${GA_CPPFLAGS}),${GA_CPPFLAGS})
ifdef EXTERNAL_GA_PATH
INCPATH += -I$(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
endif
endif
endif
# These subdirectories will build the core, or supporting libraries
# that are required by all NWChem modules. The include directory is
# first to insure that all include files will be properly installed
# prior to trying to compile anything.
#
# The core libraries are usually rather platform-dependent and are
# specified below. Use of MPI requires substituting the tcgmsg-mpi
# wrapper for the normal tcgmsg library.
# the 2 following environmental variables are need for linking
# LIBMPI - represents the name of mpi library (with -l)
# MPI_LIB - represents the path to the mpi library
#LIBMPI = -lmpich
#MPI_LIB= /usr/local/lib
#JN: under the new structure, tools should be listed first as
# their header files are needed for dependency analysis of
# other NWChem modules
ifndef EXTERNAL_GA_PATH
NW_CORE_SUBDIRS = tools
endif
NW_CORE_SUBDIRS += include basis geom inp input \
pstat rtdb task symmetry util peigs perfm bq cons $(CORE_SUBDIRS_EXTRA)
# Include the modules to build defined by 'make nwchem_config' at top level
include $(CNFDIR)/nwchem_config.h
#
# Finally, we can set the full list of interesting directories, which
# is what most makefile will care about.
NWSUBDIRS = $(NW_CORE_SUBDIRS) $(NW_MODULE_SUBDIRS)
BUILDING_PYTHON = $(filter $(NWSUBDIRS),python)
##########################################################
# #
# Should NOT need to modify below here unless porting to #
# a new machine or changing compiler options #
# #
##########################################################
# Each machine dependent section should define the following as necessary.
# (defaults if any in parentheses)
#
# FC = path to Fortran compiler (f77)
# CC = path to ANSI C compiler (cc)
# AS = path to the assembler (as)
# AR = path to archive builder (ar)
# CPP = path to ANSI-like C preprocessor (cpp)
# RANLIB = path to ranlib or something harmless if not required
# SHELL = path to the Bourne Shell
# MAKE = DON\'T define this ... it will break the passing of command
# arguments. Simply use the correct path to GNU make on the
# command line and all will work just dandy.
# MAKEFLAGS = options to GNU make ... -j controls no. of threads used
# for parallel builds. --no-print-directory says be quiet about
# changing directory.
# INSTALL = command to install an executable when it is built
#
# C/FOPTIONS = essential compiler options independent of optimization level
# C/FOPTIONS should not usually be overridden on the command line
# C/FDEBUG = compiler flags to enable enable debugging and used for
# all routines not vital for performance (OBJ in makelib.h)
#C/FOPTIMIZE = compiler flags to enable optimization for important routines.
# (OBJ_OPTIMIZE in makelib.h)
#
# C/FDEBUG and C/FOPTIMIZE can be overridden on the command
# line to change the optimization level for routines normally
# compiled with them.
#
# EXPLICITF = undefined if the Fortran compiler runs .F files thru .f
# Otherwise set it to anything and define FCONVERT to be a
# command to make $< (which will be a .F file) into $*.f
#
# FCONVERT = command to convert a .F into a .f
#
# LDOPTIONS = additional options to be passed to the linker (LDFLAGS is
# built from this and the library path info). LDOPTIONS is
# the best way to add to the link command.
#
# ARFLAGS = options for AR (ru)
#
# DEFINES = C preprocessor defines for both C and Fortran
#
# CORE_LIBS = List of libraries and paths for libraries in addition
# to the LIBDIR and LIBPATH options.
#
# CORE_SUBDIRS_EXTRA = List of additional directories (e.g., BLAS) that
# are needed on this machine.
# MODULE_SUBDIRS_EXTRA = List of additional directories (e.g., stepper) that
# are needed for top-level modules on this machine.
# (Should not normally be used)
#
# The following are defined for all machines at the bottom of this file
#
# C/FFLAGS = all options to the C/Fortran compilers (note CPPFLAGS are
# separate). These comprise C/FOPTIONS and C/FOPT.
# INCLUDES = C preprocessor include paths for both C and Fortran.
# In princpile this could be machine dependent but is not yet.
# CPPFLAGS = options to C preprocessor that both C and Fortran will use.
# This comprises the includes and defines.
# LDFLAGS = options for the linker. Currently paths from LIBDIR and
# LIBPATH.
#
# NWCHEM_TARGET_CPU environment variable is used to select compiler flags
# optimal for given CPU. The following values are recognized on particular
# platforms:
#
# NWCHEM_TARGET NWCHEM_TARGET_CPU
# LAPI P2SC
#
#
# Establish some required defaults which may need overriding
# for some machines
SHELL = /bin/sh
ARFLAGS = r
FDEBUG = -g
CDEBUG = -g
AR = ar
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
ifdef OLD_GA
CORE_LIBS = -lnwcutil -lpario -lglobal -lma -lpeigs -lperfm -lcons -lbq -lnwcutil
else
CORE_LIBS = -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil
endif
ifdef USE_INTEGER4
integer4:
@echo
@echo USE_INTEGER4 option no longer supported
@echo please do not set it
@echo
@exit 1
endif
# -U option needed for introducing timestamps in libraries
# see https://bugzilla.redhat.com/show_bug.cgi?id=1195883 (RedHat backtracked)
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798913
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798804 (Debian did not backtrack)
# USE_ARUR = $(shell rm -f aru.tmp;ar -U > aru.tmp 2>&1; head -1 aru.tmp| awk ' /no\ operation/ {print "Y";exit};{print "N"}'; rm -f aru.tmp)
USE_ARUR = $(shell rm -f aru.tmp;ar --help > aru.tmp 2>&1; grep U aru.tmp| awk ' /ctual\ timest/ {print "Y";exit};'; rm -f aru.tmp)
ifeq ($(USE_ARUR),Y)
ARFLAGS = rU
endif
# strip long paths when FC and/or CC are set from user
ifneq ($(FC),f77)
_FC = $(notdir $(FC))
endif
ifneq ($(CC),cc)
_CC = $(notdir $(CC))
endif
#
# Machine specific stuff
#
ifeq ($(TARGET),SOLARIS)
SHELL := $(NICE) /bin/sh
RANLIB = echo
MAKEFLAGS = -j 2 --no-print-directory
INSTALL = echo $@ is built
#
# You can use either the f77 or f90 compiler BUT if using f90
# you\'ll need to specify -DINTEGER_1='integer*1' in the selci
# and util makefiles.
#
CC = cc
FC = f77
# Don\'t need this if using the SUN performance library
# need for BLASOPT business because of lapack and other possible missing entries
ifndef BLASOPT
CORE_SUBDIRS_EXTRA = blas lapack
endif
DEFINES = -DSOLARIS -DNOAIO
# Note that WS6 does not optimize robustly and if using this you must
# - put "-nodpend -xvector=no" on FOPTIONS after -fast
# - remove "-fsimple=2 -depend -xvector=yes" from FOPTIMIZE.
# - remove -lmvec from CORELIBS
# to get link with sunperf, type BLASOPT="-xlic_lib=sunperf"
#
# These options are set for WS5
ifeq ($(CC),fcc)
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
COPTIONS = -Kdalign
COPTIMIZE = -Kfast_GP=2
DEFINES += -DFUJITSU_SOLARIS
endif
ifeq ($(FC),frt)
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
# Fujitsu with Parallelnavi compilers
# If using Fujitsu compilers on Sun hardware, replace -Kfast_GP=2 with
# -Kfast
DEFINES += -DFUJITSU_SOLARIS -DEXTNAME
FOPTIONS = -Kdalign -w -fw -X9
FOPTIMIZE = -Kfast_GP=2
FDEBUG=
LINK.f = $(FC) $(LDFLAGS) $(FOPTIONS) $(FOPTIMIZE)
else
FOPTIONS = -stackvar -dalign
FOPTIMIZE = -fast -O5 -fsimple=2 -depend -xvector=yes
FDEBUG = -g -O1 -nodepend
LINK.f = $(FC) $(LDFLAGS) $(FOPTIONS)
endif
ifeq ($(FC),frt)
CORE_LIBS += -SSL2
else
LDOPTIONS = -xildoff
CORE_LIBS += -lnwclapack $(BLASOPT) -lnwcblas -lmvec
endif
EXTRA_LIBS = -ldl
# this creates a static executable
#EXTRA_LIBS = -Bdynamic -ldl -lXext -lnsl -Bstatic
ifeq ($(BUILDING_PYTHON),python)
# Both tk/tcl and BLT need X11 (common)
EXTRA_LIBS += -lX11
endif
#end of solaris
endif
ifeq ($(TARGET),SOLARIS64)
#
# Sun running Solaris 64-bit ... NEEDS WORKSHOP 6.1 or later compilers
# due to bugs in earlier compilers. Also cannot yet use sunperf due to
# the braindead naming of the 64-bit interface.
#
# You can use either the f77 or f90 compiler BUT if using f90
# you will need to specify -DINTEGER_1='integer*1' in the selci
# and util makefiles.
#
SHELL := $(NICE) /bin/sh
CORE_SUBDIRS_EXTRA = blas lapack
CC = cc
FC = f77
DEFINES = -DSOLARIS -DNOAIO -DSOLARIS64
DEFINES += -DEXT_INT
COPTIMIZE = -O
RANLIB = echo
MAKEFLAGS = -j 2 --no-print-directory
INSTALL = echo $@ is built
ifeq ($(CC),fcc)
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
COPTIONS = -Kdalign -KV9FMADD
COPTIMIZE = -Kfast_GP=2 -KV9FMADD
DEFINES += -DFUJITSU_SOLARIS
else
# SUN/Solaris options for WS6.1
COPTIONS = -xarch=v9 -dalign
endif
ifeq ($(FC),frt)
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
# Fujitsu with Parallelnavi compilers
# If using Fujitsu compilers on Sun hardware, replace -Kfast_GP=2 with
# -Kfast
DEFINES += -DFUJITSU_SOLARIS -DEXTNAME
FOPTIONS = -Kdalign -w -fw -X9 -KV9FMADD
ifdef USE_I4FLAGS
FOPTIONS += -CcdLL8
else
FOPTIONS += -CcdLL8 -CcdII8
endif
FOPTIMIZE = -Kfast_GP=2 -KV9FMADD
FDEBUG=
else
# SUN/Solaris f77 options
FOPTIONS = -stackvar -fast -nodepend -xvector=no -xarch=v9a
ifdef USE_I4FLAGS
FOPTIONS += -xtypemap=real:64,double:64,integer:32
else
FOPTIONS += -xtypemap=real:64,double:64,integer:64
endif
FOPTIMIZE = -g -O5
FDEBUG = -g -O1
endif
LINK.f = $(FC) $(LDFLAGS) $(FOPTIONS)
ifeq ($(FC),frt)
LDOPTIONS = -SSL2
CORE_LIBS += -lnwclapack -lnwcblas
else
LDOPTIONS = -xs -xildoff
ifdef BLASOPT
CORE_LIBS += $(BLASOPT) -lmvec
else
CORE_LIBS += -lnwclapack -lnwcblas -lmvec
endif
CORE_LIBS += -lsocket -lrpcsvc -lnsl
EXTRA_LIBS = -ldl -lfsu
endif
#end of solaris
endif
ifeq ($(TARGET),PURESOLARIS)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),FUJITSU_VPP)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),FUJITSU_VPP64)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),cray-sv2)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),CRAY-T3E)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),SGITFP)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),SGI_N32)
@echo DEPRECATED
@exit
endif
ifeq ($(TARGET),HPUX)
#
# HPUX 11.0
#
# removed reference to MLIB since 8.3 version of MLIB
# does not support +ppu
#
CORE_SUBDIRS_EXTRA = blas lapack
MAKEFLAGS = -j 1 --no-print-directory
CPP = /lib/cpp -P
CC = cc
FC = f90
LDOPTIONS = -g -Wl,+vallcompatwarnings +U77
LDOPTIONS += +DA2.0 +DS2.0 +O2
LDOPTIONS += +O2
LINK.f = f90 $(LDFLAGS)
CORE_LIBS += $(BLASOPT) -lnwclapack -lnwcblas -lm
FDEBUG = -g
FOPTIONS = +ppu -Wl,-a,archive
COPTIONS = -Aa -D_HPUX_SOURCE +e
FOPTIMIZE = +O2 +Onolimit
FOPTIMIZE += +DA2.0 +DS2.0a +Odataprefetch +Onofltacc +Onoinitcheck
FOPTIMIZE += +Oprocelim +Oentrysched +Ofastaccess
FVECTORIZE = +Oall +Onofltacc
COPTIMIZE = -O
RANLIB = echo
DEFINES = -DHPUX -DEXTNAME
ifeq ($(BUILDING_PYTHON),python)
# needed if python was compiled with gcc (common)
EXTRA_LIBS += -L/usr/local/lib/gcc-lib/hppa1.0-hp-hpux11.00/2.8.0 -lgcc
endif
endif
ifeq ($(TARGET),HPUX64)
#
# HPUX 11.0
#
CORE_SUBDIRS_EXTRA = blas lapack
_CPU = $(shell uname -m )
MAKEFLAGS = -j 1 --no-print-directory
CPP = /lib/cpp -P
CC = cc
FC = f90
LDOPTIONS = -Wl,+vallcompatwarnings +U77
CORE_LIBS += -lnwclapack $(BLASOPT) -lnwcblas -lm
CDEBUG =
FDEBUG = -g
FOPTIONS = +ppu #+U77
COPTIONS = -Aa -D_HPUX_SOURCE +e
ifeq ($(_CPU),ia64)
FOPTIONS += +DD64 +DSitanium2 +Ofltacc=relaxed +Olibcalls +Onolimit +FPD
COPTIONS += +DD64
FOPTIMIZE = +O2
FVECTORIZE = +Ofast +O3 +Onoptrs_to_globals +Oloopblock
FDEBUG = +Ofast
else
FOPTIONS += +DA2.0W
COPTIONS += +DA2.0W
FOPTIMIZE = +O2
FVECTORIZE = +Oall +Onofltacc
endif
COPTIMIZE = -O
RANLIB = echo
DEFINES = -DHPUX -DEXTNAME -DHPUX64
ifdef USE_I4FLAGS
else
FOPTIONS += +i8
endif
DEFINES += -DEXT_INT
endif
ifeq ($(TARGET),IBM)
#
# IBM AIX
#
CORE_SUBDIRS_EXTRA = lapack blas
FC = xlf
ifeq ($(FC),xlf)
_FC=xlf
endif
CC = xlc
ARFLAGS = urs
RANLIB = echo
MAKEFLAGS = -j 5 --no-print-directory
INSTALL = @echo $@ is built
CPP = /usr/lib/cpp -P
FOPTIONS = -qEXTNAME -qnosave -qalign=4k -qxlf77=leadzero
# -qinitauto=FF
COPTIONS =
# -qstrict required with -O3 (according to Edo)
# -qfloat=rsqrt gives faster square roots (off by -qstrict)
# -qfloat=fltint gives faster real-integer conversion (off by -qstrict)
# -qhot seems to break a lot of things so don\'t ever use it
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000 -qarch=auto -qtune=auto -NS2048
ifdef RSQRT
FOPTIMIZE += -qfloat=rsqrt:fltint
endif
COPTIMIZE = -O -qarch=auto -qtune=auto
ifdef USE_GPROF
FOPTIONS += -pg
LDOPTIONS += -pg
endif
ifdef USE_DEBUG
FOPTIONS += -g
LDOPTIONS += -g
endif
DEFINES = -DIBM -DAIX -DEXTNAME
CORE_LIBS += $(BLASOPT)
ifdef USE_ESSL
DEFINES += -DESSL
CORE_LIBS += -lessl
endif
LIBPATH += -L/usr/lib
LDOPTIONS += -bmaxstack:0x60000000 -bmaxdata:0x60000000 -bloadmap:nwchem.lapi_map
CORE_LIBS += -lnwclapack $(BLASOPT) -lnwcblas \
-brename:.daxpy_,.daxpy \
-brename:.dcopy_,.dcopy \
-brename:.ddot_,.ddot \
-brename:.dgemm_,.dgemm \
-brename:.dgemv_,.dgemv \
-brename:.dgesv_,.dgesv \
-brename:.dgetrf_,.dgetrf \
-brename:.dgetrs_,.dgetrs \
-brename:.dlaset_,.dlaset \
-brename:.dpotrf_,.dpotrf \
-brename:.dpotri_,.dpotri \
-brename:.dscal_,.dscal \
-brename:.dspsvx_,.dspsvx \
-brename:.idamax_,.idamax \
-brename:.dswap_,.dswap \
-brename:.dger_,.dger \
-brename:.dtrsm_,.dtrsm \
-brename:.dnrm2_,.dnrm2 \
-brename:.dtrmm_,.dtrmm \
-brename:.drot_,.drot \
-brename:.dasum_,.dasum \
-brename:.dtrmv_,.dtrmv \
-brename:.dspmv_,.dspmv \
-brename:.dspr_,.dspr \
-brename:.dsyrk_,.dsyrk \
-brename:.dsyr2k_,.dsyr2k \
-brename:.dsymv_,.dsymv \
-brename:.lsame_,.lsame \
-brename:.xerbla_,.xerbla \
-brename:.zgemm_,.zgemm \
-brename:.dsyr2_,.dsyr2 \
-brename:.dznrm2_,.dznrm2 \
-brename:.zaxpy_,.zaxpy \
-brename:.zcopy_,.zcopy \
-brename:.zdotc_,.zdotc \
-brename:.zdscal_,.zdscal \
-brename:.zgemv_,.zgemv \
-brename:.zgerc_,.zgerc \
-brename:.zhemv_,.zhemv \
-brename:.zher2_,.zher2 \
-brename:.zher2k_,.zher2k \
-brename:.zscal_,.zscal \
-brename:.zswap_,.zswap \
-brename:.ztrmm_,.ztrmm \
-brename:.ztrmv_,.ztrmv \
-brename:.izamax_,.izamax
# -brename:.zherk_,.zherk \
# -brename:.zhemm_,.zhemm \
# -brename:.ztrsm_,.ztrsm \
# -brename:.dtrsv_,.dtrsv \
# -brename:.ztrsv_,.ztrsv
# -brename:.dsymm_,.dsymm \
#
##comment out from dtrmm_ inclusive
EXPLICITF = TRUE
#
endif
ifeq ($(TARGET),IBM64)
#
# IBM AIX 64-bit
# tested on ecs1 May 10 2000 AIX 4.3.3.10
# does not run on AIX 4.3.2.1 (skunkworks)
#
ifeq ($(LAPACK_LIB),)
CORE_SUBDIRS_EXTRA += lapack
endif
ifeq ($(BLAS_LIB),)
CORE_SUBDIRS_EXTRA += blas
endif
FC = xlf
ifeq ($(FC),xlf)
_FC=xlf
endif
CC = xlc
AR = ar -X 64
RANLIB = echo
MAKEFLAGS = -j 11 --no-print-directory
INSTALL = @echo $@ is built
CPP = /usr/lib/cpp -P
FOPTIONS = -qEXTNAME -qnosave -qalign=4k -q64 -qxlf77=leadzero
COPTIONS = -q64
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000 -qarch=auto -qtune=auto
RSQRT=y
FDEBUG = -O2 -qmaxmem=8192
ifdef RSQRT
FOPTIMIZE += -qfloat=rsqrt:fltint
endif
XLF8= $(shell /usr/bin/lslpp -l xlfcmp 2>&1|grep COMM|head -n 1| awk ' / [8-9]./ {print "Y"};/[ ][1][0-9]./ {print "Y"}')
ifdef XLF8
FVECTORIZE= -O3 -qstrict -qtune=auto -qarch=auto -qcache=auto -qalign=natural \
-qnozerosize -qlargepage -qnozerosize -qipa=level=2
#old FOPTIMIZE = -O4 -NQ40000 -NT80000 -qarch=auto -qtune=auto
FOPTIMIZE = -O3 -qarch=auto -qtune=auto
#adding -qstrict to fix linking problem for v10.1
FOPTIMIZE += -qstrict# -qipa -qhot -qlargepage -qessl
FOPTIONS += -blpdata
FOPTIMIZE += -qfloat=rsqrt:fltint
FVECTORIZE += -qfloat=rsqrt:fltint
endif
COPTIMIZE = -O -qmaxmem=8192
DEFINES = -DIBM -DAIX -DEXTNAME
DEFINES += -DCHKUNDFLW
LIBPATH += -L/usr/lib -L/lib
ifdef USE_I4FLAGS
FOPTIONS += -qintsize=4
else
FOPTIONS += -qintsize=8
endif
DEFINES += -DEXT_INT
ifdef USE_GPROF
FOPTIONS += -pg
LDOPTIONS += -pg
endif
ifdef USE_DEBUG
FOPTIONS += -g
LDOPTIONS += -g
endif
LDOPTIONS += -bloadmap:nwchem.ibm64map -bbigtoc # bigtoc requires bmaxdata
LDOPTIONS += -bmaxstack:0x80000000 -bmaxdata:0x200000000 # this limits MA to 8GB
ifeq ($(LAPACK_LIB),)
CORE_LIBS += -lnwclapack
endif
CORE_LIBS += $(BLASOPT)
ifeq ($(BLAS_LIB),)
CORE_LIBS += -lnwcblas
endif
XLFBREN = y
EXPLICITF = TRUE
#
endif
ifeq ($(TARGET),LAPI)
#
CORE_SUBDIRS_EXTRA = lapack blas
FC = mpxlf_r
ifdef OLDXLF
FC += -qnohpf
endif
CC = mpcc_r
ARFLAGS = urs
RANLIB = echo
MAKEFLAGS = -j 1 --no-print-directory
INSTALL = @echo $@ is built
CPP = /usr/lib/cpp -P
MPILIB =
LARGE_FILES = YES
LDOPTIONS = -lc_r -lxlf90_r -lm_r -qEXTNAME -qnosave -qalign=4k -g
LINK.f = mpcc_r $(LDFLAGS)
FOPTIONS = -qEXTNAME -qnosave -qalign=4k -qxlf77=leadzero
ifdef USE_GPROF
FOPTIONS += -pg
LDOPTIONS += -pg
endif
ifdef USE_DEBUG
FOPTIONS += -g
LDOPTIONS += -g
endif
# -qinitauto=7F # note that grad_force breaks with this option
COPTIONS =
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000 -NS10000 -qipa=level=2
ifdef RSQRT
FOPTIMIZE += -qfloat=rsqrt:fltint
endif
COPTIMIZE = -O
FC += -qarch=auto -qtune=auto -qcache=auto -qthreaded
CC += -qarch=auto -qtune=auto -qcache=auto
DEFINES = -DLAPI -DSP1 -DAIX -DEXTNAME
DEFINES += -DCHKUNDFLW
USE_ESSL = YES
ifdef USE_ESSL
CORE_LIBS += -lessl
endif
ifdef USE_PESSL
DEFINES += -DESSL
CORE_LIBS += -lpessl -lblacs
endif
# Need ESSL before our own BLAS library but still need our
# own stuff for misc. missing routines
CORE_LIBS += -lnwclapack -lnwcblas
LDOPTIONS += -bloadmap:nwchem.lapimap -bbigtoc
LDOPTIONS += -bmaxstack:0x60000000 -bmaxdata:0x60000000 # needed because of bigtoc
EXPLICITF = TRUE
#
endif
ifeq ($(TARGET),LAPI64)
#
CORE_SUBDIRS_EXTRA = lapack blas
FC = mpxlf_r
CC = mpcc_r
ARFLAGS = urs
RANLIB = echo
MAKEFLAGS = -j 3 --no-print-directory
INSTALL = @echo $@ is built
CPP = /usr/lib/cpp -P
MPILIB =
LARGE_FILES = YES
LDOPTIONS = -lc_r -lxlf90_r -lm_r -qEXTNAME -qnosave -q64 -bloadmap:nwchem.lapi64_map $(LAPI64LIBS)
LINK.f = mpxlf_r $(LDFLAGS)
FOPTIONS = -qEXTNAME -qnosave -q64 -qalign=4k -qxlf77=leadzero -qthreaded
AR = ar -X 64
COPTIONS = -q64
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000
FOPTIMIZE += -qarch=auto -qtune=auto -qcache=auto
ifdef RSQRT
FOPTIMIZE += -qfloat=rsqrt:fltint
endif
COPTIMIZE = -O
XLF8= $(shell xlf -qversion 2>&1|grep Version|head -1| awk ' / [8-9]./ {print "Y"};/[ ][1][0-9]./ {print "Y"}')
XLF10 = $(shell xlf -qversion 2>&1|grep Version|head -1| awk ' / 10./ {print "Y"}')
XLF11 = $(shell xlf -qversion 2>&1|grep Version|head -1| awk ' / 11./ {print "Y"}')
ifdef XLF8
FVECTORIZE= -O3 -qstrict -qtune=auto -qarch=auto -qcache=auto -qalign=natural \
-qnozerosize -qlargepage -qnozerosize -qipa=level=2
FOPTIMIZE = -O4 -NQ40000 -NT80000 -qarch=auto -qtune=auto
FOPTIMIZE += -qipa -qhot -qlargepage -qessl
FOPTIONS += -blpdata
FOPTIMIZE += -qfloat=rsqrt:fltint
FVECTORIZE += -qfloat=rsqrt:fltint
endif
DEFINES = -DLAPI64 -DEXTNAME -DLAPI -DSP1 -DAIX
DEFINES += -DCHKUNDFLW
ifdef USE_I4FLAGS
FOPTIONS += -qintsize=4
else
FOPTIONS += -qintsize=8
endif
DEFINES += -DEXT_INT
CORE_LIBS += $(BLASOPT) -lnwclapack -lnwcblas
LDOPTIONS += -bloadmap:nwchem.lapi64map -bbigtoc
LDOPTIONS += -bmaxstack:0x80000000 -bmaxdata:0x80000000 # needed because of bigtoc
# LDOPTIONS += -bmaxstack:0xe0000000 -bmaxdata:0xe0000000 # this for large memory
XLFBREN = y
EXPLICITF = TRUE
#
endif
ifeq ($(TARGET),MACX)
FC = gfortran
_FC = gfortran
#
# MacOSX
#
ifdef USE_VECLIB
CORE_SUBDIRS_EXTRA = blas
else
CORE_SUBDIRS_EXTRA = blas lapack
endif
_CPU = $(shell machine )
FC = gfortran
INSTALL = @echo nwchem is built
RANLIB = ranlib
MAKEFLAGS = -j 1 --no-print-directory
DEFINES =-DMACX
COPTIONS = -m32
FOPTIONS = -m32
CFLAGS_FORGA = -m32
FFLAGS_FORGA = -m32
# required for mpich2 3.x and clang
DEFINES +=-DMPICH_NO_ATTR_TYPE_TAGS
CFLAGS_FORGA +=-DMPICH_NO_ATTR_TYPE_TAGS
ifeq ($(FC),xlf)
_FC=xlf
XLFMAC=y
FOPTIONS = -qextname -qfixed -qnosave -qalign=4k
FOPTIONS += -NQ40000 -NT80000 -NS2048 -qmaxmem=8192 -qxlf77=leadzero
FOPTIMIZE= -O3 -qstrict -qarch=auto -qtune=auto -qcache=auto -qcompact
ifdef RSQRT
FOPTIMIZE += -qfloat=rsqrt:fltint
endif
FVECTORIZE += $(FOPTIMIZE) -qunroll=yes
FDEBUG= -O2 -qcompact
DEFINES +=-DXLFLINUX -DCHKUNDFLW
FOPTIONS += $(INCLUDES) -WF,"$(DEFINES)" $(shell echo $(LIB_DEFINES) | sed -e "s/-D/-WF,-D/g" | sed -e 's/\"/\\\"/g' | sed -e "s/\'/\\\'/g")
endif
ifeq ($(FC),g77)
#g77, only decent one form Fink http://fink.sf.net
#gcc version 3.4 20031015 (experimental)
_G77V33= $(shell g77 -v 2>&1|egrep spec|head -n 1|awk ' /3.3/ {print "Y"}')
FDEBUG= -O1 -g
FOPTIONS = -fno-second-underscore -fno-globals -Wno-globals
FOPTIMIZE = -O3 -fno-inline-functions -funroll-loops
FOPTIMIZE += -falign-loops=16 -falign-jumps=16 -falign-functions=16
FOPTIMIZE += -ffast-math -mpowerpc-gpopt
FOPTIMIZE += -maltivec
ifeq ($(_G77V33),Y)
FOPTIONS += -fno-force-mem
FOPTIMIZE += -fno-force-mem
endif
ifeq ($(_CPU),ppc970)
#G5
FOPTIMIZE += -mtune=970 -mcpu=970 -mpowerpc64
endif
ifeq ($(_CPU),ppc7450)
#G4
FOPTIMIZE += -mtune=7450 -mcpu=7450
endif
endif
FDEBUG = -g -O1
ifeq ($(FC),gfortran)
_FC=gfortran
#gcc version 4.2.0 200512 (experimental)
LINK.f = gfortran -m32 $(LDFLAGS)
FDEBUG = -O0 -g
FOPTIMIZE = -O2 -ffast-math -Wuninitialized
DEFINES += -DGFORTRAN
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | egrep __VERS | cut -c22)
ifdef GNUMAJOR
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | egrep __VERS | cut -c24)
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6 ] && echo true)
endif
ifeq ($(GNU_GE_4_6),true)
DEFINES += -DGCC46
endif
ifeq ($(GNU_GE_4_8),true)
FDEBUG += -fno-aggressive-loop-optimizations
FOPTIMIZE +=-fno-aggressive-loop-optimizations
FOPTIONS +=-fno-aggressive-loop-optimizations
FFLAGS_FORGA += -fno-aggressive-loop-optimizations
FOPTIONS += -Warray-bounds
endif
ifeq ($(GNU_GE_6),true)
FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
FOPTIONS += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
FDEBUG += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks