2
# $Id: makefile.h 24201 2013-05-09 00:59:44Z edo $
5
# Common definitions for all makefiles ... these can be overridden
6
# either in each makefile by putting additional definitions below the
7
# include statement, or on the command line
10
# TOPDIR points to your top-level directory that contains
11
# src, lib, config, ... (SRCDIR, etc., are derived from TOPDIR)
12
# Do a setenv for NWCHEM_TOP to be the top level directory
14
# RELEASE is empty for the development branch of NWChem and is the
15
# version number for releases. If RELEASE is not empty and if NWCHEM_TOP
16
# does not already contain the value of RELEASE, it is appended with
17
# a hyphen to NWCHEM_TOP in order to derive the directory path TOPDIR.
19
# For development tree
21
# For current release tree
29
$(info You must define NWCHEM_TOP in your environment to be the path)
30
$(info of the top level nwchem directory ... something like)
31
$(info setenv NWCHEM_TOP /msrc/home/elvis/nwchem)
36
# Select the old (pre-autotools version of GA) by uncommenting the next line.
37
# The value of OLD_GA does not matter -- it is detected as an ifdef only.
41
# Do a setenv for NWCHEM_TARGET to be the machine and NWCHEM_TARGET_CPU the CPU to build for
44
# CYGNUS (Windows under Cygwin tools)
47
# LINUX NWCHEM_TARGET_CPU :
48
# nothing for X86 (e.g. do not set this)
49
# ALPHA for AlphaLinux (broke)
52
# SGI_N32 NWCHEM_TARGET_CPU : R8000 or R10000
53
# SGITFP NWCHEM_TARGET_CPU : R8000 or R10000
54
# SOLARIS NWCHEM_TARGET_CPU : not defined or ULTRA
55
# LAPI NWCHEM_TARGET_CPU : P2SC
56
# (uses thread safe libraries and LAPI)
62
@echo You must define NWCHEM_TARGET in your environment to be the name
63
@echo of the machine you wish to build for ... for example
64
@echo setenv NWCHEM_TARGET SOLARIS
65
@echo Known targets are SOLARIS, SGI_N32, ...
66
@echo See the INSTALL instructions for a complete list
70
TARGET := $(NWCHEM_TARGET)
72
TOPDIR := $(NWCHEM_TOP)
73
CODE_BRANCH := Development
75
ifeq (,$(findstring $(RELEASE),$(NWCHEM_TOP)))
76
TOPDIR := $(NWCHEM_TOP)-$(RELEASE)
78
TOPDIR := $(NWCHEM_TOP)
80
CODE_BRANCH := $(RELEASE)
84
# echo NWCHEM_TOP=$(NWCHEM_TOP) RELEASE=$(RELEASE) TOPDIR=$(TOPDIR)
86
SRCDIR := $(TOPDIR)/src
87
ifndef NWCHEM_TARGET_CPU
88
LIBDIR := $(TOPDIR)/lib/$(NWCHEM_TARGET)
89
BINDIR := $(TOPDIR)/bin/$(NWCHEM_TARGET)
91
LIBDIR := $(TOPDIR)/lib/$(NWCHEM_TARGET)_$(NWCHEM_TARGET_CPU)
92
BINDIR := $(TOPDIR)/bin/$(NWCHEM_TARGET)_$(NWCHEM_TARGET_CPU)
94
INCDIR := $(TOPDIR)/src/include
95
CNFDIR := $(TOPDIR)/src/config
98
# Define LIBPATH to be paths for libraries that you are linking in
99
# from precompiled sources and are not building now. These libraries
100
# will be searched AFTER anything you are building now.
101
# e.g. LIBPATH = -L/msrc/proj/mss/lib
105
LIBPATH = -L$(SRCDIR)/tools/lib/$(TARGET)
107
LIBPATH = -L$(SRCDIR)/tools/install/lib
111
# Define INCPATH to be directories to get includes for
112
# libraries that you are not building now. These directories
113
# will be searched AFTER anything you are building now.
117
INCPATH = -I$(SRCDIR)/tools/include
119
INCPATH = -I$(SRCDIR)/tools/install/include
122
# These subdirectories will build the core, or supporting libraries
123
# that are required by all NWChem modules. The include directory is
124
# first to insure that all include files will be properly installed
125
# prior to trying to compile anything.
127
# The core libraries are usually rather platform-dependent and are
128
# specified below. Use of MPI requires substituting the tcgmsg-mpi
129
# wrapper for the normal tcgmsg library.
130
# the 2 following environmental variables are need for linking
131
# LIBMPI - represents the name of mpi library (with -l)
132
# MPI_LIB - represents the path to the mpi library
134
#MPI_LIB= /usr/local/lib
136
#JN: under the new structure, tools should be listed first as
137
# their header files are needed for dependency analysis of
138
# other NWChem modules
140
NW_CORE_SUBDIRS = tools include basis geom inp input \
141
pstat rtdb task symmetry util peigs perfm bq cons $(CORE_SUBDIRS_EXTRA)
143
# Include the modules to build defined by 'make nwchem_config' at top level
145
include $(CNFDIR)/nwchem_config.h
148
# Finally, we can set the full list of interesting directories, which
149
# is what most makefile will care about.
151
NWSUBDIRS = $(NW_CORE_SUBDIRS) $(NW_MODULE_SUBDIRS)
153
BUILDING_PYTHON = $(filter $(NWSUBDIRS),python)
154
##########################################################
156
# Should NOT need to modify below here unless porting to #
157
# a new machine or changing compiler options #
159
##########################################################
161
# Each machine dependent section should define the following as necessary.
162
# (defaults if any in parentheses)
164
# FC = path to Fortran compiler (f77)
165
# CC = path to ANSI C compiler (cc)
166
# AS = path to the assembler (as)
167
# AR = path to archive builder (ar)
168
# CPP = path to ANSI-like C preprocessor (cpp)
169
# RANLIB = path to ranlib or something harmless if not required
170
# SHELL = path to the Bourne Shell
171
# MAKE = DON'T define this ... it will break the passing of command
172
# arguments. Simply use the correct path to GNU make on the
173
# command line and all will work just dandy.
174
# MAKEFLAGS = options to GNU make ... -j controls no. of threads used
175
# for parallel builds. --no-print-directory says be quiet about
176
# changing directory.
177
# INSTALL = command to install an executable when it is built
179
# C/FOPTIONS = essential compiler options independent of optimization level
180
# C/FOPTIONS should not usually be overridden on the command line
181
# C/FDEBUG = compiler flags to enable enable debugging and used for
182
# all routines not vital for performance (OBJ in makelib.h)
183
#C/FOPTIMIZE = compiler flags to enable optimization for important routines.
184
# (OBJ_OPTIMIZE in makelib.h)
186
# C/FDEBUG and C/FOPTIMIZE can be overridden on the command
187
# line to change the optimization level for routines normally
188
# compiled with them.
190
# EXPLICITF = undefined if the Fortran compiler runs .F files thru .f
191
# Otherwise set it to anything and define FCONVERT to be a
192
# command to make $< (which will be a .F file) into $*.f
194
# FCONVERT = command to convert a .F into a .f
196
# LDOPTIONS = additional options to be passed to the linker (LDFLAGS is
197
# built from this and the library path info). LDOPTIONS is
198
# the best way to add to the link command.
200
# ARFLAGS = options for AR (ru)
202
# DEFINES = C preprocessor defines for both C and Fortran
204
# CORE_LIBS = List of libraries and paths for libraries in addition
205
# to the LIBDIR and LIBPATH options.
207
# CORE_SUBDIRS_EXTRA = List of additional directories (e.g., BLAS) that
208
# are needed on this machine.
209
# MODULE_SUBDIRS_EXTRA = List of additional directories (e.g., stepper) that
210
# are needed for top-level modules on this machine.
211
# (Should not normally be used)
213
# The following are defined for all machines at the bottom of this file
215
# C/FFLAGS = all options to the C/Fortran compilers (note CPPFLAGS are
216
# separate). These comprise C/FOPTIONS and C/FOPT.
217
# INCLUDES = C preprocessor include paths for both C and Fortran.
218
# In princpile this could be machine dependent but is not yet.
219
# CPPFLAGS = options to C preprocessor that both C and Fortran will use.
220
# This comprises the includes and defines.
221
# LDFLAGS = options for the linker. Currently paths from LIBDIR and
224
# NWCHEM_TARGET_CPU environment variable is used to select compiler flags
225
# optimal for given CPU. The following values are recognized on particular
228
# NWCHEM_TARGET NWCHEM_TARGET_CPU
230
# SGITFP R10000/R8000
231
# SGI_N32 R10000/R8000
236
# Establish some required defaults which may need overriding
246
CORE_LIBS = -lnwcutil -lpario -lglobal -lma -lpeigs -lperfm -lcons -lbq -lnwcutil
248
CORE_LIBS = -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil
254
@echo USE_INTEGER4 option no longer supported
255
@echo please do not set it
261
# Machine specific stuff
264
ifeq ($(TARGET),SOLARIS)
265
SHELL := $(NICE) /bin/sh
267
MAKEFLAGS = -j 2 --no-print-directory
268
INSTALL = echo $@ is built
270
# You can use either the f77 or f90 compiler BUT if using f90
271
# you'll need to specify -DINTEGER_1='integer*1' in the selci
272
# and util makefiles.
277
# Don't need this if using the SUN performance library
278
# need for BLASOPT business because of lapack and other possible missing entries
280
CORE_SUBDIRS_EXTRA = blas lapack
283
DEFINES = -DSOLARIS -DNOAIO
284
# Note that WS6 does not optimize robustly and if using this you must
285
# - put "-nodpend -xvector=no" on FOPTIONS after -fast
286
# - remove "-fsimple=2 -depend -xvector=yes" from FOPTIMIZE.
287
# - remove -lmvec from CORELIBS
288
# to get link with sunperf, type BLASOPT="-xlic_lib=sunperf"
290
# These options are set for WS5
293
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
295
COPTIMIZE = -Kfast_GP=2
296
DEFINES += -DFUJITSU_SOLARIS
300
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
301
# Fujitsu with Parallelnavi compilers
302
# If using Fujitsu compilers on Sun hardware, replace -Kfast_GP=2 with
304
DEFINES += -DFUJITSU_SOLARIS -DEXTNAME
305
FOPTIONS = -Kdalign -w -fw -X9
306
FOPTIMIZE = -Kfast_GP=2
308
LINK.f = $(FC) $(LDFLAGS) $(FOPTIONS) $(FOPTIMIZE)
310
FOPTIONS = -stackvar -dalign
311
FOPTIMIZE = -fast -O5 -fsimple=2 -depend -xvector=yes
312
FDEBUG = -g -O1 -nodepend
313
LINK.f = $(FC) $(LDFLAGS) $(FOPTIONS)
320
CORE_LIBS += -llapack $(BLASOPT) -lblas -lmvec
325
# this creates a static executable
326
#EXTRA_LIBS = -Bdynamic -ldl -lXext -lnsl -Bstatic
329
ifeq ($(BUILDING_PYTHON),python)
330
# Both tk/tcl and BLT need X11 (common)
337
ifeq ($(TARGET),SOLARIS64)
339
# Sun running Solaris 64-bit ... NEEDS WORKSHOP 6.1 or later compilers
340
# due to bugs in earlier compilers. Also cannot yet use sunperf due to
341
# the braindead naming of the 64-bit interface.
343
# You can use either the f77 or f90 compiler BUT if using f90
344
# you'll need to specify -DINTEGER_1='integer*1' in the selci
345
# and util makefiles.
348
SHELL := $(NICE) /bin/sh
349
CORE_SUBDIRS_EXTRA = blas lapack
352
DEFINES = -DSOLARIS -DNOAIO -DSOLARIS64
357
MAKEFLAGS = -j 2 --no-print-directory
358
INSTALL = echo $@ is built
361
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
362
COPTIONS = -Kdalign -KV9FMADD
363
COPTIMIZE = -Kfast_GP=2 -KV9FMADD
364
DEFINES += -DFUJITSU_SOLARIS
366
# SUN/Solaris options for WS6.1
367
COPTIONS = -xarch=v9 -dalign
371
# Fujitsu SPARC systems (thanks to Herbert Fruchtl)
372
# Fujitsu with Parallelnavi compilers
373
# If using Fujitsu compilers on Sun hardware, replace -Kfast_GP=2 with
375
DEFINES += -DFUJITSU_SOLARIS -DEXTNAME
376
FOPTIONS = -Kdalign -w -fw -X9 -KV9FMADD
380
FOPTIONS += -CcdLL8 -CcdII8
382
FOPTIMIZE = -Kfast_GP=2 -KV9FMADD
385
# SUN/Solaris f77 options
386
FOPTIONS = -stackvar -fast -nodepend -xvector=no -xarch=v9a
388
FOPTIONS += -xtypemap=real:64,double:64,integer:32
390
FOPTIONS += -xtypemap=real:64,double:64,integer:64
396
LINK.f = $(FC) $(LDFLAGS) $(FOPTIONS)
399
CORE_LIBS += -llapack -lblas
401
LDOPTIONS = -xs -xildoff
403
CORE_LIBS += $(BLASOPT) -lmvec
405
CORE_LIBS += -llapack -lblas -lmvec
407
CORE_LIBS += -lsocket -lrpcsvc -lnsl
408
EXTRA_LIBS = -ldl -lfsu
415
ifeq ($(TARGET),PURESOLARIS)
417
# NOT TESTED RECENTLY
419
# Sun running Solaris 2.4 or later and if you want to use purecoverage tool you must
421
SHELL := $(NICE) /bin/sh
422
CORE_SUBDIRS_EXTRA = blas lapack
426
MAKEFLAGS = -j 2 --no-print-directory
427
INSTALL = echo $@ is built
428
# -fast introduces many options that must be applied to all files
429
# -stackvar puts locals on t
430
# the stack which seems a good thing
431
# but may need to increase the stacksize at runtime using limit
432
# -xs allows debugging without .o files
433
FOPTIONS = -Nl199 -fast -dalign -stackvar
435
# Under Solaris -O3 is the default with -fast (was -O2 with SUNOS)
436
# -fsimple=2 enables more rearranging of floating point expressions
437
# -depend enables more loop restructuring
438
FOPTIMIZE = -O3 -fsimple=2 -depend
439
# Under Solaris -g no longer disables optimization ... -O2 seems solid
440
# but is slow and impairs debug ... use -O1 for speed and debugability
443
LIBPATH += -L/usr/ucblib
444
LIBPATH += -L/afs/msrc/sun4m_54/apps/purecov
445
OPTIONS = -xildoff -Bstatic
446
CORE_LIBS += -llapack $(BLASOPT) -lblas
447
# First four needed for parallel stuff, last for linking with profiling
448
EXTRA_LIBS = -lsocket -lrpcsvc -lnsl -lucb -lintl -lc -lc -lpurecov_stubs
454
ifeq ($(TARGET),CRAY-T3E)
457
CORE_SUBDIRS_EXTRA = blas lapack # Only a couple of routines not in scilib
459
MAKEFLAGS = -j 1 --no-print-directory
460
INSTALL = @echo $@ is built
464
CPP = /opt/ctl/CC/CC/lib/mppcpp -P -N
469
FOPTIMIZE = -O scalar3,aggress,unroll2,vector3
474
# to debug code you must remove the -s flag unless you know assembler
476
# LDOPTIONS = -g -Xm -lmfastv
477
LDOPTIONS = -Wl"-s" -Xm -lmfastv
479
DEFINES = -DCRAY_T3E -DCRAY_T3D -D__F90__ -DUSE_FCD
481
LINK.f = f90 $(LDFLAGS)
483
CORE_LIBS += -llapack $(BLASOPT) -lblas
486
ifeq ($(BUILDING_PYTHON),python)
487
#** on the NERSC CRAY-T3E you need to:
488
#**** % module load python
489
#**** % module load tcltk
490
EXTRA_LIBS += -ltk -ltcl -lX11
494
FCONVERT = $(CPP) $(CPPFLAGS) $< | sed '/^\#/D' > $*.f
498
ifeq ($(TARGET),SGITFP)
500
# SGI power challenge
502
# CORE_SUBDIRS_EXTRA are those machine specific libraries required
505
# Optimization options const_copy_limit=18000, global_limit=18000 and
506
# fprop_limit=1200 added to FOPTIMIZE to allow full optimization of the
507
# MD module nwArgos on SGI Power Indigo^2
509
# RJH ... note that fprop_limit is not supported by 7.0 compilers
512
# Increased fprop_limit to 1750
513
# Removed -j 12 from MAKEFLAGS
514
# Added -lnwcutil to core libraries
517
# Increased const_copy_limit and global_limit to 18500
519
# RJH ... from Roberto ... on the R10k TENV=3 may cause very expensive
520
# interrupts (he recommends 1 when we go to 10K, but 3 is good for 8k)
521
# ... also going to 10K use -SWP:if_conversion=OFF
522
# ... in going to 6.1/2 then should also set -SWP:*ivdep*=ON/OFF
523
# (default changed from agressive to conservative and we want
525
# ... sometimes the default KAP parameters are best (only for critical
527
# ... -dr=AKC forces it to recognize all compiler directives (C=CRAY
528
# not on by default) ... can put everywhere.
529
# ... on -WK also add -r=3 (level of reduction) even with -o=1
530
# ... could benefit from -Wk on FOPTIMIZE ... actually have it on now.
531
# ... roundoff/ieee only modify pipelining which happens only at O3
534
# Added -lnwcutil to core libraries (again!)
537
# Fortran optimization limits: const_copy_limit=20000
542
# Replaced -DLongInteger with -DEXT_INT for consistency with GA, DRA, PEIGS ...
544
# JN 99/05/26: MA now has its own library -lma
547
# From Gerardo Cisneros
548
# - took out obsolete options
549
# "-OPT:fold_arith_limit=4000"
550
# "-OPT:fprop_limit=2000"
551
# "-OPT:global_limit=20000"
552
# "-SWP:if_conversion=OFF"
556
CORE_SUBDIRS_EXTRA = blas lapack
561
INSTALL = @echo nwchem is built
562
MAKEFLAGS = -j 4 --no-print-directory
564
# RJH ... moved -OPT... to the FOPTIMIZE macro since it's an optimization!
565
# (that breaks things).
566
FOPTIONS = -d8 -i8 -mips4 -align64 -64 -r8 -G 0
567
COPTIONS = -fullwarn -mips4 -64
569
#optimization flags for R8000 (IP21)
570
# FOPTIMIZE_8K = -O3 -OPT:fold_arith_limit=4000:const_copy_limit=20000:global_limit=20000:fprop_limit=2000 -TENV:X=3 -WK,-so=1,-o=1,-r=3,-dr=AKC
571
FOPTIMIZE_8K = -O3 -OPT:const_copy_limit=20000 -TENV:X=3 -WK,-so=1,-o=1,-r=3,-dr=AKC
572
FVECTORIZE_8K = -O3 -TENV:X=3 -WK,-dr=AKC
574
#optimization flags for R10000 (IP28)
575
FOPTIMIZE_10K = -O3 -OPT:const_copy_limit=20000:Olimit=4800 -TENV:X=1 -WK,-so=1,-o=1,-r=3,-dr=AKC
576
FVECTORIZE_10K = -O3 -TENV:X=1 -WK,-dr=AKC
578
#optimization flags for R12000 (IP30)
579
FOPTIMIZE_12K = -O3 -OPT:const_copy_limit=20000:Olimit=4800 -TENV:X=1 -WK,-so=1,-o=1,-r=3,-dr=AKC
580
FVECTORIZE_12K = -O3 -TENV:X=1 -WK,-dr=AKC
585
ifeq ($(NWCHEM_TARGET_CPU),R12000)
586
FOPTIMIZE = $(FOPTIMIZE_12K)
587
FVECTORIZE = $(FVECTORIZE_12K)
589
ifeq ($(NWCHEM_TARGET_CPU),R10000)
590
FOPTIMIZE = $(FOPTIMIZE_10K)
591
FVECTORIZE = $(FVECTORIZE_10K)
593
ifeq ($(NWCHEM_TARGET_CPU),R8000)
594
FOPTIMIZE = $(FOPTIMIZE_8K)
595
FVECTORIZE = $(FVECTORIZE_8K)
597
FOPTIMIZE += -OPT:roundoff=3:IEEE_arithmetic=3
598
FVECTORIZE += -OPT:roundoff=3:IEEE_arithmetic=3
600
DEFINES = -DSGI -DSGITFP -DEXT_INT
601
CORE_LIBS += -llapack $(BLASOPT) -lblas
602
ifeq ($(BUILDING_PYTHON),python)
603
#needed for python 2.2.2
604
EXTRA_LIBS += -lpthread
611
ifeq ($(TARGET),SGI_N32)
613
# SGI 64-bit MIPS-4 processors (R5k, R8k, R10k) under IRIX > 6.0 (ABI)
616
# -n32 allows to use 64-bit processor features and 32-bit address space
617
# 32-bit address space - use SGITFP if 64-bit addresses needed
619
# SGI BLAS can be used directly
621
CORE_SUBDIRS_EXTRA = lapack
627
INSTALL = @echo nwchem is built
628
MAKEFLAGS = -j 4 --no-print-directory
629
DEFINES = -DSGI -DSGI_N32
631
# RJH ... moved -OPT... to the FOPTIMIZE macro since it's an optimization!
632
# (that breaks things).
633
FOPTIONS = -n32 -mips4 -G 0
634
COPTIONS = -n32 -mips4 -fullwarn
636
#optimization flags for R8000 (IP21)
637
FOPTIMIZE_8K = -O3 -OPT:const_copy_limit=20000 -TENV:X=3 -WK,-so=1,-o=1,-r=3,-dr=AKC
638
FVECTORIZE_8K = -O3 -TENV:X=3 -WK,-dr=AKC
640
#optimization flags for R10000 (IP28)
641
FOPTIMIZE_10K = -O3 -OPT:const_copy_limit=20000 -TENV:X=1 -WK,-so=1,-o=1,-r=3,-dr=AKC
642
FVECTORIZE_10K = -O3 -TENV:X=1 -WK,-dr=AKC
644
#optimization flags for R12000 (IP27)
645
# FOPTIMIZE_12K = -O -r12000 -TARG:platform=ip27 -LNO:cs2=8M -TENV:X=3
646
# FOPTIMIZE_12K = -O3 -r12000 -TARG:platform=ip27 -LNO:prefetch=1:cs2=8M:fusion=2:fission=2 -LIST:all_options -OPT:swp=ON:space=ON
647
# FVECTORIZE_12K = -O3 -r12000 -TARG:platform=ip27 -LNO:prefetch=1:cs2=8M:fusion=2:fission=2 -LIST:all_options -OPT:swp=ON:space=ON
648
# The above options are some Edo used to optimize for a particular machine
649
FOPTIMIZE_12K = -O3 -OPT:const_copy_limit=20000 -TENV:X=1 -WK,-so=1,-o=1,-r=3,-dr=AKC
650
FVECTORIZE_12K = -O3 -TENV:X=1 -WK,-dr=AKC
655
ifeq ($(NWCHEM_TARGET_CPU),R12000)
656
FOPTIMIZE = $(FOPTIMIZE_12K)
657
FVECTORIZE = $(FVECTORIZE_12K)
659
ifeq ($(NWCHEM_TARGET_CPU),R10000)
660
FOPTIMIZE = $(FOPTIMIZE_10K)
661
FVECTORIZE = $(FVECTORIZE_10K)
663
ifeq ($(NWCHEM_TARGET_CPU),R8000)
664
FOPTIMIZE = $(FOPTIMIZE_8K)
665
FVECTORIZE = $(FVECTORIZE_8K)
667
FOPTIMIZE += -OPT:roundoff=3:IEEE_arithmetic=3
668
FVECTORIZE += -OPT:roundoff=3:IEEE_arithmetic=3
670
ifeq ($(BUILDING_PYTHON),python)
671
# needed if python was compiled with gcc (common)
672
EXTRA_LIBS += -L/msrc/apps/gcc-2.8.1/lib/gcc-lib/mips-sgi-irix6.5/2.8.1 -lgcc
673
# needed here if using a python version with tk/tcl extensions (common)
674
EXTRA_LIBS += -L/msrc/apps/lib -ltk8.0 -ltcl8.0
675
# needed here if using a python version built with BLT extensions
676
# EXTRA_LIBS += -L/msrc/apps/lib -lBLT
677
# Both tk/tcl and BLT need X11 (common)
681
CORE_LIBS += -llapack $(BLASOPT) -lblas
682
ifeq ($(BUILDING_PYTHON),python)
683
#needed for python 2.2.2
684
EXTRA_LIBS += -lpthread
688
ifeq ($(TARGET),HPUX)
692
# removed reference to MLIB since 8.3 version of MLIB
693
# does not support +ppu
696
CORE_SUBDIRS_EXTRA = blas lapack
697
MAKEFLAGS = -j 1 --no-print-directory
701
LDOPTIONS = -g -Wl,+vallcompatwarnings +U77
702
LDOPTIONS += +DA2.0 +DS2.0 +O2
704
LINK.f = f90 $(LDFLAGS)
705
CORE_LIBS += $(BLASOPT) -llapack -lblas -lm
707
FOPTIONS = +ppu -Wl,-a,archive
708
COPTIONS = -Aa -D_HPUX_SOURCE +e
709
FOPTIMIZE = +O2 +Onolimit
710
FOPTIMIZE += +DA2.0 +DS2.0a +Odataprefetch +Onofltacc +Onoinitcheck
711
FOPTIMIZE += +Oprocelim +Oentrysched +Ofastaccess
712
FVECTORIZE = +Oall +Onofltacc
716
DEFINES = -DHPUX -DEXTNAME
717
ifeq ($(BUILDING_PYTHON),python)
718
# needed if python was compiled with gcc (common)
719
EXTRA_LIBS += -L/usr/local/lib/gcc-lib/hppa1.0-hp-hpux11.00/2.8.0 -lgcc
724
ifeq ($(TARGET),HPUX64)
729
CORE_SUBDIRS_EXTRA = blas lapack
730
_CPU = $(shell uname -m )
731
MAKEFLAGS = -j 1 --no-print-directory
735
LDOPTIONS = -Wl,+vallcompatwarnings +U77
736
CORE_LIBS += -llapack $(BLASOPT) -lblas -lm
739
FOPTIONS = +ppu #+U77
740
COPTIONS = -Aa -D_HPUX_SOURCE +e
742
FOPTIONS += +DD64 +DSitanium2 +Ofltacc=relaxed +Olibcalls +Onolimit +FPD
745
FVECTORIZE = +Ofast +O3 +Onoptrs_to_globals +Oloopblock
751
FVECTORIZE = +Oall +Onofltacc
757
DEFINES = -DHPUX -DEXTNAME -DHPUX64
774
CORE_SUBDIRS_EXTRA = lapack blas
782
MAKEFLAGS = -j 5 --no-print-directory
783
INSTALL = @echo $@ is built
784
CPP = /usr/lib/cpp -P
786
FOPTIONS = -qEXTNAME -qnosave -qalign=4k -qxlf77=leadzero
789
# -qstrict required with -O3 (according to Edo)
790
# -qfloat=rsqrt gives faster square roots (off by -qstrict)
791
# -qfloat=fltint gives faster real-integer conversion (off by -qstrict)
792
# -qhot seems to break a lot of things so don't ever use it
793
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000 -qarch=auto -qtune=auto -NS2048
795
FOPTIMIZE += -qfloat=rsqrt:fltint
797
COPTIMIZE = -O -qarch=auto -qtune=auto
803
DEFINES = -DIBM -DAIX -DEXTNAME
804
CORE_LIBS += $(BLASOPT)
810
LIBPATH += -L/usr/lib
812
LDOPTIONS += -bmaxstack:0x60000000 -bmaxdata:0x60000000 -bloadmap:nwchem.lapi_map
813
CORE_LIBS += -llapack $(BLASOPT) -lblas \
814
-brename:.daxpy_,.daxpy \
815
-brename:.dcopy_,.dcopy \
816
-brename:.ddot_,.ddot \
817
-brename:.dgemm_,.dgemm \
818
-brename:.dgemv_,.dgemv \
819
-brename:.dgesv_,.dgesv \
820
-brename:.dgetrf_,.dgetrf \
821
-brename:.dgetrs_,.dgetrs \
822
-brename:.dlaset_,.dlaset \
823
-brename:.dpotrf_,.dpotrf \
824
-brename:.dpotri_,.dpotri \
825
-brename:.dscal_,.dscal \
826
-brename:.dspsvx_,.dspsvx \
827
-brename:.idamax_,.idamax \
828
-brename:.dswap_,.dswap \
829
-brename:.dger_,.dger \
830
-brename:.dtrsm_,.dtrsm \
831
-brename:.dnrm2_,.dnrm2 \
832
-brename:.dtrmm_,.dtrmm \
833
-brename:.drot_,.drot \
834
-brename:.dasum_,.dasum \
835
-brename:.dtrmv_,.dtrmv \
836
-brename:.dspmv_,.dspmv \
837
-brename:.dspr_,.dspr \
838
-brename:.dsyrk_,.dsyrk \
839
-brename:.dsyr2k_,.dsyr2k \
840
-brename:.dsymv_,.dsymv \
841
-brename:.lsame_,.lsame \
842
-brename:.xerbla_,.xerbla \
843
-brename:.zgemm_,.zgemm \
844
-brename:.dsyr2_,.dsyr2 \
845
-brename:.dznrm2_,.dznrm2 \
846
-brename:.zaxpy_,.zaxpy \
847
-brename:.zcopy_,.zcopy \
848
-brename:.zdotc_,.zdotc \
849
-brename:.zdscal_,.zdscal \
850
-brename:.zgemv_,.zgemv \
851
-brename:.zgerc_,.zgerc \
852
-brename:.zhemv_,.zhemv \
853
-brename:.zher2_,.zher2 \
854
-brename:.zher2k_,.zher2k \
855
-brename:.zscal_,.zscal \
856
-brename:.zswap_,.zswap \
857
-brename:.ztrmm_,.ztrmm \
858
-brename:.ztrmv_,.ztrmv \
859
-brename:.izamax_,.izamax
860
# -brename:.zherk_,.zherk \
861
# -brename:.zhemm_,.zhemm \
862
# -brename:.ztrsm_,.ztrsm \
863
# -brename:.dtrsv_,.dtrsv \
864
# -brename:.ztrsv_,.ztrsv
865
# -brename:.dsymm_,.dsymm \
868
##comment out from dtrmm_ inclusive
871
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
875
ifeq ($(TARGET),IBM64)
878
# tested on ecs1 May 10 2000 AIX 4.3.3.10
879
# does not run on AIX 4.3.2.1 (skunkworks)
881
ifeq ($(LAPACK_LIB),)
882
CORE_SUBDIRS_EXTRA += lapack
885
CORE_SUBDIRS_EXTRA += blas
894
MAKEFLAGS = -j 11 --no-print-directory
895
INSTALL = @echo $@ is built
896
CPP = /usr/lib/cpp -P
898
FOPTIONS = -qEXTNAME -qnosave -qalign=4k -q64 -qxlf77=leadzero
900
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000 -qarch=auto -qtune=auto
902
FDEBUG = -O2 -qmaxmem=8192
904
FOPTIMIZE += -qfloat=rsqrt:fltint
906
XLF8= $(shell /usr/bin/lslpp -l xlfcmp 2>&1|grep COMM|head -n 1| awk ' / [8-9]./ {print "Y"};/[ ][1][0-9]./ {print "Y"}')
908
FVECTORIZE= -O3 -qstrict -qtune=auto -qarch=auto -qcache=auto -qalign=natural -qnozerosize -qlargepage -qnozerosize -qipa=level=2
909
#old FOPTIMIZE = -O4 -NQ40000 -NT80000 -qarch=auto -qtune=auto
910
FOPTIMIZE = -O3 -qarch=auto -qtune=auto
911
#adding -qstrict to fix linking problem for v10.1
912
FOPTIMIZE += -qstrict# -qipa -qhot -qlargepage -qessl
914
FOPTIMIZE += -qfloat=rsqrt:fltint
915
FVECTORIZE += -qfloat=rsqrt:fltint
917
COPTIMIZE = -O -qmaxmem=8192
919
DEFINES = -DIBM -DAIX -DEXTNAME
920
DEFINES += -DCHKUNDFLW
921
LIBPATH += -L/usr/lib -L/lib
923
FOPTIONS += -qintsize=4
925
FOPTIONS += -qintsize=8
932
LDOPTIONS += -bloadmap:nwchem.ibm64map -bbigtoc # bigtoc requires bmaxdata
933
LDOPTIONS += -bmaxstack:0x80000000 -bmaxdata:0x200000000 # this limits MA to 8GB
934
ifeq ($(LAPACK_LIB),)
935
CORE_LIBS += -llapack
937
CORE_LIBS += $(BLASOPT)
945
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
950
ifeq ($(TARGET),LAPI)
952
CORE_SUBDIRS_EXTRA = lapack blas
960
MAKEFLAGS = -j 1 --no-print-directory
961
INSTALL = @echo $@ is built
962
CPP = /usr/lib/cpp -P
966
LDOPTIONS = -lc_r -lxlf90_r -lm_r -qEXTNAME -qnosave -qalign=4k -g
967
LINK.f = mpcc_r $(LDFLAGS)
968
FOPTIONS = -qEXTNAME -qnosave -qalign=4k -qxlf77=leadzero
973
# -qinitauto=7F # note that grad_force breaks with this option
975
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000 -NS10000 -qipa=level=2
977
FOPTIMIZE += -qfloat=rsqrt:fltint
980
FC += -qarch=auto -qtune=auto -qcache=auto -qthreaded
981
CC += -qarch=auto -qtune=auto -qcache=auto
984
DEFINES = -DLAPI -DSP1 -DAIX -DEXTNAME
985
DEFINES += -DCHKUNDFLW
993
CORE_LIBS += -lpessl -lblacs
995
# Need ESSL before our own BLAS library but still need our
996
# own stuff for misc. missing routines
998
CORE_LIBS += -llapack -lblas
1000
LDOPTIONS += -bloadmap:nwchem.lapimap -bbigtoc
1001
LDOPTIONS += -bmaxstack:0x60000000 -bmaxdata:0x60000000 # needed because of bigtoc
1004
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
1008
ifeq ($(TARGET),LAPI64)
1010
CORE_SUBDIRS_EXTRA = lapack blas
1015
MAKEFLAGS = -j 3 --no-print-directory
1016
INSTALL = @echo $@ is built
1017
CPP = /usr/lib/cpp -P
1021
LDOPTIONS = -lc_r -lxlf90_r -lm_r -qEXTNAME -qnosave -q64 -bloadmap:nwchem.lapi64_map $(LAPI64LIBS)
1022
LINK.f = mpxlf_r $(LDFLAGS)
1024
FOPTIONS = -qEXTNAME -qnosave -q64 -qalign=4k -qxlf77=leadzero -qthreaded
1027
FOPTIMIZE = -O3 -qstrict -NQ40000 -NT80000
1028
FOPTIMIZE += -qarch=auto -qtune=auto -qcache=auto
1030
FOPTIMIZE += -qfloat=rsqrt:fltint
1033
XLF8= $(shell xlf -qversion 2>&1|grep Version|head -1| awk ' / [8-9]./ {print "Y"};/[ ][1][0-9]./ {print "Y"}')
1034
XLF10 = $(shell xlf -qversion 2>&1|grep Version|head -1| awk ' / 10./ {print "Y"}')
1035
XLF11 = $(shell xlf -qversion 2>&1|grep Version|head -1| awk ' / 11./ {print "Y"}')
1037
FVECTORIZE= -O3 -qstrict -qtune=auto -qarch=auto -qcache=auto -qalign=natural -qnozerosize -qlargepage -qnozerosize -qipa=level=2
1038
FOPTIMIZE = -O4 -NQ40000 -NT80000 -qarch=auto -qtune=auto
1039
FOPTIMIZE += -qipa -qhot -qlargepage -qessl
1040
FOPTIONS += -blpdata
1041
FOPTIMIZE += -qfloat=rsqrt:fltint
1042
FVECTORIZE += -qfloat=rsqrt:fltint
1045
DEFINES = -DLAPI64 -DEXTNAME -DLAPI -DSP1 -DAIX
1046
DEFINES += -DCHKUNDFLW
1048
FOPTIONS += -qintsize=4
1050
FOPTIONS += -qintsize=8
1052
DEFINES += -DEXT_INT
1053
CORE_LIBS += $(BLASOPT) -llapack -lblas
1054
LDOPTIONS += -bloadmap:nwchem.lapi64map -bbigtoc
1055
LDOPTIONS += -bmaxstack:0x80000000 -bmaxdata:0x80000000 # needed because of bigtoc
1056
# LDOPTIONS += -bmaxstack:0xe0000000 -bmaxdata:0xe0000000 # this for large memory
1060
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
1064
ifeq ($(TARGET),DECOSF)
1069
# Replaced -DLongInteger with -DEXT_INT for consistency with GA, DRA, PEIGS ...
1071
CORE_SUBDIRS_EXTRA = blas lapack
1073
# SHELL := $(NICE) /bin/sh
1077
CPP = /usr/bin/cpp -P -C
1079
INSTALL = @echo nwchem is built
1080
MAKEFLAGS = -j 1 --no-print-directory
1082
# -fpe2 and call to util/dec_fpe.f from nwchem.F necessary to avoid
1083
# braindead alpha undflows inside texas (c6h6 6-31g)
1085
# assume noaccuracy_sensitive was breaking the code in recent versions (EA)
1087
FOPTIONS = -align dcommons -math_library fast -fpe2 -check nounderflow -check nopower -check nooverflow -warn argument_checking -warn unused -automatic -math_library fast
1091
LINK.f = f77 $(LDFLAGS)
1092
FOPTIMIZE = -O4 -tune host -arch host
1093
FVECTORIZE = -fast -O4 -tune host -arch host
1102
DEFINES += -DEXT_INT
1103
CORE_LIBS += -llapack $(BLASOPT) -lblas
1105
ifeq ($(BUILDING_PYTHON),python)
1109
ifeq ($(TARGET),MACX)
1116
CORE_SUBDIRS_EXTRA = blas
1118
CORE_SUBDIRS_EXTRA = blas lapack
1120
_CPU = $(shell machine )
1122
INSTALL = @echo nwchem is built
1124
MAKEFLAGS = -j 1 --no-print-directory
1130
FOPTIONS = -qextname -qfixed -qnosave -qalign=4k
1131
FOPTIONS += -NQ40000 -NT80000 -NS2048 -qmaxmem=8192 -qxlf77=leadzero
1132
FOPTIMIZE= -O3 -qstrict -qarch=auto -qtune=auto -qcache=auto -qcompact
1134
FOPTIMIZE += -qfloat=rsqrt:fltint
1136
FVECTORIZE += $(FOPTIMIZE) -qunroll=yes
1137
FDEBUG= -O2 -qcompact
1138
DEFINES +=-DXLFLINUX -DCHKUNDFLW
1139
FOPTIONS += $(INCLUDES) -WF,"$(DEFINES)" $(shell echo $(LIB_DEFINES) | sed -e "s/-D/-WF,-D/g" | sed -e 's/\"/\\\"/g' | sed -e "s/\'/\\\'/g")
1142
#g77, only decent one form Fink http://fink.sf.net
1143
#gcc version 3.4 20031015 (experimental)
1144
_G77V33= $(shell g77 -v 2>&1|egrep spec|head -n 1|awk ' /3.3/ {print "Y"}')
1146
FOPTIONS = -fno-second-underscore -fno-globals -Wno-globals
1147
FOPTIMIZE = -O3 -fno-inline-functions -funroll-loops
1148
FOPTIMIZE += -falign-loops=16 -falign-jumps=16 -falign-functions=16
1149
FOPTIMIZE += -ffast-math -mpowerpc-gpopt
1150
FOPTIMIZE += -maltivec
1152
FOPTIONS += -fno-force-mem
1153
FOPTIMIZE += -fno-force-mem
1155
ifeq ($(_CPU),ppc970)
1157
FOPTIMIZE += -mtune=970 -mcpu=970 -mpowerpc64
1159
ifeq ($(_CPU),ppc7450)
1161
FOPTIMIZE += -mtune=7450 -mcpu=7450
1164
ifeq ($(FC),gfortran)
1166
#gcc version 4.2.0 200512 (experimental)
1167
LINK.f = gfortran $(LDFLAGS)
1168
FOPTIONS = -Wextra #-Wunused #-ffast-math
1169
FOPTIMIZE = -O2 -ffast-math -Wuninitialized
1170
DEFINES += -DGFORTRAN
1171
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c22)
1173
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c24)
1174
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
1176
ifeq ($(GNU_GE_4_6),true)
1180
FOPTIONS += -fopenmp
1181
LDOPTIONS += -fopenmp
1182
DEFINES += -DUSE_OPENMP
1184
ifeq ($(_CPU),ppc970)
1186
FVECTORIZE = -ffast-math -O2 -ftree-vectorize
1187
FVECTORIZE += -ftree-vectorizer-verbose=1
1188
FOPTIMIZE += -mtune=970 -mcpu=970 -mpowerpc64
1189
FVECTORIZE += -mtune=970 -mcpu=970 -mpowerpc64
1191
ifeq ($(_CPU),ppc7450)
1193
FVECTORIZE = -ffast-math -O2 -ftree-vectorize
1194
FVECTORIZE += -ftree-vectorizer-verbose=1
1195
FOPTIMIZE += -fprefetch-loop-arrays #-ftree-loop-linear
1196
FOPTIMIZE += -mtune=7450 -mcpu=7450
1199
#gcc version 4.2.0 200608 (experimental)
1200
# FOPTIONS= -malign-double# this break with gfort 4.2 and later http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29562
1201
FOPTIMIZE+= -funroll-all-loops -mtune=native
1202
FVECTORIZE=-O3 -ffast-math -mtune=native -mfpmath=sse -msse3 -ftree-vectorize -ftree-vectorizer-verbose=1 -fprefetch-loop-arrays -funroll-all-loops
1207
#possible segv with use of zdotc (e.g. with GOTO BLAS)
1208
#http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20178
1209
FOPTIONS += -ff2c -fno-second-underscore
1212
DEFINES += -DCHKUNDFLW -DGCC4
1217
# LINK.f = ifort $(LDFLAGS)
1218
FOPTIONS = -align -mp1 -w -g -vec-report1
1222
FOPTIMIZE = -O3 -prefetch -unroll
1224
DEFINES += -DIFCLINUX
1227
COPTIONS += -qlanglvl=extended
1229
COPTIONS = -Wall -no-cpp-precomp
1238
CORE_LIBS += $(BLASOPT) -Wl,-framework -Wl,vecLib -lblas
1240
CORE_LIBS += -llapack $(BLASOPT) -lblas
1243
LDOPTIONS = -Wl,-multiply_defined -Wl,warning
1245
_GCC4= $(shell gcc -v 2>&1|egrep spec|head -n 1|awk ' / 3./ {print "N";exit}; / 2./ {print "N";exit};{print "Y"}')
1249
EXTRA_LIBS += -lm -lcc_dynamic
1254
_V104=$(shell uname -v 2>&1|awk ' /Version 7./ {print "N";exit}; /Version 8./ {print "Y";exit}')
1256
EXTRA_LIBS +=-lSystemStubs
1260
ifeq ($(TARGET),MACX64)
1268
CORE_SUBDIRS_EXTRA =
1271
@echo The Apple supplied vector math library does not support 8-byte integers
1272
@echo You must also set USE_64TO32 and do a "make 64_to_32" to change the source code
1277
CORE_SUBDIRS_EXTRA += blas
1279
ifeq ($(LAPACK_LIB),)
1280
CORE_SUBDIRS_EXTRA += lapack
1283
_CPU = $(shell machine )
1285
INSTALL = @echo nwchem is built
1287
MAKEFLAGS = -j 1 --no-print-directory
1290
ifeq ($(FC),gfortran)
1293
LINK.f = gfortran $(LDFLAGS)
1294
FOPTIONS = -Wextra #-Wunused #-ffast-math
1295
FOPTIONS += -fdefault-integer-8
1296
FOPTIMIZE = -O2 -ffast-math -Wuninitialized
1297
DEFINES += -DGFORTRAN -DGCC4
1298
DEFINES += -DEXT_INT
1300
FOPTIMIZE+= -funroll-all-loops -mtune=native
1301
FVECTORIZE=-O3 -ffast-math -mtune=native -mfpmath=sse -msse3 -ftree-vectorize -ftree-vectorizer-verbose=1 -fprefetch-loop-arrays -funroll-all-loops
1304
GNUMAJOR=$(shell $(FC) -dumpversion | cut -f1 -d.)
1305
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c22)
1307
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c24)
1308
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
1309
ifeq ($(GNU_GE_4_6),true)
1320
CORE_LIBS += $(BLASOPT) -Wl,-framework -Wl,vecLib -lblas
1322
ifeq ($(LAPACK_LIB),)
1323
CORE_LIBS += -llapack
1325
CORE_LIBS += $(BLASOPT)
1330
_GCC4= $(shell gcc -v 2>&1|egrep spec|head -n 1|awk ' / 3./ {print "N";exit}; / 2./ {print "N";exit};{print "Y"}')
1334
EXTRA_LIBS += -lm -lcc_dynamic
1341
ifeq ($(TARGET),$(findstring $(TARGET),LINUX LINUX64 CYGNUS CYGWIN INTERIX))
1344
# Linux or Cygwin under Windows running on an x86 using g77
1347
SHELL := $(NICE) /bin/sh
1348
CORE_SUBDIRS_EXTRA = blas lapack
1351
MAKEFLAGS = -j 1 --no-print-directory
1352
INSTALL = @echo $@ is built
1353
CPP = gcc -E -nostdinc -undef -P
1354
FCONVERT = (/bin/cp $< /tmp/$$$$.c; \
1355
$(CPP) $(CPPFLAGS) /tmp/$$$$.c | sed '/^$$/d' > $*.f; \
1356
/bin/rm -f /tmp/$$$$.c) || exit 1
1359
LINUXCPU_ = $(shell uname -m |\
1360
awk ' /sparc/ { print "sparc" }; /i*86/ { print "x86" }; /ppc*/ { print "ppc"} ' )
1362
ifeq ($(BUILDING_PYTHON),python)
1363
# EXTRA_LIBS += -ltk -ltcl -L/usr/X11R6/lib -lX11
1364
# EXTRA_LIBS += -L/home/edo/tcltk/lib/LINUX -ltk8.3 -ltcl8.3 -L/usr/X11R6/lib -lX11 -ldl
1365
# needed if python was built with pthread support
1366
EXTRA_LIBS += -lz -lreadline -lncurses -lnwcutil -lpthread -lutil -ldl -lsysfs
1369
DEFINES = -DLINUX -DGCC4 -DGCC46
1370
FOPTIONS += -fno-second-underscore -Wall
1371
FOPTIONS += -ffixed-line-length-72 -ffixed-form
1373
FOPTIONS += -Wno-globals
1378
ifeq ($(FC),gfortran)
1379
FOPTIONS = -Wextra -ffast-math #-Wunused
1380
FOPTIMIZE += -ffast-math -Wuninitialized
1382
DEFINES += -DGFORTRAN
1387
ifeq ($(LINUXCPU),x86)
1388
ifeq ($(TARGET),CYGNUS)
1391
ifeq ($(TARGET),CYGWIN)
1392
DEFINES += -DCYGWIN -DCYGNUS
1395
_CPU_ = $(shell uname -m )
1396
_G77V33= $(shell g77 -v 2>&1|egrep spec|head -n 1|awk ' /3.3/ {print "Y"}')
1399
FOPTIONS += -fno-second-underscore
1400
FOPTIONS += -fno-f90 -ffixed-line-length-72 -ffixed-form
1401
FOPTIMIZE += -O2 -malign-double -finline-functions
1402
COPTIONS += -Wall -malign-double
1404
FOPTIONS += -malign-double -fno-globals -Wno-globals -fno-silent #-Wunused
1405
FOPTIMIZE += -Wuninitialized -ffast-math -funroll-loops -fstrength-reduce
1406
FOPTIMIZE += -fno-move-all-movables -fno-reduce-all-givs
1407
FOPTIMIZE += -fforce-addr
1408
# see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13037
1409
# for atomscf/orderd.f (bug report by Kirill Smelkov)
1411
FOPTIONS += -fno-force-mem
1412
FOPTIMIZE += -fno-force-mem
1414
FOPTIMIZE += -fforce-mem
1420
_GOTSSE2= $(shell cat /proc/cpuinfo | egrep sse2 | tail -n 1 | awk ' /sse2/ {print "Y"}')
1421
ifeq ($(_GOTSSE2),Y)
1427
COPTIONS = -march=i686
1430
COPTIMIZE +=-march=pentium4 -mcpu=pentium4 #-msse2 -mfpmath=sse
1431
# COPTIMIZE +=-fprefetch-loop-arrays -minline-all-stringops -fexpensive-optimizations
1432
FOPTIMIZE +=-march=pentium4 -mcpu=pentium4# -msse2 -mfpmath=sse
1433
# FOPTIMIZE +=-fprefetch-loop-arrays -minline-all-stringops -fexpensive-optimizations
1435
FOPTIMIZE += -march=i686
1436
COPTIONS = -Wall -march=i686 -malign-double
1440
COPTIONS += -march=$(_CPU)
1441
FOPTIONS += -march=$(_CPU)
1445
FOPTIONS = -fno-second-underscore
1446
COPTIONS = -Wall -malign-double
1448
FOPTIONS += -march=athlon
1449
COPTIONS += -march=athlon
1451
FOPTIONS += -march=k6
1452
COPTIONS += -march=k6
1457
DEFINES += -DPGLINUX
1458
# added -Kieee to get dlamc1 to work on pgf77 3.1-3 EA Jun 8th 2000
1459
FOPTIONS = -Mdalign -Minform,warn -Mnolist -Minfo=loop -Munixlogical -Kieee
1464
FOPTIONS += -tp p6 -Mvect=prefetch
1467
FOPTIONS += -tp piv -Mcache_align -Mvect=prefetch
1469
FOPTIMIZE = -O2 -Mvect=assoc,cachesize:262144 -Munroll -Mnoframe
1478
ifeq ($(FC),gfortran)
1480
DEFINES += -DGFORTRAN
1483
FOPTIONS = -align -mp1 -w -g -vec-report1
1487
_IFCV7= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk '/7./ {print "Y"; exit}')
1488
_IFCV10= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk '/10./ {print "Y"; exit}')
1496
FOPTIONS += -fpe-all=0 -traceback #-fp-model precise
1499
FOPTIMIZE = -O3 -prefetch -unroll
1501
FOPTIMIZE += -tpp5 -xi # this are for PentiumII
1504
FOPTIMIZE += -xM # this are for Athlon
1507
FOPTIMIZE += -tpp6 -xK # this are for PentiumIII
1510
FOPTIMIZE += -tpp7 -xW # this are for PentiumIV
1512
DEFINES += -DIFCLINUX
1514
FOPTIMIZE += -ansi_alias-
1517
ifeq ($(_FC),gfortran)
1518
#gcc version 4.1.0 20050525 (experimental)
1519
LINK.f = gfortran $(LDFLAGS)
1520
FOPTIONS = -Wextra -ffast-math #-Wunused
1521
FOPTIMIZE = -O2 -ffast-math -Wuninitialized
1523
FOPTIONS += -march=pentium4 -mtune=pentium4
1524
FVECTORIZE = $(FOPTIMIZE) -O3 -ftree-vectorize
1525
FVECTORIZE += -ftree-vectorizer-verbose=1
1526
# FOPTIMIZE += -fprefetch-loop-arrays -ftree-loop-linear
1528
FOPTIONS += -ffloat-store
1531
#possible segv with use of zdotc (e.g. with GOTO BLAS)
1532
#http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20178
1533
FOPTIONS += -ff2c -fno-second-underscore
1536
DEFINES += -DCHKUNDFLW -DGCC4
1537
GNUMAJOR=$(shell $(FC) -dumpversion | cut -f1 -d.)
1538
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c22)
1540
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c24)
1541
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
1542
ifeq ($(GNU_GE_4_6),true)
1549
COPTIONS = -mp1 -w -g -vec-report1
1550
COPTIMIZE = -O3 -unroll
1552
COPTIMIZE += -tpp5 -xi # this are for PentiumII
1555
COPTIMIZE += -tpp6 -xK # this are for PentiumIII
1558
COPTIMIZE += -tpp7 -xW # this are for PentiumIV
1563
ifeq ($(LINUXCPU),ppc)
1564
# this are for PowerPC
1573
ifeq ($(FC),blrts_xlf)
1577
FOPTIONS = -q32 -qextname -qfixed
1578
FOPTIONS += -NQ40000 -NT80000 -NS2048 -qmaxmem=8192 -qxlf77=leadzero
1579
FOPTIMIZE= -O3 -qstrict -qfloat=fltint
1580
ifeq ($(FC),blrts_xlf)
1581
FOPTIMIZE+= -qarch=440 -qtune=440
1583
FOPTIMIZE+= -qarch=auto -qtune=auto
1587
DEFINES += -DXLFLINUX
1588
CPP=/usr/bin/cpp -P -C -traditional
1589
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
1592
FOPTIONS = -fno-second-underscore -fno-globals -Wno-globals
1598
ifeq ($(CC),blrts_xlc)
1602
COPTIONS += -q32 -qlanglvl=extended
1607
LDOPTIONS += -Wl,--relax #-v
1610
LINK.f = $(FC) $(FOPTIONS) $(LDFLAGS)
1611
ifeq ($(LINUXCPU),x86)
1613
LDOPTIONS = -g -Wl,--export-dynamic
1620
EXTRA_LIBS += -Vaxlib
1623
EXTRA_LIBS += -lsvml
1625
EXTRA_LIBS += #-static
1626
LDOPTIONS = -g -Wl,--export-dynamic
1628
LDOPTIONS = -Xlinker --export-dynamic
1629
# LDOPTIONS = --Xlinker -O -Xlinker -static
1634
#EXTRA_LIBS +=-lefence # link against Electricfence
1636
CORE_LIBS += -llapack $(BLASOPT) -lblas
1638
# end of Linux, Cygnus
1641
ifneq ($(TARGET),LINUX)
1642
ifeq ($(TARGET),$(findstring $(TARGET),LINUX64 CATAMOUNT))
1643
#ifeq ($(NWCHEM_TARGET),LINUX64)
1647
@echo g77 not supported on 64-bit Linux
1648
@echo please use supported gompilers
1654
ifeq ($(PE_ENV),PGI)
1658
ifeq ($(PE_ENV),INTEL)
1662
ifeq ($(PE_ENV),GNU)
1666
ifeq ($(PE_ENV),CRAY)
1670
DEFINES += -DCRAYXT -DEAFHACK -DNOFSCHECK
1695
ifeq ($(FC),gfortran)
1698
FOPTIONS += -ffast-math #-Wunused
1699
FOPTIMIZE += -ffast-math -Wuninitialized
1701
DEFINES += -DGFORTRAN
1704
ifeq ($(_FC),gfortran)
1705
#wrong FOPTIONS += -fdefault-integer-8
1706
else ifeq ($(_FC),crayftn)
1707
FOPTIONS += -s integer32
1712
ifeq ($(_FC),gfortran)
1713
FOPTIONS += -fdefault-integer-8
1714
else ifeq ($(_FC),crayftn)
1715
FOPTIONS += -s integer64
1720
DEFINES += -DEXT_INT -DGCC4 -DGCC46
1721
MAKEFLAGS = -j 1 --no-print-directory
1722
_CPU_ = $(shell uname -m )
1724
CORE_SUBDIRS_EXTRA += blas
1726
ifeq ($(LAPACK_LIB),)
1727
CORE_SUBDIRS_EXTRA += lapack
1730
DEFINES += -DLINUX -DLINUX64
1731
ifeq ($(_CPU),alpha)
1732
# using COMPAQ/DEC compilers (EA 3/13/2000)
1735
FOPTIONS += -assume no2underscore -align dcommons -check nooverflow -assume accuracy_sensitive -check nopower -check nounderflow -noautomatic
1736
DEFINES += -DLINUXALPHA
1737
FOPTIMIZE = -O4 -tune host -arch host -math_library fast
1738
FVECTORIZE = -fast -O5 -tune host -arch host
1742
# needed: binutils 2.11 for -taso option with some more hacking on bfd/elf.c
1746
LINK.f = fort $(LDFLAGS)
1747
# this creates a static executable
1748
# LINK.f = fort $(LDFLAGS) -Wl,-Bstatic
1749
# CORE_LIBS += -llapack $(BLASOPT) -lblas
1760
DEFINES += -DLINUXIA64
1767
_IFCV9= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk '/9./ {print "Y"}; /10./ {print "Y"; exit}')
1768
_IFCV81= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk ' /8\.1/ {print "Y";exit}; /9./ {print "Y"; exit}; /10./ {print "Y"; exit}')
1769
_IFCV8= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk ' /8\./ {print "Y";exit}; /9./ {print "Y"; exit}; /10./ {print "Y"; exit}')
1772
# FOPTIONS += -quiet
1777
ITANIUMNO = $(shell cat /proc/cpuinfo | egrep family | head -n 1 2>&1 | awk ' /Itanium 2/ { print "-tpp2"; exit };/Itanium/ { print "-tpp1"}')
1778
FOPTIONS += -auto -w -ftz $(ITANIUMNO)
1783
FOPTIONS+= -check nobounds -align dcommons -fpe1
1784
FOPTIONS+= -warn truncated_source
1788
DEFINES += -DIFCLINUX
1789
FVECTORIZE = -noalign -O3 -pad -mP2OPT_hlo_level=2
1790
FOPTIMIZE = -O3 -pad -mP2OPT_hlo_level=2 #-mP2OPT_align_array_to_cache_line=TRUE
1792
# FOPTIMIZE+= -IPF_fp_relaxed # breaks nwdft/xc/xc_pw91lda
1795
# EXTRA_LIBS += -quiet
1798
EXTRA_LIBS += -Vaxlib
1802
FOPTIONS+= -fltconsistency
1807
LDOPTIONS = -Qoption,link,--relax # -Qoption,link,-Bstatic
1808
ifeq ($(BUILDING_PYTHON),python)
1809
LDOPTIONS += -Qoption,link,--export-dynamic
1810
EXTRA_LIBS += -lutil
1812
LDOPTIONS += $(FDEBUG)
1813
LINK.f = ifort $(LDFLAGS)
1817
@echo Please do not set FC on linux/ia64
1818
@echo the makefile will use the Intel compiler
1826
# CORE_LIBS += $(BLASOPT) -llapack -lblas
1827
endif # end of ia32 bit
1828
ifeq ($(_CPU),x86_64)
1830
MAKEFLAGS = -j 2 --no-print-directory
1832
ifeq ($(NWCHEM_TARGET),CATAMOUNT)
1838
_GOTSSE3= $(shell cat /proc/cpuinfo | egrep sse3 | tail -n 1 | awk ' /sse3/ {print "Y"}')
1839
_IFCE = $(shell ifort -V 2>&1 |head -1 |awk ' /64/ {print "Y";exit};')
1840
_IFCV7= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk ' /7./ {print "Y";exit}')
1841
_IFCV10= $(shell ifort -v 2>&1|egrep "Version "|head -n 1|awk ' /10\.1/ {print "Y"; exit}')
1842
_IFCV11= $(shell ifort -logo 2>&1|egrep "Version "|head -n 1|awk ' /n 1/ {print "Y"; exit}')
1843
# Intel EM64T is required
1847
@echo " " ifort missing or not suitable x86_64 CPUs
1853
# Intel 8.1 is required
1855
@echo ifort 8.1 is required for x86_64 CPUs
1860
DEFINES+= -DUSE_OPENMP
1862
FOPTIONS += -align -w -g -vec-report1
1863
DEFINES+= -DIFCV8 -DIFCLINUX
1868
FOPTIONS += -fpe0 -traceback #-fp-model precise
1871
FOPTIMIZE = -O3 -prefetch -unroll
1872
FOPTIMIZE += -tpp7 -ip
1873
ifeq ($(_GOTSSE3),Y)
1874
FOPTIMIZE += -xP -no-prec-div
1879
FOPTIMIZE += -xHost -no-prec-div
1885
FOPTIONS += -Mdalign -Mllalign -Kieee
1886
# FOPTIONS += -tp k8-64
1887
# FOPTIONS += -Ktrap=fp
1888
FOPTIMIZE = -O3 -fastsse -Mnounroll -Minfo=loop -Mipa=fast
1889
FVECTORIZE = -fast -fastsse -O3 -Mipa=fast
1891
DEFINES += -DCHKUNDFLW -DPGLINUX
1893
LINK.f = ftn $(LDFLAGS) $(FOPTIONS)
1895
ifeq ($(NWCHEM_TARGET),CATAMOUNT)
1896
LINK.f = ftn $(LDFLAGS) $(FOPTIONS)
1899
ifeq ($(FC),pathf90)
1900
#pathscale 1.3 compiler
1901
# tested Sep 30 2004 on RH AW3
1902
FOPTIONS += -cpp -Wp,-P
1903
FOPTIONS += -fno-second-underscore -fixedform
1904
FOPTIONS += -align64
1905
# FOPTIONS += -LANG:heap_allocation_threshold=0
1906
FOPTIMIZE = -O3 -OPT:Ofast:IEEE_arith=1:IEEE_NaN_inf=ON:Olimit=12000:ro=1:fold_reassociate=ON#:div_split=OFF:fast_nint=OFF
1907
FVECTORIZE = -O3 -OPT:Ofast:ro=1 -fno-math-errno
1908
DEFINES += -DCHKUNDFLW -DPSCALE
1910
LDOPTIONS = -Wl,--warn-once -Wl,--relax
1917
#old COPTIMIZE = -O3 -hlo -mP2OPT_hlo_level=2
1921
COPTIONS = -O3 -funroll-loops -ffast-math
1924
COPTIONS += -march=k8 -mtune=k8
1926
# CORE_LIBS += $(BLASOPT) -llapack -lblas
1928
ifeq ($(NWCHEM_TARGET),CATAMOUNT)
1929
FOPTIONS += -Mprof=func#,lines
1930
LDOPTIONS += -Mprof=func#,lines
1931
COPTIONS += -O2 -finstrument-functions
1940
ifeq ($(_FC),gfortran)
1941
_GOT3DNOW= $(shell cat /proc/cpuinfo | egrep 3dnowext | tail -n 1 | awk ' /3dnowext/ {print "Y"}')
1942
#gcc version 4.1.0 20050525 (experimental)
1949
LINK.f = $(FC) $(LDFLAGS)
1951
FOPTIMIZE += -mfpmath=sse -ffast-math
1952
FOPTIMIZE += -fprefetch-loop-arrays #-ftree-loop-linear
1955
#possible segv with use of zdotc (e.g. with GOTO BLAS)
1956
#http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20178
1957
FOPTIONS += -ff2c -fno-second-underscore
1959
DEFINES += -DCHKUNDFLW -DGCC4
1960
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c22)
1962
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null | egrep __VERS | cut -c24)
1963
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
1964
GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
1966
ifeq ($(GNU_GE_4_6),true)
1969
ifeq ($(GNU_GE_4_8),true)
1970
FDEBUG =-O2 -g -fno-aggressive-loop-optimizations
1971
FOPTIMIZE +=-fno-aggressive-loop-optimizations
1972
FOPTIONS += -Warray-bounds
1974
FOPTIONS += -Wextra -Wuninitialized #-Wunused
1976
ifeq ($(_GOT3DNOW),Y)
1977
#we guess its an opteron
1978
FOPTIMIZE += -march=opteron -mtune=opteron
1980
ifeq ($(GNU_GE_4_6),true)
1981
FOPTIMIZE += -march=native -mtune=native
1983
#we guess its a nocona em64t
1984
FOPTIMIZE += -march=nocona -mtune=nocona
1987
# FVECTORIZE += -ftree-vectorize -ftree-vectorizer-verbose=1
1989
ifeq ($(_FC),crayftn)
1991
CPP = /usr/bin/cpp -P -C -traditional
1992
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
1993
FOPTIONS += -Ktrap=fp
1995
# FOPTIMIZE = -O2 -O scalar3,thread0,vector1,ipa0
1996
FOPTIMIZE = -O2 -O scalar3,thread0,vector2,ipa2 #-rdm
1998
ifeq ($(_FC),craycc)
2003
ifeq ($(_CPU),ppc64)
2004
# Tested on Red Hat Enterprise Linux AS release 3 (Taroon Update 3)
2011
#gfortran become default FC=xlf
2017
COPTIONS += -q64 -qlanglvl=extended
2023
#RSQRT=y breaks intchk QA
2024
FOPTIONS = -q64 -qextname -qfixed #-qnosave #-qalign=4k
2025
FOPTIONS += -NQ40000 -NT80000 -qmaxmem=8192 -qxlf77=leadzero
2030
FOPTIMIZE= -O3 -qstrict -qarch=auto -qtune=auto -qcache=auto -qfloat=fltint
2033
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
2034
DEFINES += -DXLFLINUX -DCHKUNDFLW
2035
CPP=/usr/bin/cpp -P -C -traditional
2037
FOPTIONS += -qintsize=4
2039
FOPTIONS += -qintsize=8
2042
# CORE_LIBS += $(BLASOPT) -llapack -lblas
2043
# EXTRA_LIBS += -dynamic-linker /lib64/ld64.so.1 -melf64ppc -lxlf90_r -lxlopt -lxlomp_ser -lxl -lxlfmath -ldl -lm -lc -lgcc -lm
2046
ifeq ($(BUILDING_PYTHON),python)
2047
# EXTRA_LIBS += -ltk -ltcl -L/usr/X11R6/lib -lX11 -ldl
2048
EXTRA_LIBS += -lnwcutil -lpthread -lutil -ldl
2049
LDOPTIONS = -Wl,--export-dynamic
2051
ifeq ($(NWCHEM_TARGET),CATAMOUNT)
2052
DEFINES += -DCATAMOUNT
2059
ifeq ($(TARGET),FUJITSU_VPP)
2061
# FUJITSU VPP5000 32-bit
2065
CPP = /lib/cpp -P -C
2068
INSTALL = @echo $@ is built
2070
DEFINES = -DFUJITSU_VPP
2073
#search include files for tools directories that are not built
2074
LIB_INCLUDES += -I$(NWCHEM_TOP)/src/tools/include \
2075
-I$(NWCHEM_TOP)/src/tools/ma \
2076
-I$(NWCHEM_TOP)/src/tools/tcgmsg-mpi \
2077
-I$(NWCHEM_TOP)/src/tools/global/src \
2078
-I$(NWCHEM_TOP)/src/tools/pario/eaf \
2079
-I$(NWCHEM_TOP)/src/tools/pario/elio \
2080
-I$(NWCHEM_TOP)/src/tools/pario/sf \
2081
-I$(NWCHEM_TOP)/src/tools/pario/dra
2083
#change DEFINES and LIB_DEFINES so that frt understands them and add them
2087
space:= $(end) $(end)
2088
FDEFINES_1:= $(DEFINES) $(LIB_DEFINES)
2089
FDEFINES:= -Wp,$(subst $(space),$(comma),$(strip $(FDEFINES_1)))
2090
FOPTIONS = -w -Sw -KA32 $(FDEFINES)
2096
# removed global, ma, tcgmsg-mpi, as they are part of the native GA
2097
NW_CORE_SUBDIRS = include basis geom inp input \
2098
pstat rtdb task symmetry util peigs $(CORE_SUBDIRS_EXTRA)
2101
CORE_LIBS = -lnwcutil \
2102
-L$(GA_LIBDIR) -lglobal -lpario -lma -lpeigs \
2103
-ltcgmsg-mpi -L/usr/lang/mpi2/lib32 -lmpi -lmp
2105
CORE_LIBS = -lnwcutil \
2106
-L$(GA_LIBDIR) -lga -lpeigs \
2107
-L/usr/lang/mpi2/lib32 -lmpi -lmp
2109
EXTRA_LIBS = -llapackvp -lblasvp -lsocket -Wl,-J,-P,-t,-dy
2113
ifeq ($(TARGET),FUJITSU_VPP64)
2115
# FUJITSU VX/VPP 64-bit
2119
CPP = /lib/cpp -P -C
2122
INSTALL = @echo $@ is built
2124
DEFINES = -DFUJITSU_VPP -DEXT_INT
2126
CORE_SUBDIRS_EXTRA = blas lapack
2128
#search include files for tools directories that are not built
2129
LIB_INCLUDES += -I$(NWCHEM_TOP)/src/tools/include \
2130
-I$(NWCHEM_TOP)/src/tools/ma \
2131
-I$(NWCHEM_TOP)/src/tools/tcgmsg-mpi \
2132
-I$(NWCHEM_TOP)/src/tools/global/src \
2133
-I$(NWCHEM_TOP)/src/tools/pario/eaf \
2134
-I$(NWCHEM_TOP)/src/tools/pario/elio \
2135
-I$(NWCHEM_TOP)/src/tools/pario/sf \
2136
-I$(NWCHEM_TOP)/src/tools/pario/dra
2138
#change DEFINES and LIB_DEFINES so that frt understands them and add them
2142
space:= $(end) $(end)
2143
FDEFINES_1:= $(DEFINES) $(LIB_DEFINES)
2144
FDEFINES:= -Wp,$(subst $(space),$(comma),$(strip $(FDEFINES_1)))
2145
FOPTIONS = -w -Sw -KA64 -CcdII8 -CcdLL8 $(FDEFINES)
2151
# removed global, ma, tcgmsg-mpi, as they are part of the native GA
2152
NW_CORE_SUBDIRS = include basis geom inp input \
2153
pstat rtdb task symmetry util peigs $(CORE_SUBDIRS_EXTRA)
2156
CORE_LIBS = -lnwcutil \
2157
-L$(GA_LIBDIR) -lglobal -lpeigs -lpario -lma \
2158
-ltcgmsg-mpi -L/usr/lang/mpi2/lib64 -lmpi -lmp
2160
CORE_LIBS = -lnwcutil \
2161
-L$(GA_LIBDIR) -lga -lpeigs \
2162
-L/usr/lang/mpi2/lib64 -lmpi -lmp
2164
EXTRA_LIBS = -llapack -lblas -lsocket -Wl,-J,-P,-t,-dy
2165
#end of FUJITSU_VPP64
2168
ifeq ($(TARGET),cray-sv2)
2176
INSTALL = @echo $@ is built
2177
DEFINES = -DEXT_INT -DUSE_POSIXF -DUSE_FFIO
2179
CORE_SUBDIRS_EXTRA = blas lapack
2181
FOPTIONS = -F -s integer64
2186
FOPTIMIZE = -O scalar3,aggress,unroll2,vector2
2187
FDEBUG = -O scalar1,vector1
2188
COPTIMIZE = -O -h inline2 -h aggress
2191
EXTRA_LIBS = -lsci64 -llapack -lblas # need make dbl_to_sngl for this
2192
# EXTRA_LIBS = -llapack -lblas
2195
FCONVERT = $(CPP) $(CPPFLAGS) $< | sed '/^\#/D' > $*.f
2199
ifeq ($(TARGET),$(findstring $(TARGET),BGL BGP BGQ))
2201
CORE_SUBDIRS_EXTRA = lapack blas
2203
INSTALL = @echo $@ is built
2205
CPP=/usr/bin/cpp -P -C -traditional
2206
FCONVERT = $(CPP) $(CPPFLAGS) $< > $*.f
2207
LDOPTIONS = -Wl,--relax
2214
DEFINES += -DCHKUNDFLW
2217
ifeq ($(TARGET),BGL)
2218
DEFINES += -DBGML -DBGL
2220
CC = $(BGCOMPILERS)/powerpc-bgl-blrts-gnu-gcc
2221
AR = $(BGCOMPILERS)/powerpc-bgl-blrts-gnu-ar
2222
AS = $(BGCOMPILERS)/powerpc-bgl-blrts-gnu-as
2223
RANLIB = $(BGCOMPILERS)/powerpc-bgl-blrts-gnu-ranlib
2224
DEFINES += -DXLFLINUX -DBGL
2225
FOPTIMIZE += -qarch=440 -qtune=440 -qfloat=rsqrt:fltint
2226
FOPTIONS = -qEXTNAME -qxlf77=leadzero -NQ40000 -NT80000 -NS2048 -qmaxmem=8192
2230
ifeq ($(TARGET),BGP)
2231
DEFINES += -DDCMF -DBGP
2234
AR = powerpc-bgp-linux-ar
2235
AS = powerpc-bgp-linux-as
2236
RANLIB = powerpc-bgp-linux-ranlib
2237
DEFINES += -DXLFLINUX
2238
FOPTIONS = -qEXTNAME -qxlf77=leadzero -NQ40000 -NT80000 -NS2048 -qmaxmem=8192
2239
FOPTIONS += -O3 -qstrict -qthreaded -qnosave -qalign=4k
2240
FOPTIMIZE += -O3 -qarch=450d -qtune=450 -qcache=auto -qunroll=auto -qfloat=rsqrt:fltint
2241
XLF11 = $(shell bgxlf -qversion 2>&1|grep Version|head -1| awk ' / 11./ {print "Y"}')
2245
ifeq ($(TARGET),BGQ)
2246
DEFINES += -DPAMI -DBGQ
2247
DEFINES += -DEAFHACK -DNOFSCHECK
2248
AR = powerpc64-bgq-linux-ar
2249
AS = powerpc64-bgq-linux-as
2250
RANLIB = powerpc64-bgq-linux-ranlib
2255
DEFINES += -DGFORTRAN -DGCC4
2257
FOPTIONS += -g -funderscoring
2258
FOPTIMIZE += -O3 -ffast-math -Wuninitialized
2261
# EXT_INT means 64-bit integers are used
2262
DEFINES += -DEXT_INT
2264
FOPTIONS += -fdefault-integer-8
2267
# linking ESSL is painful with gfortran
2268
CORE_LIBS += -llapack -lblas
2273
ifeq ($(FC),mpixlf77_r)
2274
DEFINES += -DXLFLINUX
2275
XLF11 = $(shell bgxlf -qversion 2>&1|grep Version|head -1| awk ' / 11./ {print "Y"}')
2276
XLF14 = $(shell bgxlf -qversion 2>&1|grep Version|head -1| awk ' / 14./ {print "Y"}')
2278
# EXT_INT means 64-bit integers are used
2279
DEFINES += -DEXT_INT
2281
FOPTIONS = -qintsize=4
2283
FOPTIONS = -qintsize=8
2286
FOPTIONS += -qEXTNAME -qxlf77=leadzero
2287
FOPTIONS += -qstrict -qthreaded -qnosave -g
2288
FOPTIMIZE += -O2 -qarch=qp -qtune=qp -qcache=auto -qunroll=auto -qfloat=rsqrt
2289
# FOPTIMIZE += -qhot=level=0
2292
# ESSL dependencies should be provided by XLF linker
2293
CORE_LIBS += -llapack $(BLASOPT) -lblas
2302
###################################################################
2303
# All machine dependent sections should be above here, otherwise #
2304
# some of the definitions below will be 'lost' #
2305
###################################################################
2306
ifeq ($(BUILDING_PYTHON),python)
2309
@echo "For python you must define both PYTHONHOME and PYTHONVERSION"
2310
@echo "E.g., setenv PYTHONHOME /msrc/home/d3g681/Python-1.5.1"
2311
@echo " setenv PYTHONVERSION 1.5"
2312
@echo " building_python <$(BUILDING_PYTHON)>"
2313
@echo " subdirs <$(NWSUBDIRS)>"
2316
ifndef PYTHONVERSION
2318
@echo "For python you must define both PYTHONHOME and PYTHONVERSION"
2319
@echo "E.g., setenv PYTHONHOME /msrc/home/d3g681/Python-1.5.1"
2320
@echo " setenv PYTHONVERSION 1.5"
2321
@echo " building_python <$(BUILDING_PYTHON)>"
2322
@echo " subdirs <$(NWSUBDIRS)>"
2326
ifndef PYTHONLIBTYPE
2330
CORE_LIBS += $(PYTHONHOME)/lib64/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
2332
CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
2341
DEFINES += -DUSE_PAPI
2344
echo You must define PAPI_LIB in your environment to be the path
2345
@echo of your PAPI library installation ... something like
2346
@echo setenv PAPI_LIB ~/papi/lib
2351
@echo You must define PAPI_INCLUDE in your environment to be the path
2352
@echo of your PAPI headers installation ... something like
2353
@echo setenv PAPI_INCLUDE ~/papi/include
2359
CORE_LIBS += -L$(PAPI_LIB) $(LIBPAPI)
2360
INCPATH += -I$(PAPI_INCLUDE)
2368
# either define USE_SCALAPACK (for i4) or USE_SCALAPACK_I8
2372
ifdef USE_SCALAPACK_I8
2377
ifeq ($(_USE_SCALAPACK),y)
2378
DEFINES += -DSCALAPACK
2380
CORE_LIBS += -brename:.iceil_,.iceil \
2381
-brename:.blacs_pinfo_,.blacs_pinfo \
2382
-brename:.blacs_get_,.blacs_get \
2383
-brename:.blacs_gridinit_,.blacs_gridinit \
2384
-brename:.blacs_gridinfo_,.blacs_gridinfo \
2385
-brename:.blacs_gridexit_,.blacs_gridexit \
2386
-brename:.indxg2p_,.indxg2p \
2387
-brename:.descinit_,.descinit \
2388
-brename:.numroc_,.numroc \
2389
-brename:.pdlamch_,.pdlamch \
2390
-brename:.pdsyev_,.pdsyev \
2391
-brename:.pdsyevd_,.pdsyevd \
2392
-brename:.pdsyevx_,.pdsyevx \
2393
-brename:.pdsygvx_,.pdsygvx \
2394
-brename:.pdpotri_,.pdpotri \
2395
-brename:.pdpotrf_,.pdpotrf \
2396
-brename:.pdpotrs_,.pdpotrs \
2397
-brename:.pdgetrf_,.pdgetrf \
2398
-brename:.pdgetrs_,.pdgetrs
2400
CORE_LIBS += $(SCALAPACK) $(PBLAS) $(BLACS)
2404
CORE_LIBS += -l64to32
2405
NWSUBDIRS += 64to32blas
2408
CORE_LIBS += $(BLASOPT)
2410
ifeq ($(LAPACK_LIB),)
2411
CORE_LIBS += -llapack
2419
DEFINES += -DGANXTVAL -DUSE_SUBGROUPS
2420
#turn off peigs for now
2422
DEFINES += -DPARALLEL_DIAG
2424
###################################################################
2425
# All machine dependent sections should be above here, otherwise #
2426
# some of the definitions below will be 'lost' #
2427
###################################################################
2428
#the new GA uses ARMCI library
2430
CORE_LIBS += -larmci
2435
# MPI version requires tcgmsg-mpi library
2441
SKIP_LIBMPI = mpifrt mpfort mpif77 mpxlf mpif90 ftn
2442
ifneq (,$(findstring $(notdir $(FC)), $(SKIP_LIBMPI)))
2446
CORE_LIBS += $(patsubst -L-L%,-L%,-L$(MPI_LIB))
2449
CORE_LIBS += -ltcgmsg-mpi $(LIBMPI)
2451
CORE_LIBS += $(LIBMPI)
2455
CORE_LIBS += -ltcgmsg
2462
# FFTW3 library inclusion
2468
CORE_LIBS += -L$(FFTW3_LIB)
2470
CORE_LIBS += $(LIBFFTW3)
2475
# slurm libraries for remaining wall time under slurm resource manager
2478
EXTRA_LIBS += $(SLURMOPT)
2484
CORE_LIBS += $(CUDA_LIBS)
2487
# lower level libs used by communication libraries
2489
COMM_LIBS= $(shell grep ARMCI_NETWORK_LIBS\ = ${NWCHEM_TOP}/src/tools/build/Makefile | cut -b 22-)
2491
CORE_LIBS += $(COMM_LIBS)
2498
EXTRA_LIBS += $(CONFIG_LIBS)
2499
CORE_LIBS += $(EXTRA_LIBS)
2503
FFLAGS = $(FOPTIONS) $(FOPTIMIZE)
2504
CFLAGS = $(COPTIONS) $(COPTIMIZE)
2506
# Need FDEBUG after FOPTIONS on SOLARIS to correctly override optimization
2507
FFLAGS = $(FOPTIONS) $(FDEBUG)
2508
CFLAGS = $(COPTIONS) $(CDEBUG)
2510
INCLUDES = -I. $(LIB_INCLUDES) -I$(INCDIR) $(INCPATH)
2511
CPPFLAGS = $(INCLUDES) $(DEFINES) $(LIB_DEFINES)
2512
LDFLAGS = $(LDOPTIONS) -L$(LIBDIR) $(LIBPATH)
2513
LIBS = $(NW_MODULE_LIBS) $(CORE_LIBS)
2515
# I think this will work everywhere, but it might have to become
2521
# Define known suffixes mostly so that .p files don't cause pc to be invoked
2525
.SUFFIXES: .o .s .F .f .c
2531
# Needed on machines where FC does not preprocess .F files
2532
# with CPP to get .f files
2534
# These rules apply to make-ing of files in specfic directories
2536
.SUFFIXES: .o .s .F .f .c
2539
@echo Converting $*.F '->' $*.f
2541
$(FC) -c $(FFLAGS) $*.f
2545
@echo Converting $*.F '->' $*.f
2548
$(FC) -c $(FFLAGS) $<
2551
# More explicit rules to avoid infinite recursion, to get dependencies, and
2552
# for efficiency. CRAY does not like -o with -c.
2554
# These rules apply to make-ing of files in with respect to library files
2555
# both these rules and the rules above are needed.
2558
@echo Converting $< '->' $*.f
2560
$(FC) -c $(FFLAGS) $*.f
2566
$(FC) -c $(FFLAGS) $<
2568
$(FC) -c $(FFLAGS) $(CPPFLAGS) $<
2573
$(FC) -c $(FFLAGS) $<
2576
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $% $<
2579
$(CUDA) -c $(CUDA_FLAGS) -c $(CUDA_INCLUDE) $(CUDA_LIBS) -o $% $<
2583
# Preceding line has a tab to make an empty rule
2585
# a .F.f rule is needed for any system target where the default .F.f rule does not work
2586
# AND the EXPLICITF is not already true. Right now this is only LINUX with g77
2588
ifeq ($(TARGET),LINUX)
2590
$(FC) -c $(FFLAGS) -E $(CPPFLAGS) $< -o $*.f
2594
# else for ifndef Flint
2598
# First time thru you need the -L... option. Next time remove it
2599
# and move the library file name to the last but one argument and add -g
2601
.F.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
2603
.f.o:; flint $(CPPFLAGS) -L $(SRCDIR)/nwchem.lbt $<
2605
.F.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
2607
.f.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<