#.............................................................................. #...configure.dat ... #... ... #...Purpose: ... #... This file contains all the variables that will be placed inside ... #... make.inc. Some variables are predefined by configure.pl (definitions ... #... here override that). ... #... ... #... In addition, any verbatim commands (like suffix rules and targets) ... #... will also be placed in make.inc after the variable definitions. ... #... ... #... ... #...Format: ... #... ... #... 1) comment lines ... #... any line that has "#" as its first character ... #... # this is a comment ... #... ... #... 2) option lines ... #... A line that defines which variables to use. ... #... The options to use are defined by the predefined options set in ... #... configure.pl. ... #... CONFIGURE_OPTIONS are additional options used for defining which ... #... variables to used. ... #... ... #... --Assigning absolute value (before any relative value(s)): ... #... CONFIGURE_OPTIONS([predef option] [predef option] ...) = [value]... #... --Example for absolute value "=": ... #... CONFIGURE_OPTIONS() = default when no other choice fits ... #... CONFIGURE_OPTIONS(a b) = when both a and b are supplied. ... #... Chooses the variable with the most ... #... options satisfied ... #... CONFIGURE_OPTIONS(a) = when a but not b is supplied ... #... CONFIGURE_OPTIONS(c) = when a and c are supplied (and not b), ... #... CONFIGURE_OPTIONS(a) is chosen because ... #... it was listed first (in a tie, the ... #... first one listed wins). ... #... ... #... --Assigning relative value (1 space after any absolute value): ... #... CONFIGURE_OPTIONS([predef option] [predef option] ...) += [value]... #... --Example for relative value "+=": ... #... CONFIGURE_OPTIONS(a b) += also add to value if a and b ... #... CONFIGURE_OPTIONS(a) += also add to value if a ... #... ... #... 3) variable definition line ... #... depending upon the option, define what value to use for a variable ... #... ([option] [option] ... ) = [value] ... #... ([option] [option] ... ) += [value] ... #... See CONFIGURE_OPTIONS above. ... #... ... #... 4) verbatim lines ... #... regions bounded by "begin verbatim:" and "end verbatim:" will be ... #... placed directly in make.inc. ... #... ... #.............................................................................. #.................................................... #...additional options you wish to be defined. ... #...Predefined options are defined in configure.pl... #.................................................... CONFIGURE_OPTIONS() = mpi debug CONFIGURE_OPTIONS(irix) = mpi 64 arraysvcs lsf debug #...until libsm fixes MAP_FIXED problem, don't use it... #CONFIGURE_OPTIONS(irix) = mpi libsm 64 arraysvcs lsf debug #irix workstations probably don't have libsm, array_services, lsf #CONFIGURE_OPTIONS(irix) = mpi 64 debug CONFIGURE_OPTIONS(linux) = mpi mpich FC_lahey CC_gcc debug #.............................................................................. #...................................Variables.................................. #.............................................................................. #...................................................... #...command to build the library (see ARFLAGS below)... #...................................................... AR() = ar AR(sasn100) = xar AR(sasn101) = xar #..................................................... #...the name of the directory under the lib/include... #...directory where libs are stored. ... #...Also where the includes will be stored ... #..................................................... ARCH() = $(MACH)$(BIT_ADDRESSING)$(ARCH_TYPE) #...................................................................... #...another name appended to ARCH to specify a lib/include directory... #...................................................................... ARCH_TYPE() = $(ARCH_TYPE_PROTOCOL)$(ARCH_TYPE_AUX)$(DEFAULT_SIZE_TYPE_F) ARCH_TYPE_PROTOCOL(mpi) = _mpi #............................................................ #...flags for the AR command to add objects to the library... #............................................................ ARFLAGS() = rvs #.............................................................. #...additional source compiled into the library depending on... #...architecture, comm library, ... #.............................................................. AUX_LIBS() = AUX_LIBS(irix mpi libsm) = libsm #.................................. #...additional AUX_LIBS for smpi... #.................................. AUX_LIBS(smpi) += hbp rel smpi #...................................... #...flags sent to libsm library make... #...................................... AUX_MAKE_FLAGS_LIBSM(irix mpi libsm n32) = sgi AUX_MAKE_FLAGS_LIBSM(irix mpi libsm 64) = sgi64 #......................... #...where to get bibtex... #......................... BIBTEX() = bibtex #....................................... #...for the size of the address space... #....................................... BIT_ADDRESSING() = 64 BIT_ADDRESSING(irix n32) = n32 BIT_ADDRESSING(linux) = 32 BIT_ADDRESSING(tflop) = 32 #............................................... #...the c compiler you use (see CFLAGS below)... #............................................... CC() = cc CC(CC_gcc) = gcc CC(aix) = mpcc CC(insure) = insure \ -Zoi "temp_directory ~/tmp" \ -Zoi "coverage_map_file ~/tca.map" \ -Zoi "coverage_log_file ~/tca.log" CC(tflop) = cicc CC(tau) = $(TAU_CC) CRULE() = $(CC) $(CFLAGS) $(ADDITIONAL_CFLAGS) -c $< CRULE(tau) = $(PDTCPARSE) $< $(CFLAGS) $(ADDITIONAL_CFLAGS) > /dev/null; \ $(TAUINSTR) $*.pdb $< -o $*.tau.c > /dev/null; \ $(CC) $(CFLAGS) $(ADDITIONAL_CFLAGS) -c $*.tau.c -o $@ ; \ rm -f $*.pdb $*.tau.c #............................ #...to build C executables... #............................ CC_LINK() = $(CC) CC_LINK(purify) = purify \ -follow-child-processes=yes \ -log-file=purify_log.%p.txt \ -view-file=purify_log.%p.pv \ $(CC) CC_LINK(tau) = $(TAU_CXX) CC(tau) = $(TAU_CC) #............................................................ #...the flags used in the c compiler to generate an object... #...(see CC above) ... #............................................................ CFLAGS() = $(DEFINES) \ $(FLAGS_COMPILER_C) \ $(FLAGS_DEBUG_C) \ $(FLAGS_OPT_LEVEL_C) \ $(FLAGS_WARNS_C) \ $(INCLUDE_PATH) \ $(OTHER_FLAGS) CFLAGS(tau) += $(TAU_DEFS) $(TAU_INCLUDE) $(TAU_MPI_INCLUDE) #................................... #...Communication Component Stuff... #................................... CM_TAUCLIBS() = CM_TAUCLIBS(tau) = $(TAU_MPI_LIBS) $(TAU_LIBS) CM_TAUFLIBS() = CM_TAUFLIBS(tau) = $(TAU_MPI_FLIBS) $(TAU_LIBS) $(TAU_FORTRANLIBS) CM_LIBS(mpi) = -lmpi CM_LIBS(mpi mpich) = -L$(MPI_ROOT)/lib -lmpich CM_LIBS(mpi aix) = CM_LIBS(mpi alpha) = -lmpi -lelan CM_LIBS(mpi alpha c01) = -lmpi CM_LIBS(mpi irix) = -lmpi CM_LIBS(mpi irix arraysvcs) = -lmpi -larray #.............................................. #...define a "comma" for gmake substitutions... #.............................................. COMMA() = , #................................................................... #...escape out special characters of CVSROOT so perl doesn't puke... #................................................................... CVSROOT_ESC() = $(subst @,\@,$(CVSROOT)) #......................... #...how to get the date... #......................... DATE() = `date "+%y%m%d"` #............................................................ #...What size the default integer is with fortran compiler... #...In C use the damn defaults!! ... #............................................................ DEFAULT_SIZE_FLAGS_F() = DEFAULT_SIZE_FLAGS_F(i8r8) = -i8 -r8 DEFAULT_SIZE_DEFINES_F() = DEFAULT_SIZE_DEFINES_F(i8r8) = -D$(DEFAULT_SIZE_TYPE_F) DEFAULT_SIZE_TYPE_F() = DEFAULT_SIZE_TYPE_F(i8r8) = _i8r8 #.................................................................. #...***ALL*** of the defines should be here (as this variable is... #...used by other programs) ... #.................................................................. DEFINES() = -D_UPS \ -D_$(MACH) \ -D_$(COMPUTER_NAME) \ -D_ADDRESS_SIZE_$(BIT_ADDRESSING) \ $(DEFAULT_SIZE_DEFINES_F) \ $(CM_DEFINES) \ $(ER_DEFINES) \ $(SL_DEFINES) DEFINES(insure) += -D__INSURE__ DEFINES(no_fortran) += -D_NO_FORTRAN DEFINES(purify) += -D_PURIFY DEFINES(smpi) += -D_SMPI DEFINES(arraysvcs) += -D_ARRAYSVCS DEFINES(mpi) += -D_MPI DEFINES(libsm) += -D_LIBSM #...................................... #...the print message when compiling... #...................................... DIRECTORY_NAME() = `$(PERL) -e \ ' ($$dir = \`pwd\`)=~s&^$(ROOT_DIR)/&&; \ if ( $$dir !~ /\S/ ) \ { \ print "--Error--pwd_failed"; \ } \ else \ { \ print "$$dir" \ } '` #........................ #...where to get dvips... #........................ DVIPS() = dvips #...................................................................... #...try and get the same behavior from the different flavors of echo... #...................................................................... ECHO() = echo ECHO(linux) = echo -e #..................................................... #...the fortran compiler you use (see FFLAGS below)... #..................................................... FC() = f90 FC(no_fortran) = echo no_fortran option in configure.dat FC(FC_lahey) = lf95 FC(aix) = mpxlf90 FC(tflop) = cif90 #.............................................................. #...to build fortran executables that must be compiled by CC... #.............................................................. FC_LINK() = $(FC) FC_LINK(insure) = $(CC) FC_LINK(purify) = $(CC_LINK) FC_LINK(tau) = $(TAU_CXX) #.................................................................. #...the flags used in the fortran compiler to generate an object... #...(see FC above) ... #.................................................................. FFLAGS() = $(DEFINES) \ $(FLAGS_COMPILER_F) \ $(FLAGS_DEBUG_F) \ $(FLAGS_OPT_LEVEL_F) \ $(FLAGS_WARNS_F) \ $(INCLUDE_PATH) \ $(INCLUDE_PATH_MODULES) \ $(OTHER_FLAGS) \ $(DEFAULT_SIZE_FLAGS_F) FFLAGS(aix) = $(addprefix -WF$(COMMA)-P$(COMMA),$(DEFINES)) \ $(FLAGS_COMPILER_F) \ $(FLAGS_DEBUG_F) \ $(FLAGS_OPT_LEVEL_F) \ $(FLAGS_WARNS_F) \ $(INCLUDE_PATH) \ $(INCLUDE_PATH_MODULES) \ $(OTHER_FLAGS) \ $(DEFAULT_SIZE_FLAGS_F) #............................................................. #...to build fortran executables that must have the c flags... #............................................................. FFLAGS_LINK() = $(FFLAGS) FFLAGS_LINK(insure) = $(CFLAGS) FFLAGS_LINK(purify) = $(CFLAGS) #................................................................ #...Additional flags needed because of the compiler being used... #...In general, place the compiler specific options first. ... #... FLAGS_COMPILER_F(FC_absoft) before FLAGS_COMPILER_F(aix)... #...so that if a specific compiler is specified, that value ... #...will be used before the default architecture one. ... #...freeform: not default to use free form fortran source ... #...fujitsu: Fujitsu fortran needs some other flags ... #...absoft: object names lower cased with single underscore ... #...lahey: static linking so no .so libs ... #................................................................ FLAGS_COMPILER_C() = FLAGS_COMPILER_C(irix) = -$(BIT_ADDRESSING) -mips4 -r10000 FLAGS_COMPILER_F() = -freeform FLAGS_COMPILER_F(FC_absoft) = -ffree -YEXT_NAMES=LCS -YEXT_SFX=_ FLAGS_COMPILER_F(FC_lahey) = --nfix --staticlink FLAGS_COMPILER_F(FC_fujitsu) = -Free -X 9 -rpath=/usr/local/FFC/lib -Am FLAGS_COMPILER_F(aix) = -qfree=f90 FLAGS_COMPILER_F(alpha) = -free FLAGS_COMPILER_F(irix) = -freeform -$(BIT_ADDRESSING) -mips4 -r10000 FLAGS_COMPILER_F(tflop) = -Mfreeform #..................................................... #...what debug flags should be sent to the compiler... #..................................................... FLAGS_DEBUG_C() = FLAGS_DEBUG_C(debug) = -g FLAGS_DEBUG_C(alpha) = -g3 FLAGS_DEBUG_C(alpha debug) = -g3 FLAGS_DEBUG_C(irix) = -g3 FLAGS_DEBUG_F() = $(FLAGS_DEBUG_C) #.................................................................... #...optimization level given to the compiler (see C/F-FLAGS above)... #.................................................................... FLAGS_OPT_LEVEL_C() = -O3 FLAGS_OPT_LEVEL_C(debug) = FLAGS_OPT_LEVEL_C(alpha) = -O5 -fast #.................................................................... #...-Ofast produces incompatible MIPSPro_default/latest libraries ... #... (IPA whirl format problems). So, until "latest" is the only... #... compiler used, only do -O3 (above) ... #.................................................................... # FLAGS_OPT_LEVEL_C(irix) = -Ofast=ip27 \ # -OPT:IEEE_arithmetic=3:roundoff=3:\ # liberal_ivdep=TRUE FLAGS_OPT_LEVEL_F() = -O3 FLAGS_OPT_LEVEL_F(debug) = FLAGS_OPT_LEVEL_F(FC_absoft) = -O FLAGS_OPT_LEVEL_F(alpha) = -O5 -fast #...gets rid of some optimization warnings in -debug cm tests... FLAGS_OPT_LEVEL_F(irix) = -O3 -OPT:Olimit=0 #............................................................................. #...we wish to have the compiler tell us about as many warnings as possible... #............................................................................. FLAGS_WARNS_C() = -fullwarn FLAGS_WARNS_C(aix) = -fullwarn FLAGS_WARNS_C(alpha) = -std #............................................................................. #...56 invalid warning number (ld no like 399) ... #...85 preempts second definition of symbol (defined twice) ... #...124 using integer*4 (non-standard fortran - ups) ... #...134 using Cray pointers (non-standard fortran - mpi) ... #...399 fortran interface resolved as whatever ... #...878 module already associated into scope ... #...899 using tab char (non-standard fortran - mpi) ... #...1048 cast of pointer to object/function. Standard says no info lost ... #...1193 module file has been moved ... #...1429 problem w/ new compiler and mpi - something lame ... #...1438 fortran possibly making copy of argument ... #...1521 nonstandard preprocessing directive ... #...1582 fixed form obsolete ... #............................................................................. FLAGS_WARNS_C(irix) = -fullwarn -woff56,134,399,878,899,\ 1193,1438 FLAGS_WARNS_C(irix 721) = -fullwarn -woff56,85,124,134,399,899,\ 1048,1429,1438,1521,1582 FLAGS_WARNS_C(CC_gcc) = FLAGS_WARNS_C(tflop) = FLAGS_WARNS_F() = $(FLAGS_WARNS_C) FLAGS_WARNS_F(irix debug) = $(FLAGS_WARNS_C) -C FLAGS_WARNS_F(alpha) = -std90 FLAGS_WARNS_F(FC_fujitsu) = -Wa,--no-warn FLAGS_WARNS_F(tflop debug) = -Mbounds -Mchkfpstk -Mchkptr \ -Mchkstk -Mdclchk #.................................................... #...Do not compile fortran objects if no fortran. ... #...Do not have a default since normally do not ... #...want to overwrite original FOBJS. ... #...This works since make.inc is included after ... #...explicitly listed Makefile defines ... #.................................................... FOBJS(no_fortran) = #.................................................... #...the include directory containing include files... #.................................................... INCLUDE_DIR() = $(LOCAL_INSTALL_ROOT)/include/$(ARCH) #...................................... #...the entire list of include paths... #...................................... INCLUDE_PATH() = -I. \ -I$(INCLUDE_DIR) \ -I$(ROOT_DIR)/src/aa \ -I$(ROOT_DIR)/src/cm \ -I$(ROOT_DIR)/src/dp \ -I$(ROOT_DIR)/src/dt \ -I$(ROOT_DIR)/src/er \ -I$(ROOT_DIR)/src/gs \ -I$(ROOT_DIR)/src/sl \ -I$(ROOT_DIR)/src/ut \ -I$(ROOT_DIR)/src/sl/internals/$(SL_INTERNAL_AMG) \ -I$(ROOT_DIR)/src/sl/internals/$(SL_INTERNAL_KRY) \ $(CM_INCLUDES) \ $(SL_INCLUDES) \ -I$(INCLUDE_DIR)/Fortran_mods INCLUDE_PATH(smpi) += -I$(ROOT_DIR)/aux/hbp/include \ -I$(ROOT_DIR)/aux/rel/include \ -I$(ROOT_DIR)/aux/smpi/include INCLUDE_PATH(mpich) += -I$(MPI_ROOT)/include #.................................................................... #...some fortran compilers need a separate flag to find .mod files... #.................................................................... INCLUDE_PATH_MODULES() = INCLUDE_PATH_MODULES(FC_absoft) = -p. \ -p$(INCLUDE_DIR) \ -p$(INCLUDE_DIR)/Fortran_mods #......................................................................... #...where to install the library, doc, includes when "make install" ... #...is performed ... #......................................................................... INSTALL_DIR(irix) = /usr/projects/ups INSTALL_DIR(alpha) = /usr/projects/ups INSTALL_DIR(tflop janus) = /Net/usr/home/lmdm INSTALL_DIR(tflop sasn100) = /usr/home/lmdm #............................... #...Linear algebra operations... #............................... LA_LIBS() = LA_LIBS(alpha aztec) = -lcxmlp LA_LIBS(irix aztec) = -lcomplib.sgimath -lblas #........................ #...where to get latex... #........................ LATEX() = latex #.............................. #...where to find latex2html... #.............................. LATEX2HTML() = latex2html LATEX2HTML(irix) = /usr/projects/ups/Script/latex2html #................................................. #...where the lib directory is (see ARCH above)... #................................................. LIB_DIR() = $(LOCAL_INSTALL_ROOT)/lib/$(ARCH) #...................................................................... #...libraries needed to link to when building an executable ... #...LIBS_C: building an executable from the C compiler ... #...LIBS_F: building an executable from the fortran compiler ... #...m: math (sqrt) ... #...rt: real time posix library ... #...fortran ftn m: fortran intrinsics when linking with C ... #...................................................................... LIBS_C() = $(UPS_LIB_NAME) \ $(SL_LIBS) \ $(CM_TAUCLIBS) \ $(CM_LIBS) LIBS_C(alpha) += -lm -lrt LIBS_C(linux) += -lm -lrt LIBS_F() = $(UPS_LIB_NAME) \ $(SL_LIBS) \ $(CM_TAUFLIBS) \ $(CM_LIBS) LIBS_F(alpha) += -lrt LIBS_F(linux) += -lm -lrt #...fortran intrinsics when linking with C... LIBS_F(insure) += -lfortran -lftn -lm LIBS_F(purify) += -lfortran -lftn -lm #...absoft compilers need old fortran intrinsics (eg with mpich)... LIBS_F(FC_absoft) += -lU77 #.................................................................. #...Root location of the lib/include files when building execs. ... #...Normally, this is set to $(ROOT_DIR). However, it can ... #...be modified to compile with other files (eg the "latest" ... #...installation directory) ... #...Makefiles with executables contain the line: ... #... LOCAL_INSTALL_ROOT = LOCAL_INSTALL_ROOT_TEST ... #...So, if the "test_install" option is set, it searches the ... #...install directory for the libs/includes. ... #.................................................................. LOCAL_INSTALL_ROOT_BASE() = $(ROOT_DIR) LOCAL_INSTALL_ROOT() = $(LOCAL_INSTALL_ROOT_BASE) LOCAL_INSTALL_ROOT_TEST() = $(LOCAL_INSTALL_ROOT_BASE) LOCAL_INSTALL_ROOT_TEST(test_install) = $(INSTALL_DIR)/latest #............................................................... #...command used to wait until a file leaves (first argument)... #...before creating the file and continuing ... #............................................................... LOCKFILE() = $(PERL) -e \ '\ $$lockbase = $$ARGV[0]; \ $$lockfile = $$lockbase.$$$$; \ $$done = "false"; \ print "--lockfile wait [$$lockbase]--\n";\ while ( $$done eq "false" ) \ { \ unlink ( $$lockfile ); \ while (<$$lockbase*>) {sleep 1} \ open (LOCKFILE, ">$$lockfile") || \ die "\n--Error-- [$$lockfile]\n\n"; \ close( LOCKFILE ); \ sleep rand(1)+1; \ $$num_lockfiles = (@a = <$$lockbase*>); \ if ( $$num_lockfiles == 1 ) \ {$$done = "true"} \ @a = (); \ } \ print "--lockfile acquired [$$lockbase]--\n";\ open (LOCKBASE, ">$$lockbase") || \ die "\n--Error-- [$$lockbase]\n\n"; \ close( LOCKBASE ); \ unlink ( $$lockfile ); \ ' #.......................................................... #...defines the machine type you are on (see ARCH above)... #.......................................................... MACH() = UNKNOWN MACH(aix) = AIX MACH(alpha) = ALPHA MACH(irix) = SGI MACH(linux) = LINUX MACH(tflop) = TFLOP #............................................ #...the command used when make is executed... #............................................ MAKE() = gmake -s #.................................................... #...maximum number of processes for parallel makes... #.................................................... MAKE_NUM_PROCS() = -j15 MAKE_NUM_PROCS(insure) = -j1 #.................................................................. #...the different options you wish to run when doing "make full"... #.................................................................. OPTIONS_FULL() = "mpi" OPTIONS_FULL(irix) = "mpi 64 arraysvcs lsf" \ "mpi 64 arraysvcs lsf i8r8" \ "mpi n32 arraysvcs lsf" OPTIONS_FULL(tflop) = "mpi" \ "mpi i8r8" OPTIONS_FULL(linux) = "mpi mpich FC_lahey CC_gcc" #........................................ #...Define what packages to build/test... #........................................ PACKAGES_BUILD() = aa cm dp dt er gs sl ut #..................................................................... #...For PACKAGES_TEST, give path to each test. This way, can count... #...how many tests were done by doing a word count on the ... #...$(PACKAGES_TEST) variable ... #..................................................................... PACKAGES_TEST() = aa/fortran \ cm/fortran \ dp/fortran \ dt/fortran \ er/fortran \ gs/fortran \ sl/fortran \ ut/fortran \ acceptance PACKAGES_TEST(no_fortran) = acceptance #........................... #...where to get pdflatex... #........................... PDFLATEX() = pdflatex #........................ #...where to find perl... #........................ PERL() = perl -w #................................................. #...if ranlib is needed ... #...Needs to be in the form of: ... #... RANLIB(foo) = && ranlib $(UPS_LIB_NAME) ... #................................................. RANLIB() = #................................................... #...the command executed when "make run" is given... #...NOTE: $(EXEC) is supplied by the Makefile ... #................................................... RUN_COMMAND() = $(RUN_NAME) $(EXEC) RUN_COMMAND(aix) = RUN_COMMAND(irix profile) = $(RUN_NAME) /usr/bin/ssrun -usertime $(EXEC); \ $(ECHO) ''; \ $(ECHO) 'profiling...please wait...';\ prof -gprof $(EXEC).usertime.f* > prof.out ; \ $(ECHO) 'profile output file: prof.out'; \ $(ECHO) ''; \ rm -f $(EXEC).usertime.* RUN_COMMAND(purify) = rm -f purify_log.[0-9]*.pv; \ $(RUN_NAME) $(EXEC); \ cat purify_log.[0-9]*.txt > purify_log.txt; \ rm -f purify_log.[0-9]*.txt; \ $(ECHO) ''; \ $(ECHO) 'purify text file: purify_log.txt'; \ $(ECHO) 'purify binary file: purify -view purify_log.[0-9]*.pv'; \ $(ECHO) '' #................................. #...the name of the run command... #................................. RUN_NAME(mpi) = mpirun -np 4 RUN_NAME(mpi irix) = MPI_GROUP_MAX=64 && export MPI_GROUP_MAX && \ mpirun -np 4 RUN_NAME(mpi irix lsf) = MPI_GROUP_MAX=64 && export MPI_GROUP_MAX && \ mpirun RUN_NAME(mpi alpha) = prun -n 2 -N 1 RUN_NAME(mpi alpha c01) = dmpirun -np 4 RUN_NAME(mpi tflop) = yod -sz 4 #.............................................................. #...shell to be used inside Makefile (should not change this... #...unless you are prepared to change a lot of internal ... #...Makefile scripts) ... #.............................................................. SHELL() = /bin/sh #............................ #...Solver Component Stuff... #............................ AZTEC_LOC() = $(HOME)/Aztec AZTEC_LOC(mpi irix arraysvcs lsf) = /usr/projects/ups/Aztec SL_DEFINES() = $(SL_DEFINES_AMG) $(SL_DEFINES_KRYLOV) SL_DEFINES_AMG(hypre) = -D_UPS_SL_HYPRE SL_DEFINES_KRYLOV(aztec) = -D_UPS_SL_AZTEC SL_INCLUDES() = $(SL_INCLUDES_AMG) $(SL_INCLUDES_KRYLOV) SL_INCLUDES_AMG(hypre) = -I$(SL_LOC_AMG)/include SL_INCLUDES_KRYLOV(aztec) = -I$(AZTEC_LOC)/lib SL_INTERNAL_AMG(hypre) = sli_hypre SL_INTERNAL_KRY(aztec) = sli_aztec SL_LIBS() = $(SL_LIBS_AMG) $(SL_LIBS_KRYLOV) SL_LIBS_AMG(irix hypre) = -L$(SL_LOC_AMG)/lib \ -lHYPRE_IJ_mv \ -lHYPRE_parcsr_ls -lHYPRE_parcsr_mv \ -lHYPRE_seq_mv \ -lHYPRE_utilities SL_LIBS_KRYLOV(aztec) = -L$(AZTEC_LOC)/lib -laztec $(LA_LIBS) SL_LOC_AMG(hypre) = $(HOME)/hypre/src/hypre #.............................................................. #...the name of the file that has the timestamp of when this... #...directory last updated the library ... #.............................................................. UPDATED() = updated #....................... #...All the internals... #....................... UPS_INTERNALS() = $(AA_INTERNAL) \ $(CM_INTERNAL) \ $(DP_INTERNAL) \ $(DT_INTERNAL) \ $(ER_INTERNAL) \ $(SL_INTERNAL_AMG) \ $(SL_INTERNAL_KRY) \ $(UT_INTERNAL) #............................. #...the name of the library... #............................. UPS_LIB_NAME() = $(LIB_DIR)/libups.a #............................................................... #...user include files generated by include/sync_f_include.pl... #............................................................... UPS_USER_INCLUDES() = $(INCLUDE_DIR)/ups.h \ $(INCLUDE_DIR)/upsf.h \ $(INCLUDE_DIR)/upsf77.h #.................................. #...machine to copy web files to... #.................................. WEB_SERVER() = heathbar.lanl.gov #........................ #...where to get xargs... #........................ XARGS() = xargs XARGS(theta) = /usr/bin/xargs XARGS(t01) = /usr/bin/xargs XARGS(t02) = /usr/bin/xargs #............................................................... #...whitespace separated list of directories on WEB_SERVER to... #...copy web files to ... #............................................................... WEB_DIRS() = /www/htdocs.blue/XCI/PROJECTS/UPS \ /www/htdocs.green/XCI/PROJECTS/UPS #.............................................................................. #.........................Verbatim Quotes...................................... #.............................................................................. begin verbatim: #.............................................................................. #...Verbatim Quotes ... #... Contains make code that is duplicated in many Makefiles. Kept in ... #... one file so that changes can be more easily made. ... #... ... #...Sections: ... #... 0- Additional Variables ... #... variables set via conditional gmake code ... #... 0- Suffix Rules ... #... Rules for compiling ... #... 0- PHONY list ... #... Phony targets ... #... 0- make.inc ... #... Rules to rebuild make.inc. Always done if needed. ... #... 0- OTHER_DIRS(+_CLEAN|_RUN) ... #... How to recursively go into other directories to gmake. ... #... 0- updated ... #... How to stuff objects into lib ... #... 0- AUX_PRODUCT_DIR ... #... How to build an aux directory and incorporate it ... #... 0- create_latex_doc ... #... How to build a ps document from the latex files ... #... 0- clean ... #... Various cleaning functions ... #.............................................................................. #.......................... #...Additional Variables... #.......................... #......................................................................... #...MPI_ROOT ... #...Used for mpich location if not set by user via environment variable... #......................................................................... ifndef MPI_ROOT ifdef MPICH_ROOT MPI_ROOT = $(MPICH_ROOT) else MPI_ROOT = /usr/local/mpich endif endif #.......................................................................... #...INSTALL_DIR ... #...If not already defined (Makefile or environment var), set it to /tmp... #.......................................................................... ifndef INSTALL_DIR INSTALL_DIR = /tmp endif #................................ #...DONE: Additional Variables... #................................ #................................ #...remove predefined suffixes... #................................ .SUFFIXES: #..................... #...compiling rules... #..................... %.o: %.c @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" $(CRULE) %.o: %.f @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(FC) $(FFLAGS) $(ADDITIONAL_FFLAGS) -c $< %.o: %.F @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(FC) $(FFLAGS) $(ADDITIONAL_FFLAGS) -c $< %.o: %.f90 @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(FC) $(FFLAGS) $(ADDITIONAL_FFLAGS) -c $< %.o: %.F90 @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(FC) $(FFLAGS) $(ADDITIONAL_FFLAGS) -c $< %_F.F: %.c $(ROOT_DIR)/script/create_fortran_interface.pl @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(ROOT_DIR)/script/create_fortran_interface.pl $(ROOT_DIR)/script $< #.................................................................... #...save intermediate fortran files (created by C comment headers)... #.................................................................... .PRECIOUS: %_F.F #...................................... #...PHONY (targets that never exist)... #...................................... .PHONY: \ all \ aux \ aux_inc_copy \ aux_lib_copy \ aux_to_ups \ bld_run_tests \ c \ clean \ clean_compile \ clean_compile_trash \ clean_doc \ clean_latex_trash \ clean_testing \ clean_tmp \ create_latex_doc \ DeveloperGuide \ developerguide \ distclean \ doc \ done_sound \ examples \ F90 \ fortran \ full \ include \ install \ install_change_version \ install_copy \ install_create_tags \ install_latest_link \ INSTALL_NAME \ install_post_message \ install_pre_mesg \ install_rest \ install_rel_note \ install_up_to_date \ internals \ o_to_lib \ reference_pages \ run \ smpi \ src \ tar \ testing \ UserGuide \ userguide \ utils \ updated \ VERSION \ $(AUX_LIBS) \ $(AUX_PRODUCT_DIR) \ $(OTHER_DIRS) \ $(OTHER_DIRS_CLEAN) \ $(OTHER_DIRS_RUN) \ $(UPS_INTERNALS) #.......................................................... #...check make.inc to make sure it is up to date ... #...Note: I make "all" also depend upon make.inc. So, ... #... the makefile must have "all" as a dependency ... #... or else things will break (or at least act ... #... weird under some circumstances) ... #.......................................................... all:: $(ROOT_DIR)/make.inc $(ROOT_DIR)/make.inc: $(ROOT_DIR)/configure.pl $(ROOT_DIR)/configure.dat @ $(ECHO) "" @ $(ECHO) '--gmake $@ (.)--' @ ( cd $(ROOT_DIR) ; \ $(PERL) -e \ '$$command_line_args = ""; \ if ( -T "make.inc" && -r "make.inc" ) \ { \ open( FILE, "make.inc" ); \ @file_lines = ; \ close( FILE ); \ $$file_string = join( "", @file_lines ); \ if ( $$file_string =~ /\#...Command Line Args:(.*)\n/ ) \ {\ $$command_line_args = $$1; \ }\ } \ $$output = `./configure.pl go $$command_line_args`; \ print "$$output"; \ ' \ ) @ $(ECHO) "**Error** Updating [$@]." @ $(ECHO) " Now re-run your gmake command." @ $(ECHO) "" @ exit 1 #......................................................................... #...OTHER_DIRS ... #... For recursive makes. This specifies the other directories that ... #... need to be cd'd into and make'd ... #......................................................................... #..................................................................... #...make sub directories sequentially first, then current directory... #..................................................................... all:: $(OTHER_DIRS) $(OTHER_DIRS): @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ cd $@ && $(MAKE) #......................................................................... #...OTHER_DIRS_CLEAN ... #... For recursive makes. This specifies the other directories that ... #... need to be cd'd into and make'd clean ... #......................................................................... OTHER_DIRS_CLEAN = ${OTHER_DIRS:=_clean} clean:: $(OTHER_DIRS_CLEAN) $(OTHER_DIRS_CLEAN): @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ if [ "${@:_clean=}" != "" ]; \ then \ cd ${@:_clean=} && $(MAKE) clean; \ fi #......................................................................... #...OTHER_DIRS_CLEAN_COBJS ... #... For recursive makes. This specifies the other directories that ... #... need to be cd'd into and make'd clean_cobjs ... #... Useful when doing compiles with insure ... #......................................................................... OTHER_DIRS_CLEAN_COBJS = ${OTHER_DIRS:=_clean_cobjs} clean_cobjs:: $(OTHER_DIRS_CLEAN_COBJS) $(OTHER_DIRS_CLEAN_COBJS): @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ if [ "${@:_clean_cobjs=}" != "" ]; \ then \ cd ${@:_clean_cobjs=} && $(MAKE) clean_cobjs; \ fi clean_cobjs:: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ rm -f $(COBJS) #......................................................................... #...OTHER_DIRS_RUN ... #... For recursive makes. This specifies the other directories that ... #... need to be cd'd into and make'd run ... #......................................................................... OTHER_DIRS_RUN = ${OTHER_DIRS:=_run} run:: $(OTHER_DIRS_RUN) $(OTHER_DIRS_RUN): @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ if [ "${@:_run=}" != "" ]; \ then \ cd ${@:_run=} && $(MAKE) run; \ fi #......................................................... #...updated ... #... As different directories will be modifying to the... #... library, we need to keep track of the last time ... #... this directory contributed. We do that by an ... #... "updated" file (and specifically it's timestamp) ... #......................................................... updated: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(MAKE) $(MAKE_NUM_PROCS) updated_stamp updated_stamp: $(OBJS) @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ if [ ! -d $(LIB_DIR) ]; \ then \ mkdir -p $(LIB_DIR); \ fi @ if [ ! -d $(INCLUDE_DIR)/Fortran_mods ]; \ then \ mkdir -p $(INCLUDE_DIR)/Fortran_mods; \ fi @ $(LOCKFILE) $(ROOT_DIR)/lock_lib && \ ( $(AR) $(ARFLAGS) $(UPS_LIB_NAME) $? $(RANLIB) && touch $@ ) ; \ rm -f $(ROOT_DIR)/lock_lib @ if [ "$(filter UPSF_%,$?)" != "" ]; \ then \ mv -f *.mod $(INCLUDE_DIR)/Fortran_mods; \ cd $(ROOT_DIR)/include ; \ $(MAKE); \ fi #............................................................. #...Rules for building aux libraries and incorporating them... #............................................................. #........................................... #...AUX_PRODUCT_DIR ... #... 1) make the aux product ... #... 2) incorporate the product ... #........................................... $(AUX_PRODUCT_DIR): @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ cd $(AUX_PRODUCT_DIR) && $(MAKE) $(AUX_MAKE_FLAGS) @ $(MAKE) aux_to_ups aux_to_ups: $(AUX_TO_UPS_LIB) $(AUX_TO_UPS_INC) #..................................................... #...aux_lib_add ... #... Extract the .o's and stuff them into the lib ... #... I'd like to see a better way to do this. ... #..................................................... aux_lib_add: $(AUX_PRODUCT_LIB) @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(AR) -x $? @ $(MAKE) updated_stamp OBJS="*.o" @ rm -f updated_stamp @ rm -f *.o @ touch $@ #............................... #...aux_lib_copy ... #... Copy the library to lib... #............................... aux_lib_copy: $(LIB_DIR)/$(notdir $(AUX_PRODUCT_LIB)) $(LIB_DIR)/$(notdir $(AUX_PRODUCT_LIB)): $(AUX_PRODUCT_LIB) @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ cp $? $@ #.............................................. #...aux_inc_add ... #... Put the include file into include ... #... Not needed (yet) ... #.............................................. aux_inc_add: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ $(ECHO) "\n\n--Error-- $@ Not implemented\n\n" @ exit 1 #............................................................................. #...<>Guide: creates <>Guide (doc/<>Guide/<>Guide.dvi) ... #............................................................................. developerguide: $(ROOT_DIR)/doc/DeveloperGuide/DeveloperGuide.dvi userguide: $(ROOT_DIR)/doc/UserGuide/UserGuide.dvi $(ROOT_DIR)/doc/UserGuide/UserGuide.dvi: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" (cd $(ROOT_DIR)/doc/UserGuide && $(MAKE)) $(ROOT_DIR)/doc/DeveloperGuide/DeveloperGuide.dvi: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" (cd $(ROOT_DIR)/doc/DeveloperGuide && $(MAKE)) #................................... #...aux_inc_copy ... #... Copy the include to include... #................................... aux_inc_copy: $(INCLUDE_DIR)/$(notdir $(AUX_PRODUCT_INC)) $(INCLUDE_DIR)/$(notdir $(AUX_PRODUCT_INC)): $(AUX_PRODUCT_INC) @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ cp $? $@ #......................................................... #...create_latex_doc ... #... Runs through commands to create $(LATEX_DOC).dvi ... #......................................................... create_latex_doc: $(LATEX_DOC).dvi $(LATEX_DOC).dvi: *.tex @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @ a="LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right."; \ until [ "$$a" != "LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right." ] ; do \ $(ECHO) "$(LATEX) $(LATEX_DOC)"; \ $(LATEX) $(LATEX_DOC); \ a=`grep "LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right." $(LATEX_DOC).log` ; \ $(ECHO) '*********************************' ; \ $(ECHO) '******end of one latex pass******' ; \ $(ECHO) '*********************************' ; \ done @- if [ -f $(LATEX_DOC).aux ] ; then \ $(BIBTEX) $(LATEX_DOC) ; \ fi @ a="LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right."; \ until [ "$$a" != "LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right." ] ; do \ $(ECHO) "$(LATEX) $(LATEX_DOC)"; \ $(LATEX) $(LATEX_DOC); \ a=`grep "LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right." $(LATEX_DOC).log` ; \ $(ECHO) '*********************************' ; \ $(ECHO) '******end of one latex pass******' ; \ $(ECHO) '*********************************' ; \ done @- $(DVIPS) -o $(LATEX_DOC).ps $(LATEX_DOC) @- $(PDFLATEX) $(LATEX_DOC) @ if [ ! -f $(LATEX_DOC).dvi ] ; then \ $(MAKE) done_sound; \ $(ECHO) "**Error** $(LATEX_DOC).dvi not created."; \ $(ECHO) " (Perhaps could not find latex commands)."; \ $(ECHO) " Press to continue, to abort"; \ read answer; \ fi @ if [ ! -f $(LATEX_DOC).ps ] ; then \ $(MAKE) done_sound; \ $(ECHO) "**Error** $(LATEX_DOC).ps not created."; \ $(ECHO) " (Perhaps could not find latex commands)."; \ $(ECHO) " Press to continue, to abort"; \ read answer; \ fi @ if [ ! -f $(LATEX_DOC).pdf ] ; then \ $(MAKE) done_sound; \ $(ECHO) "**Error** $(LATEX_DOC).pdf not created."; \ $(ECHO) " (Perhaps could not find latex commands)."; \ $(ECHO) " Press to continue, to abort"; \ read answer; \ fi #......................................................... #...clean_latex_trash ... #... Cleans up latex created stuff ... #......................................................... clean_latex_trash: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @- $(PERL) -e \ ' \ $$answer = "yes"; \ if ( ! -e "$(shell which $(BIBTEX))" || \ ! -e "$(shell which $(DVIPS))" || \ ! -e "$(shell which $(LATEX))" || \ ! -e "$(shell which $(PDFLATEX))" \ )\ { \ print "\n\n **Warning** Cannot find latex utilities.\n"; \ print " Cannot create docs if you continue.\n\n"; \ print " Continue(yes/no [no = default]) " ; \ $$answer = ; \ } \ if ( $$answer =~ /^y/i ) \ { \ $$output = `rm -f *.aux`; \ $$output .= `rm -f *.blg`; \ $$output .= `rm -f *.bbl`; \ $$output .= `rm -f *.log`; \ $$output .= `rm -f *.dvi`; \ $$output .= `rm -f *.toc`; \ $$output .= `rm -f *.lot`; \ $$output .= `rm -f *.lof`; \ $$output .= `rm -f *.idx`; \ $$output .= `rm -f $(LATEX_DOC).ps`; \ $$output .= `rm -f $(LATEX_DOC).pdf`; \ print $$output; \ } \ ' #......................................................... #...clean_compile_trash ... #... Cleans up any trash left by a compile ... #......................................................... clean_compile_trash: @ $(ECHO) "--gmake $@ ($(DIRECTORY_NAME))--" @- rm -f *.o @- rm -f *.stb @- rm -f *.mod @- rm -f ups_??_*_F.F @- rm -rf core* @- rm -f prof.out @- rm -f ups_log.txt @- rm -f ups_log.ps @- rm -f ups_log.pdf @- rm -f timings/time_sr.* @- rm -f CX.log @- rm -f .inslog* @- rm -f .ix*.* @- rm -f *.TVD.breakpoints @- rm -f tca.log @- rm -f *~ @- rm -f $(EXEC) @- rm -f $(EXEC)_out.txt @- rm -f $(EXEC)_err.txt @- rm -f xtest_err.txt @- rm -f ups_sl_log.txt @- rm -f purify_log* #.................................................................. #...which ... #... usage: var='$(shell gmake which WHICH_EXEC=)' ... #... Use this to execute a which command on systems that don't ... #... have "which" ... #.................................................................. which: @ for location in $(addsuffix /$(WHICH_EXEC),$(subst :, ,$(PATH))); do \ if [ -x "$$location" ]; then \ $(ECHO) $$location; \ exit; \ fi; \ done #.................................................................. #...done_sound ... #... nice to have a audible sound when some commands are done. ... #... See the "tar" target in the main Makefile for an example. ... #.................................................................. done_sound: @- $(ECHO)  && sleep 1 && $(ECHO)  end verbatim: