From ae4600eefbd881d295b8777fb8e44d50fe901776 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 27 Mar 2007 14:16:41 +0000 Subject: [PATCH] Changes for SUN compilers. --- Changelog | 2 + Make.inc | 37 ++++--- Make.inc.g95 | 57 ++++++---- Make.inc.gcc42 | 37 ++++--- Make.inc.gcc42-serialmpi | 39 ++++--- Make.inc.ifc9 | 35 ++++-- Make.inc.sp5 | 32 ++++-- Make.inc.sun-6.2 | 103 ++++++++++++++++++ Makefile | 4 +- base/comm/Makefile | 8 +- .../{psb_dscatter.f90 => psb_dscatter.F90} | 10 ++ .../{psb_iscatter.f90 => psb_iscatter.F90} | 10 ++ .../{psb_zscatter.f90 => psb_zscatter.F90} | 10 ++ base/internals/Makefile | 7 +- ...{psi_desc_index.f90 => psi_desc_index.F90} | 5 + .../{psi_dswapdata.f90 => psi_dswapdata.F90} | 10 ++ .../{psi_dswaptran.f90 => psi_dswaptran.F90} | 10 ++ .../{psi_extrct_dl.f90 => psi_extrct_dl.F90} | 5 + .../{psi_iswapdata.f90 => psi_iswapdata.F90} | 10 ++ .../{psi_iswaptran.f90 => psi_iswaptran.F90} | 10 ++ .../{psi_zswapdata.f90 => psi_zswapdata.F90} | 10 ++ .../{psi_zswaptran.f90 => psi_zswaptran.F90} | 10 ++ base/modules/Makefile | 7 +- base/modules/psb_penv_mod.F90 | 96 ++++++++++++++-- base/psblas/Makefile | 6 +- base/serial/Makefile | 6 +- base/serial/aux/Makefile | 6 +- base/serial/coo/Makefile | 6 +- base/serial/csr/Makefile | 6 +- base/serial/dp/Makefile | 7 +- base/serial/f77/Makefile | 6 +- base/serial/jad/Makefile | 7 +- base/tools/Makefile | 6 +- base/tools/psb_cdals.f90 | 4 +- base/tools/{psb_dcdovr.f90 => psb_dcdovr.F90} | 7 +- .../{psb_dsphalo.f90 => psb_dsphalo.F90} | 7 +- base/tools/{psb_icdasb.f90 => psb_icdasb.F90} | 7 +- base/tools/{psb_zcdovr.f90 => psb_zcdovr.F90} | 7 +- .../{psb_zsphalo.f90 => psb_zsphalo.F90} | 7 +- krylov/Makefile | 2 +- prec/Makefile | 2 +- test/fileread/Makefile | 4 +- test/pargen/Makefile | 4 +- test/util/Makefile | 4 +- util/Makefile | 3 +- 45 files changed, 529 insertions(+), 149 deletions(-) create mode 100644 Make.inc.sun-6.2 rename base/comm/{psb_dscatter.f90 => psb_dscatter.F90} (99%) rename base/comm/{psb_iscatter.f90 => psb_iscatter.F90} (99%) rename base/comm/{psb_zscatter.f90 => psb_zscatter.F90} (99%) rename base/internals/{psi_desc_index.f90 => psi_desc_index.F90} (99%) rename base/internals/{psi_dswapdata.f90 => psi_dswapdata.F90} (99%) rename base/internals/{psi_dswaptran.f90 => psi_dswaptran.F90} (99%) rename base/internals/{psi_extrct_dl.f90 => psi_extrct_dl.F90} (99%) rename base/internals/{psi_iswapdata.f90 => psi_iswapdata.F90} (99%) rename base/internals/{psi_iswaptran.f90 => psi_iswaptran.F90} (99%) rename base/internals/{psi_zswapdata.f90 => psi_zswapdata.F90} (99%) rename base/internals/{psi_zswaptran.f90 => psi_zswaptran.F90} (99%) rename base/tools/{psb_dcdovr.f90 => psb_dcdovr.F90} (99%) rename base/tools/{psb_dsphalo.f90 => psb_dsphalo.F90} (99%) rename base/tools/{psb_icdasb.f90 => psb_icdasb.F90} (98%) rename base/tools/{psb_zcdovr.f90 => psb_zcdovr.F90} (99%) rename base/tools/{psb_zsphalo.f90 => psb_zsphalo.F90} (99%) diff --git a/Changelog b/Changelog index 68a47839..c4b6c0d3 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,8 @@ Changelog. A lot less detailed than usual, at least for past history. +2007/03/27: Merged in changes for enabling compilation on SUN. + 2007/02/22: Fixed various misalignments between real and complex. Defined new psb_sp_clip routines. Fixed psb_rwextd. diff --git a/Make.inc b/Make.inc index d87f2222..0d1ed531 100644 --- a/Make.inc +++ b/Make.inc @@ -10,18 +10,29 @@ F90=/usr/local/gcc42/bin/gfortran FC=/usr/local/gcc42/bin/gfortran F77=$(FC) CC=/usr/local/gcc42/bin/gcc -F90COPT=-O3 -ggdb -FCOPT=-O3 -ggdb -CCOPT=-O3 -ggdb +F90COPT=-O3 -ggdb -pg +FCOPT=-O3 -ggdb -pg +CCOPT=-O3 -ggdb -pg +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-I +FIFLAG=-I ####################### Section 2 ####################### # Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add an include dir # ########################################################## F90LINK=/usr/local/mpich-gcc42/bin/mpif90 FLINK=/usr/local/mpich-gcc42/bin/mpif77 MPF90=/usr/local/mpich-gcc42/bin/mpif90 MPF77=/usr/local/mpich-gcc42/bin/mpif77 MPCC=/usr/local/mpich-gcc42/bin/mpicc +MPI_FINC=-DMPI_MOD +#$(FIFLAG)/opt/SUNWhpc/include ####################### Section 3 ####################### # Specify paths to libraries # @@ -51,7 +62,7 @@ LDLIBS=$(BLACS) $(SLU) $(SLUDist) $(UMF) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) -FDEFINES=-DNETLIB_BLACS -DHAVE_MOVE_ALLOC +FDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC AR=ar -cur RANLIB=ranlib @@ -70,22 +81,22 @@ UTILLIBNAME=libpsb_util.a # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: -.f.o: - $(FC) $(FCOPT) $(INCDIRS) -c $< .c.o: - $(CC) $(CCOPT) $(INCDIRS) $(CDEFINES) -c $< + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f$(.mod): - $(F90) $(FCOPT) $(INCDIRS) -c $< + $(F90) $(FCOPT) $(FINCLUDES) -c $< .f90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .f90.o: - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .F.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< diff --git a/Make.inc.g95 b/Make.inc.g95 index 7a448b3b..dfe5ec9e 100644 --- a/Make.inc.g95 +++ b/Make.inc.g95 @@ -1,6 +1,6 @@ .mod=.mod .fh=.fh -.SUFFIXES: .f90 $(.mod) .F90 +.SUFFIXES: .f90 $(.mod) .F90 .F ####################### Section 1 ####################### @@ -12,15 +12,26 @@ F77=$(FC) F90COPT= -O3 FCOPT=-O3 CCOPT=-O3 +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-I +FIFLAG=-I ####################### Section 2 ####################### # Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add MPIINCDIR # ########################################################## F90LINK=/usr/local/mpich-g95/bin/mpif90 FLINK=/usr/local/mpich-g95/bin/mpif77 MPF90=/usr/local/mpich-g95/bin/mpif90 MPF77=/usr/local/mpich-g95/bin/mpif77 MPCC=/usr/local/mpich-g95/bin/mpicc +MPI_FINC=-DMPI_MOD +#$(FIFLAG)/opt/SUNWhpc/include ####################### Section 3 ####################### # Specify paths to libraries # @@ -42,7 +53,7 @@ BLACS=-lmpiblacsg95 -L$(HOME)/LIB # Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) -FDEFINES=-DNORMAL +FDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC AR=ar -cur RANLIB=ranlib @@ -52,34 +63,32 @@ RANLIB=ranlib ####################### Section 5 ####################### # Do not edit this # ########################################################## -LIBDIR = lib -LIBNAME = libpsblas.a - -TYPEMODS = psb_spmat_type$(.mod) psb_descriptor_type$(.mod) psb_prec_type$(.mod) psb_realloc_mod$(.mod) -CONSTMODS = psb_const_mod$(.mod) -BLASMODS = $(TYPEMODS) psb_psblas_mod$(.mod) psb_comm_mod$(.mod) -METHDMODS = psb_methd_mod$(.mod) -TOOLSMODS = $(CONSTMODS) psi_mod$(.mod) psb_tools_mod$(.mod) psb_serial_mod$(.mod) -PRECMODS = psb_prec_mod$(.mod) -ERRORMODS = psb_error_mod$(.mod) -F90MODS= $(BLASMODS) $(PRECMODS) $(METHDMODS) $(TOOLSMODS) $(ERRORMODS) string$(.mod) - -MODS=$(LIBDIR)/psb_const_mod$(.mod) $(LIBDIR)/psb_spmat_type$(.mod) $(LIBDIR)/psb_realloc_mod$(.mod) \ - $(LIBDIR)/psb_descriptor_type$(.mod) $(LIBDIR)/psb_prec_type$(.mod) $(LIBDIR)/parts.fh \ - $(LIBDIR)/psb_serial_mod$(.mod) $(LIBDIR)/psb_comm_mod$(.mod) $(LIBDIR)/psb_error_mod$(.mod) +LIBDIR=lib +BASELIBNAME=libpsb_base.a +PRECLIBNAME=libpsb_prec.a +METHDLIBNAME=libpsb_krylov.a +UTILLIBNAME=libpsb_util.a # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: -.f.o: - $(FC) $(FCOPT) $(INCDIRS) -c $< .c.o: - $(CC) $(CCOPT) $(INCDIRS) $(CDEFINES) -c $< + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f$(.mod): - $(F90) $(FCOPT) $(INCDIRS) -c $< + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .f90.o: - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< +.F.o: + $(FC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $< .F90.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< +.F90$(.mod): + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< + + + + diff --git a/Make.inc.gcc42 b/Make.inc.gcc42 index d87f2222..0d1ed531 100644 --- a/Make.inc.gcc42 +++ b/Make.inc.gcc42 @@ -10,18 +10,29 @@ F90=/usr/local/gcc42/bin/gfortran FC=/usr/local/gcc42/bin/gfortran F77=$(FC) CC=/usr/local/gcc42/bin/gcc -F90COPT=-O3 -ggdb -FCOPT=-O3 -ggdb -CCOPT=-O3 -ggdb +F90COPT=-O3 -ggdb -pg +FCOPT=-O3 -ggdb -pg +CCOPT=-O3 -ggdb -pg +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-I +FIFLAG=-I ####################### Section 2 ####################### # Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add an include dir # ########################################################## F90LINK=/usr/local/mpich-gcc42/bin/mpif90 FLINK=/usr/local/mpich-gcc42/bin/mpif77 MPF90=/usr/local/mpich-gcc42/bin/mpif90 MPF77=/usr/local/mpich-gcc42/bin/mpif77 MPCC=/usr/local/mpich-gcc42/bin/mpicc +MPI_FINC=-DMPI_MOD +#$(FIFLAG)/opt/SUNWhpc/include ####################### Section 3 ####################### # Specify paths to libraries # @@ -51,7 +62,7 @@ LDLIBS=$(BLACS) $(SLU) $(SLUDist) $(UMF) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) -FDEFINES=-DNETLIB_BLACS -DHAVE_MOVE_ALLOC +FDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC AR=ar -cur RANLIB=ranlib @@ -70,22 +81,22 @@ UTILLIBNAME=libpsb_util.a # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: -.f.o: - $(FC) $(FCOPT) $(INCDIRS) -c $< .c.o: - $(CC) $(CCOPT) $(INCDIRS) $(CDEFINES) -c $< + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f$(.mod): - $(F90) $(FCOPT) $(INCDIRS) -c $< + $(F90) $(FCOPT) $(FINCLUDES) -c $< .f90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .f90.o: - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .F.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< diff --git a/Make.inc.gcc42-serialmpi b/Make.inc.gcc42-serialmpi index de886f01..d3bc2773 100644 --- a/Make.inc.gcc42-serialmpi +++ b/Make.inc.gcc42-serialmpi @@ -7,21 +7,32 @@ # Define your compilers and compiler flags here # ########################################################## F90=/usr/local/gcc42/bin/gfortran -FC=$(F90) +FC=/usr/local/gcc42/bin/gfortran F77=$(FC) CC=/usr/local/gcc42/bin/gcc -F90COPT=-O3 -ggdb -FCOPT=-O3 -ggdb -CCOPT=-O3 -ggdb +F90COPT=-O3 +FCOPT=-O3 +CCOPT=-O3 +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-I +FIFLAG=-I ####################### Section 2 ####################### # Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add MPIINCDIR # ########################################################## F90LINK=$(FC) FLINK=$(FC) MPF90=$(FC) MPF77=$(FC) MPCC=$(CC) +MPI_FINC=-DMPI_MOD +#$(FIFLAG)/opt/SUNWhpc/include ####################### Section 3 ####################### # Specify paths to libraries # @@ -51,7 +62,7 @@ LDLIBS=$(BLACS) $(SLU) $(UMF) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) -FDEFINES=-DHAVE_MOVE_ALLOC -DSERIAL_MPI +FDEFINES=-DHAVE_MOVE_ALLOC -DSERIAL_MPI $(MPI_FINC) AR=ar -cur RANLIB=ranlib @@ -70,22 +81,22 @@ UTILLIBNAME=libpsb_util.a # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: -.f.o: - $(FC) $(FCOPT) $(INCDIRS) -c $< .c.o: - $(CC) $(CCOPT) $(INCDIRS) $(CDEFINES) -c $< + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f$(.mod): - $(F90) $(FCOPT) $(INCDIRS) -c $< + $(F90) $(FCOPT) $(FINCLUDES) -c $< .f90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .f90.o: - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .F.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< diff --git a/Make.inc.ifc9 b/Make.inc.ifc9 index a786eddc..e7a488da 100644 --- a/Make.inc.ifc9 +++ b/Make.inc.ifc9 @@ -13,16 +13,29 @@ F77=$(FC) CC=gcc F90COPT=-O3 FCOPT=-O3 -CCOPT=-O3 +CCOPT=-O3 +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-I +FIFLAG=-I + ####################### Section 2 ####################### # Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add MPIINCDIR # ########################################################## F90LINK=/usr/local/mpich-ifc91/bin/mpif90 FLINK=/usr/local/mpich-ifc91/bin/mpif77 MPF90=/usr/local/mpich-ifc91/bin/mpif90 MPF77=/usr/local/mpich-ifc91/bin/mpif77 MPCC=/usr/local/mpich-ifc91/bin/mpicc +MPI_FINC=-DMPI_MOD +#$(FIFLAG)/opt/SUNWhpc/include + ####################### Section 3 ####################### # Specify paths to libraries # @@ -51,7 +64,7 @@ LDLIBS=$(BLACS) $(SLU) $(UMF) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) -FDEFINES=-DNETLIB_BLACS -DHAVE_MOVE_ALLOC +FDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC AR=ar -cur RANLIB=ranlib @@ -70,22 +83,22 @@ UTILLIBNAME=libpsb_util.a # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: -.f.o: - $(FC) $(FCOPT) $(INCDIRS) -c $< .c.o: - $(CC) $(CCOPT) $(INCDIRS) $(CDEFINES) -c $< + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f$(.mod): - $(F90) $(FCOPT) $(INCDIRS) -c $< + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .f90.o: - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .F.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(FC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $< .F90.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< diff --git a/Make.inc.sp5 b/Make.inc.sp5 index 5abd9f67..0d3ff06f 100644 --- a/Make.inc.sp5 +++ b/Make.inc.sp5 @@ -14,15 +14,27 @@ CC=xlc F90COPT= -O3 FCOPT=-O3 CCOPT=-O3 +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-I +FIFLAG=-I + ####################### Section 2 ####################### # Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add MPIINCDIR # ########################################################## MPF90=mpxlf95 -qsuffix=f=f90 F90LINK=$(MPF90) FLINK=$(MPF90) MPF77=mpxlf95 -qfixed MPCC=mpxlc +MPI_FINC=-WF,-DMPI_MOD +#$(FIFLAG)/opt/SUNWhpc/include ####################### Section 3 ####################### # Specify paths to libraries # @@ -50,7 +62,7 @@ LDLIBS=$(BLACS) $(SLU) $(UMF) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses CDEFINES=-DNoChange $(SLUDEF) $(UMFDEF) -DLargeFptr -FDEFINES=-WF,-DESSL_BLACS +FDEFINES=-WF,-DESSL_BLACS $(MPI_FINC) # Apparently there's no MOVE_ALLOC yet in XLF. #-WF,-DHAVE_MOVE_ALLOC @@ -72,22 +84,22 @@ UTILLIBNAME=libpsb_util.a # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: -.f.o: - $(FC) $(FCOPT) $(INCDIRS) -c $< .c.o: - $(CC) $(CCOPT) $(INCDIRS) $(CDEFINES) -c $< + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f$(.mod): - $(F90) $(FCOPT) $(INCDIRS) -c $< + $(FC) $(FCOPT) $(FINCLUDES) -c $< .f90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .f90.o: - $(F90) $(F90COPT) $(INCDIRS) -c $< + $(F90) $(F90COPT) $(FINCLUDES) -c $< .F.o: - $(FC) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(FC) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90.o: - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< .F90$(.mod): - $(F90) $(F90COPT) $(INCDIRS) $(FDEFINES) -c $< + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< diff --git a/Make.inc.sun-6.2 b/Make.inc.sun-6.2 new file mode 100644 index 00000000..edd360d2 --- /dev/null +++ b/Make.inc.sun-6.2 @@ -0,0 +1,103 @@ +#Makefile for Sun Fortran Compiler version 6.2 + +.mod=.mod +.fh=.fh +.SUFFIXES: .f90 $(.mod) .F90 .F + + +####################### Section 1 ####################### +# Define your compilers and compiler flags here # +########################################################## +F90=f90 +FC=f90 +F77=$(FC) +CC=cc +F90COPT=-fast +FCOPT=-fast +CCOPT=-fast +# +# Which flag does your compiler use for module inclusion? +# Most compilers use -I but Sun uses -M +# FIFLAG is for INCLUDE +FMFLAG=-M +FIFLAG=-I + + +####################### Section 2 ####################### +# Define your linker and linker flags here # +# Does your MPI provide mpi.mod or mpif.h? # +# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD # +# If necessary add the include dir # +########################################################## +F90LINK=mpf90 +FLINK=mpf90 -lf77compat +MPF90=mpf90 +MPF77=mpf90 -lf77compat +MPCC=mpcc +MPI_FINC=-DMPI_H $(FIFLAG)/opt/SUNWhpc/include + +####################### Section 3 ####################### +# Specify paths to libraries # +########################################################## +BLAS=-lblas +BLACS=-lblacsCinit_MPI-SUN4SOL2-0.a -lblacsF77init_MPI-SUN4SOL2-0.a -lblacs_MPI-SUN4SOL2-0.a -L$(HOME)/LIB +BLACS=$(HOME)/LIB/libblacs_MPI-SUN4SOL2-0.a $(HOME)/LIB/libblacsCinit_MPI-SUN4SOL2-0.a $(HOME)/LIB/libblacsF77init_MPI-SUN4SOL2-0.a $(HOME)/LIB/libblacs_MPI-SUN4SOL2-0.a -lmpi + +####################### Section 4 ####################### +# Other useful tools&defines # +########################################################## +SLUDIR= +SLU= +SLUDEF= + +UMFDIR= +UMF= +UMFDEF= + + +METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +LDLIBS=$(BLACS) $(SLU) $(SLUDist) $(UMF) $(BLAS) $(METIS_LIB) + +# Add -DLargeFptr for 64-bit addresses +# SUN compiler does not have MOVE_ALLOC. +# -DHAVE_MOVE_ALLOC +CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) +FDEFINES=-DNETLIB_BLACS $(MPI_FINC) + +AR=ar -cur +RANLIB=ranlib + + + +####################### Section 5 ####################### +# Do not edit this # +########################################################## +LIBDIR=lib +BASELIBNAME=libpsb_base.a +PRECLIBNAME=libpsb_prec.a +METHDLIBNAME=libpsb_krylov.a +UTILLIBNAME=libpsb_util.a + +# Under Linux/gmake there is a rule interpreting .mod as Modula source! +$(.mod).o: + +.c.o: + $(CC) $(CCOPT) $(CINCLUDES) $(CDEFINES) -c $< +.f.o: + $(FC) $(FCOPT) $(FINCLUDES) -c $< +.f$(.mod): + $(FC) $(FCOPT) $(FINCLUDES) -c $< +.f90$(.mod): + $(F90) $(F90COPT) $(FINCLUDES) -c $< +.f90.o: + $(F90) $(F90COPT) $(FINCLUDES) -c $< +.F.o: + $(FC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $< +.F90.o: + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< +.F90$(.mod): + $(F90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< + + + + diff --git a/Makefile b/Makefile index bd90d251..9f3949af 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ include Make.inc -PREC=../mld2p4-dev -#PREC=prec +#PREC=../mld2p4-dev +PREC=prec library: ( [ -d lib ] || mkdir lib) diff --git a/base/comm/Makefile b/base/comm/Makefile index 3a587281..5d8efc6a 100644 --- a/base/comm/Makefile +++ b/base/comm/Makefile @@ -3,10 +3,10 @@ include ../../Make.inc OBJS = psb_dgather.o psb_dhalo.o psb_dovrl.o \ psb_igather.o psb_ihalo.o psb_zgather.o psb_zhalo.o psb_zovrl.o -MPFOBJS = psb_dscatter.o psb_zscatter.o psb_iscatter.o -LIBDIR = .. -MODDIR = ../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . +MPFOBJS=psb_dscatter.o psb_zscatter.o psb_iscatter.o +LIBDIR=.. +MODDIR=../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). lib: mpfobjs $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(OBJS) diff --git a/base/comm/psb_dscatter.f90 b/base/comm/psb_dscatter.F90 similarity index 99% rename from base/comm/psb_dscatter.f90 rename to base/comm/psb_dscatter.F90 index 3ee3b738..ec7ba503 100644 --- a/base/comm/psb_dscatter.f90 +++ b/base/comm/psb_dscatter.F90 @@ -47,9 +47,14 @@ subroutine psb_dscatterm(globx, locx, desc_a, info, iroot) use psb_descriptor_type use psb_check_mod use psb_error_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod implicit none +#ifdef MPI_H + include 'mpif.h' +#endif real(kind(1.d0)), intent(out) :: locx(:,:) real(kind(1.d0)), intent(in) :: globx(:,:) @@ -270,9 +275,14 @@ subroutine psb_dscatterv(globx, locx, desc_a, info, iroot) use psb_descriptor_type use psb_check_mod use psb_error_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod implicit none +#ifdef MPI_H + include 'mpif.h' +#endif real(kind(1.d0)), intent(out) :: locx(:) real(kind(1.d0)), intent(in) :: globx(:) diff --git a/base/comm/psb_iscatter.f90 b/base/comm/psb_iscatter.F90 similarity index 99% rename from base/comm/psb_iscatter.f90 rename to base/comm/psb_iscatter.F90 index c17a096a..7e3ab846 100644 --- a/base/comm/psb_iscatter.f90 +++ b/base/comm/psb_iscatter.F90 @@ -47,9 +47,14 @@ subroutine psb_iscatterm(globx, locx, desc_a, info, iroot) use psb_descriptor_type use psb_check_mod use psb_error_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(out) :: locx(:,:) integer, intent(in) :: globx(:,:) @@ -268,9 +273,14 @@ subroutine psb_iscatterv(globx, locx, desc_a, info, iroot) use psb_descriptor_type use psb_check_mod use psb_error_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(out) :: locx(:) integer, intent(in) :: globx(:) diff --git a/base/comm/psb_zscatter.f90 b/base/comm/psb_zscatter.F90 similarity index 99% rename from base/comm/psb_zscatter.f90 rename to base/comm/psb_zscatter.F90 index 4ba7b566..6491e185 100644 --- a/base/comm/psb_zscatter.f90 +++ b/base/comm/psb_zscatter.F90 @@ -46,9 +46,14 @@ subroutine psb_zscatterm(globx, locx, desc_a, info, iroot) use psb_descriptor_type use psb_check_mod use psb_error_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod implicit none +#ifdef MPI_H + include 'mpif.h' +#endif complex(kind(1.d0)), intent(out) :: locx(:,:) complex(kind(1.d0)), intent(in) :: globx(:,:) @@ -272,9 +277,14 @@ subroutine psb_zscatterv(globx, locx, desc_a, info, iroot) use psb_descriptor_type use psb_check_mod use psb_error_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod implicit none +#ifdef MPI_H + include 'mpif.h' +#endif complex(kind(1.d0)), intent(out) :: locx(:) complex(kind(1.d0)), intent(in) :: globx(:) diff --git a/base/internals/Makefile b/base/internals/Makefile index e354bac8..d2993274 100644 --- a/base/internals/Makefile +++ b/base/internals/Makefile @@ -11,9 +11,10 @@ COBJS = avltree.o srcht.o MPFOBJS = psi_dswapdata.o psi_dswaptran.o psi_iswapdata.o \ psi_iswaptran.o psi_desc_index.o \ psi_zswapdata.o psi_zswaptran.o psi_extrct_dl.o -LIBDIR = .. -MODDIR = ../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . +LIBDIR=.. +MODDIR=../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). +CINCLUDES=-I. lib: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) \ diff --git a/base/internals/psi_desc_index.f90 b/base/internals/psi_desc_index.F90 similarity index 99% rename from base/internals/psi_desc_index.f90 rename to base/internals/psi_desc_index.F90 index 048e8d9e..fac62937 100644 --- a/base/internals/psi_desc_index.f90 +++ b/base/internals/psi_desc_index.F90 @@ -34,10 +34,15 @@ subroutine psi_desc_index(desc,index_in,dep_list,& use psb_realloc_mod use psb_error_mod use psb_const_mod +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod use psi_mod, psb_protect_name => psi_desc_index implicit none +#ifdef MPI_H + include 'mpif.h' +#endif ! ...array parameters..... type(psb_desc_type) :: desc diff --git a/base/internals/psi_dswapdata.f90 b/base/internals/psi_dswapdata.F90 similarity index 99% rename from base/internals/psi_dswapdata.f90 rename to base/internals/psi_dswapdata.F90 index b11a2a55..e0421d65 100644 --- a/base/internals/psi_dswapdata.f90 +++ b/base/internals/psi_dswapdata.F90 @@ -35,8 +35,13 @@ subroutine psi_dswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag, n integer, intent(out) :: info @@ -454,8 +459,13 @@ subroutine psi_dswapdatav(flag,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag integer, intent(out) :: info diff --git a/base/internals/psi_dswaptran.f90 b/base/internals/psi_dswaptran.F90 similarity index 99% rename from base/internals/psi_dswaptran.f90 rename to base/internals/psi_dswaptran.F90 index c2d2e47e..f7a7e407 100644 --- a/base/internals/psi_dswaptran.f90 +++ b/base/internals/psi_dswaptran.F90 @@ -35,8 +35,13 @@ subroutine psi_dswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag, n integer, intent(out) :: info @@ -444,8 +449,13 @@ subroutine psi_dswaptranv(flag,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag integer, intent(out) :: info diff --git a/base/internals/psi_extrct_dl.f90 b/base/internals/psi_extrct_dl.F90 similarity index 99% rename from base/internals/psi_extrct_dl.f90 rename to base/internals/psi_extrct_dl.F90 index 78d31bf8..c1c95c1d 100644 --- a/base/internals/psi_extrct_dl.f90 +++ b/base/internals/psi_extrct_dl.F90 @@ -118,12 +118,17 @@ subroutine psi_extract_dep_list(desc_data,desc_str,dep_list,& ! length_dl integer array(0:np) ! length_dl(i) is the length of dep_list(*,i) list use psi_mod, psb_protect_name => psi_extract_dep_list +#ifdef MPI_MOD use mpi +#endif use psb_penv_mod use psb_const_mod use psb_error_mod use psb_descriptor_type implicit none +#ifdef MPI_H + include 'mpif.h' +#endif ! ....scalar parameters... integer np,dl_lda,mode, info diff --git a/base/internals/psi_iswapdata.f90 b/base/internals/psi_iswapdata.F90 similarity index 99% rename from base/internals/psi_iswapdata.f90 rename to base/internals/psi_iswapdata.F90 index de2898c3..e38ce22b 100644 --- a/base/internals/psi_iswapdata.f90 +++ b/base/internals/psi_iswapdata.F90 @@ -35,8 +35,13 @@ subroutine psi_iswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag, n integer, intent(out) :: info @@ -454,8 +459,13 @@ subroutine psi_iswapdatav(flag,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag integer, intent(out) :: info diff --git a/base/internals/psi_iswaptran.f90 b/base/internals/psi_iswaptran.F90 similarity index 99% rename from base/internals/psi_iswaptran.f90 rename to base/internals/psi_iswaptran.F90 index 45390765..814b642b 100644 --- a/base/internals/psi_iswaptran.f90 +++ b/base/internals/psi_iswaptran.F90 @@ -35,8 +35,13 @@ subroutine psi_iswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag, n integer, intent(out) :: info @@ -444,8 +449,13 @@ subroutine psi_iswaptranv(flag,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag integer, intent(out) :: info diff --git a/base/internals/psi_zswapdata.f90 b/base/internals/psi_zswapdata.F90 similarity index 99% rename from base/internals/psi_zswapdata.f90 rename to base/internals/psi_zswapdata.F90 index c14713a2..50586ca6 100644 --- a/base/internals/psi_zswapdata.f90 +++ b/base/internals/psi_zswapdata.F90 @@ -35,8 +35,13 @@ subroutine psi_zswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag, n integer, intent(out) :: info @@ -454,8 +459,13 @@ subroutine psi_zswapdatav(flag,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag integer, intent(out) :: info diff --git a/base/internals/psi_zswaptran.f90 b/base/internals/psi_zswaptran.F90 similarity index 99% rename from base/internals/psi_zswaptran.f90 rename to base/internals/psi_zswaptran.F90 index 6faf503d..4eeba46c 100644 --- a/base/internals/psi_zswaptran.f90 +++ b/base/internals/psi_zswaptran.F90 @@ -35,8 +35,13 @@ subroutine psi_zswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag, n integer, intent(out) :: info @@ -443,8 +448,13 @@ subroutine psi_zswaptranv(flag,beta,y,desc_a,work,info,data) use psb_descriptor_type use psb_penv_mod use psi_gthsct_mod +#ifdef MPI_MOD use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: flag integer, intent(out) :: info diff --git a/base/modules/Makefile b/base/modules/Makefile index 86ab1a14..53f89ae3 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -14,8 +14,9 @@ MODULES = psb_realloc_mod.o psb_string_mod.o psb_spmat_type.o \ LIBMOD=psb_base_mod$(.mod) MPFOBJS=psb_penv_mod.o OBJS = error.o psb_base_mod.o $(EXTRA_COBJS) -LIBDIR = .. -INCDIRS = -I . +LIBDIR=.. +CINCLUDES=-I. +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG). psb_realloc_mod.o : psb_error_mod.o @@ -34,7 +35,7 @@ psb_base_mod.o: $(MODULES) $(MPFOBJS) lib: mpfobjs $(MODULES) $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) - /bin/cp -p $(LIBMOD) ./parts.fh $(LIBDIR) + /bin/cp -p $(LIBMOD) $(LIBDIR) /bin/cp -p *$(.mod) $(LIBDIR) diff --git a/base/modules/psb_penv_mod.F90 b/base/modules/psb_penv_mod.F90 index a012b2a0..fcf64dda 100644 --- a/base/modules/psb_penv_mod.F90 +++ b/base/modules/psb_penv_mod.F90 @@ -250,7 +250,12 @@ contains end subroutine psb_barrier function psb_wtime() +#ifdef MPI_MOD use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif real(kind(1.d0)) :: psb_wtime psb_wtime = mpi_wtime() @@ -508,7 +513,12 @@ contains subroutine psb_hbcasts(ictxt,dat,root,length) +#ifdef MPI_H + include 'mpif.h' +#endif +#ifdef MPI_MOD use mpi +#endif integer, intent(in) :: ictxt character(len=*), intent(inout) :: dat integer, intent(in), optional :: root,length @@ -536,7 +546,12 @@ contains end subroutine psb_hbcasts subroutine psb_lbcasts(ictxt,dat,root) +#ifdef MPI_H + include 'mpif.h' +#endif +#ifdef MPI_MOD use mpi +#endif integer, intent(in) :: ictxt logical, intent(inout) :: dat integer, intent(in), optional :: root @@ -559,7 +574,12 @@ contains subroutine psb_lbcastv(ictxt,dat,root) +#ifdef MPI_MOD use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt logical, intent(inout) :: dat(:) integer, intent(in), optional :: root @@ -583,7 +603,12 @@ contains subroutine psb_imaxs(ictxt,dat,root) +#ifdef MPI_MOD use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt integer, intent(inout) :: dat integer, intent(in), optional :: root @@ -610,8 +635,13 @@ contains #endif end subroutine psb_imaxs subroutine psb_imaxv(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt integer, intent(inout) :: dat(:) integer, intent(in), optional :: root @@ -643,8 +673,13 @@ contains #endif end subroutine psb_imaxv subroutine psb_imaxm(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt integer, intent(inout) :: dat(:,:) integer, intent(in), optional :: root @@ -677,7 +712,12 @@ contains end subroutine psb_imaxm subroutine psb_dmaxs(ictxt,dat,root) +#ifdef MPI_MOD use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt real(kind(1.d0)), intent(inout) :: dat integer, intent(in), optional :: root @@ -705,8 +745,13 @@ contains #endif end subroutine psb_dmaxs subroutine psb_dmaxv(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt real(kind(1.d0)), intent(inout) :: dat(:) integer, intent(in), optional :: root @@ -741,8 +786,13 @@ contains #endif end subroutine psb_dmaxv subroutine psb_dmaxm(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt real(kind(1.d0)), intent(inout) :: dat(:,:) integer, intent(in), optional :: root @@ -779,7 +829,12 @@ contains subroutine psb_imins(ictxt,dat,root) +#ifdef MPI_MOD use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt integer, intent(inout) :: dat integer, intent(in), optional :: root @@ -806,8 +861,13 @@ contains #endif end subroutine psb_imins subroutine psb_iminv(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt integer, intent(inout) :: dat(:) integer, intent(in), optional :: root @@ -839,8 +899,13 @@ contains #endif end subroutine psb_iminv subroutine psb_iminm(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt integer, intent(inout) :: dat(:,:) integer, intent(in), optional :: root @@ -873,7 +938,12 @@ contains end subroutine psb_iminm subroutine psb_dmins(ictxt,dat,root) +#ifdef MPI_MOD use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt real(kind(1.d0)), intent(inout) :: dat integer, intent(in), optional :: root @@ -901,8 +971,13 @@ contains #endif end subroutine psb_dmins subroutine psb_dminv(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt real(kind(1.d0)), intent(inout) :: dat(:) integer, intent(in), optional :: root @@ -937,8 +1012,13 @@ contains #endif end subroutine psb_dminv subroutine psb_dminm(ictxt,dat,root) - use mpi use psb_realloc_mod +#ifdef MPI_MOD + use mpi +#endif +#ifdef MPI_H + include 'mpif.h' +#endif integer, intent(in) :: ictxt real(kind(1.d0)), intent(inout) :: dat(:,:) integer, intent(in), optional :: root diff --git a/base/psblas/Makefile b/base/psblas/Makefile index 6ac36cb4..de66b893 100644 --- a/base/psblas/Makefile +++ b/base/psblas/Makefile @@ -7,9 +7,9 @@ OBJS= psb_ddot.o psb_damax.o psb_dasum.o psb_daxpby.o\ psb_zamax.o psb_zasum.o psb_zaxpby.o psb_zdot.o \ psb_znrm2.o psb_znrmi.o psb_zspmm.o psb_zspsm.o -LIBDIR = .. -MODDIR = ../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . +LIBDIR=.. +MODDIR=../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). lib: $(OBJS) diff --git a/base/serial/Makefile b/base/serial/Makefile index c4bbd8e3..f7b02fdd 100644 --- a/base/serial/Makefile +++ b/base/serial/Makefile @@ -14,9 +14,9 @@ FOBJS = psb_cest.o psb_dcoins.o psb_dcsdp.o psb_dcsmm.o psb_dcsmv.o \ psb_zrwextd.o psb_zsymbmm.o psb_znumbmm.o psb_zspscal.o psb_zspclip.o\ psb_getifield.o psb_setifield.o psb_update_mod.o -LIBDIR = .. -MODDIR = ../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . +LIBDIR=.. +MODDIR=../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). lib: auxd cood csrd jadd f77d dpd lib1 $(AR) $(LIBDIR)/$(LIBNAME) $(FOBJS) diff --git a/base/serial/aux/Makefile b/base/serial/aux/Makefile index 062a289d..4400b293 100644 --- a/base/serial/aux/Makefile +++ b/base/serial/aux/Makefile @@ -13,9 +13,9 @@ OBJS=$(FOBJS) # Where the library should go, and how it is called. # Note that we are regenerating most of libsparker.a on the fly. SPARKERDIR=.. -LIBDIR = ../.. -MODDIR = ../../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . -I$(SPARKERDIR) +LIBDIR=../.. +MODDIR=../../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG). # # No change should be needed below diff --git a/base/serial/coo/Makefile b/base/serial/coo/Makefile index 4f5f31f9..6b3ca95e 100644 --- a/base/serial/coo/Makefile +++ b/base/serial/coo/Makefile @@ -14,9 +14,9 @@ OBJS=$(FOBJS) # Note that we are regenerating most of libsparker.a on the fly. #LIBNAME=libsparker.a SPARKERDIR=.. -LIBDIR = ../.. -MODDIR = ../../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . -I$(SPARKERDIR) +LIBDIR=../.. +MODDIR=../../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG). LIBFILE=$(LIBDIR)/$(LIBNAME) # diff --git a/base/serial/csr/Makefile b/base/serial/csr/Makefile index 371a3d9e..5129863e 100644 --- a/base/serial/csr/Makefile +++ b/base/serial/csr/Makefile @@ -14,9 +14,9 @@ OBJS=$(FOBJS) # Where the library should go, and how it is called. # Note that we are regenerating most of libsparker.a on the fly. SPARKERDIR=.. -LIBDIR = ../.. -MODDIR = ../../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . -I$(SPARKERDIR) +LIBDIR=../.. +MODDIR=../../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG). LIBFILE=$(LIBDIR)/$(LIBNAME) # diff --git a/base/serial/dp/Makefile b/base/serial/dp/Makefile index 952f406e..972e21b8 100644 --- a/base/serial/dp/Makefile +++ b/base/serial/dp/Makefile @@ -20,9 +20,10 @@ OBJS=$(FOBJS) # Where the library should go, and how it is called. # Note that we are regenerating most of libsparker.a on the fly. SPARKERDIR=.. -LIBDIR = ../.. -MODDIR = ../../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . -I$(SPARKERDIR) +LIBDIR=../.. +MODDIR=../../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG). + #LIBNAME=libsparker.a LIBFILE=$(LIBDIR)/$(LIBNAME) diff --git a/base/serial/f77/Makefile b/base/serial/f77/Makefile index b9ab2145..38333efe 100644 --- a/base/serial/f77/Makefile +++ b/base/serial/f77/Makefile @@ -15,9 +15,9 @@ OBJS=$(FOBJS) # Where the library should go, and how it is called. # Note that we are regenerating most of libsparker.a on the fly. SPARKERDIR=.. -LIBDIR = ../.. -MODDIR = ../../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . -I$(SPARKERDIR) +LIBDIR=../.. +MODDIR=../../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG). #LIBNAME=libsparker.a LIBFILE=$(LIBDIR)/$(LIBNAME) diff --git a/base/serial/jad/Makefile b/base/serial/jad/Makefile index 19bc0ea7..0114d792 100644 --- a/base/serial/jad/Makefile +++ b/base/serial/jad/Makefile @@ -12,10 +12,9 @@ OBJS=$(FOBJS) # Where the library should go, and how it is called. # Note that we are regenerating most of libsparker.a on the fly. SPARKERDIR=.. -LIBDIR = ../.. -MODDIR = ../../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . -I$(SPARKERDIR) -#LIBNAME=libsparker.a +LIBDIR=../.. +MODDIR=../../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG)$(SPARKERDIR) $(FMFLAG). LIBFILE=$(LIBDIR)/$(LIBNAME) # diff --git a/base/tools/Makefile b/base/tools/Makefile index 3ebe6ada..15ce1c7b 100644 --- a/base/tools/Makefile +++ b/base/tools/Makefile @@ -15,9 +15,9 @@ FOBJS = psb_dallc.o psb_dasb.o psb_dcsrp.o psb_cdprt.o \ MPFOBJS = psb_dsphalo.o psb_zsphalo.o psb_icdasb.o psb_dcdovr.o psb_zcdovr.o -LIBDIR = .. -MODDIR = ../modules -INCDIRS = -I $(LIBDIR) -I $(MODDIR) -I . +LIBDIR=.. +MODDIR=../modules +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG)$(MODDIR) $(FMFLAG). $(FIFLAG)$(MODDIR) lib: mpfobjs $(FOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(FOBJS) diff --git a/base/tools/psb_cdals.f90 b/base/tools/psb_cdals.f90 index f8361752..f48d4720 100644 --- a/base/tools/psb_cdals.f90 +++ b/base/tools/psb_cdals.f90 @@ -38,9 +38,9 @@ ! m - integer. The number of rows. ! n - integer. The number of columns. ! parts - external subroutine. The routine that contains the partitioning scheme. -! ictxt - integer. The communication context. +! ictxt - integer. The communication context. ! desc_a - type(). The communication descriptor. -! info - integer. Eventually returns an error code +! info - integer. Error code (if any). subroutine psb_cdals(m, n, parts, ictxt, desc_a, info) use psb_error_mod use psb_descriptor_type diff --git a/base/tools/psb_dcdovr.f90 b/base/tools/psb_dcdovr.F90 similarity index 99% rename from base/tools/psb_dcdovr.f90 rename to base/tools/psb_dcdovr.F90 index 9be55a44..b6d542e2 100644 --- a/base/tools/psb_dcdovr.f90 +++ b/base/tools/psb_dcdovr.F90 @@ -54,8 +54,13 @@ Subroutine psb_dcdovr(a,desc_a,novr,desc_ov,info, extype) use psb_penv_mod use psb_realloc_mod use psi_mod - use mpi +#ifdef MPI_MOD + use mpi +#endif Implicit None +#ifdef MPI_H + include 'mpif.h' +#endif ! .. Array Arguments .. integer, intent(in) :: novr diff --git a/base/tools/psb_dsphalo.f90 b/base/tools/psb_dsphalo.F90 similarity index 99% rename from base/tools/psb_dsphalo.f90 rename to base/tools/psb_dsphalo.F90 index 220c1295..611972af 100644 --- a/base/tools/psb_dsphalo.f90 +++ b/base/tools/psb_dsphalo.F90 @@ -54,8 +54,13 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rwcnv,clcnv,cliprow,outfmt,data) use psb_tools_mod, psb_protect_name => psb_dsphalo use psb_error_mod use psb_penv_mod - use mpi +#ifdef MPI_MOD + use mpi +#endif Implicit None +#ifdef MPI_H + include 'mpif.h' +#endif Type(psb_dspmat_type),Intent(in) :: a Type(psb_dspmat_type),Intent(inout) :: blk diff --git a/base/tools/psb_icdasb.f90 b/base/tools/psb_icdasb.F90 similarity index 98% rename from base/tools/psb_icdasb.f90 rename to base/tools/psb_icdasb.F90 index d8014a8c..e151bbf0 100644 --- a/base/tools/psb_icdasb.f90 +++ b/base/tools/psb_icdasb.F90 @@ -37,14 +37,19 @@ ! desc_a - type(). The communication descriptor. ! info - integer. Eventually returns an error code. subroutine psb_icdasb(desc_a,info,ext_hv) - use mpi use psb_descriptor_type use psb_serial_mod use psb_const_mod use psi_mod use psb_error_mod use psb_penv_mod +#ifdef MPI_MOD + use mpi +#endif implicit none +#ifdef MPI_H + include 'mpif.h' +#endif !...Parameters.... type(psb_desc_type), intent(inout) :: desc_a integer, intent(out) :: info diff --git a/base/tools/psb_zcdovr.f90 b/base/tools/psb_zcdovr.F90 similarity index 99% rename from base/tools/psb_zcdovr.f90 rename to base/tools/psb_zcdovr.F90 index ed10fd2a..82a65537 100644 --- a/base/tools/psb_zcdovr.f90 +++ b/base/tools/psb_zcdovr.F90 @@ -52,8 +52,13 @@ Subroutine psb_zcdovr(a,desc_a,novr,desc_ov,info, extype) use psb_penv_mod use psb_realloc_mod use psi_mod - use mpi +#ifdef MPI_MOD + use mpi +#endif Implicit None +#ifdef MPI_H + include 'mpif.h' +#endif ! .. Array Arguments .. integer, intent(in) :: novr diff --git a/base/tools/psb_zsphalo.f90 b/base/tools/psb_zsphalo.F90 similarity index 99% rename from base/tools/psb_zsphalo.f90 rename to base/tools/psb_zsphalo.F90 index d550810b..a56eb5bc 100644 --- a/base/tools/psb_zsphalo.f90 +++ b/base/tools/psb_zsphalo.F90 @@ -54,8 +54,13 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rwcnv,clcnv,cliprow,outfmt,data) use psb_tools_mod, psb_protect_name => psb_zsphalo use psb_error_mod use psb_penv_mod - use mpi +#ifdef MPI_MOD + use mpi +#endif Implicit None +#ifdef MPI_H + include 'mpif.h' +#endif Type(psb_zspmat_type),Intent(in) :: a Type(psb_zspmat_type),Intent(inout) :: blk diff --git a/krylov/Makefile b/krylov/Makefile index 64b2f7af..754058e4 100644 --- a/krylov/Makefile +++ b/krylov/Makefile @@ -13,7 +13,7 @@ LIBMOD=psb_krylov_mod$(.mod) LOCAL_MODS=$(LIBMOD) LIBNAME=$(METHDLIBNAME) -INCDIRS=-I. -I$(LIBDIR) +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). lib: $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS) diff --git a/prec/Makefile b/prec/Makefile index 2af84258..d3d8f0cf 100644 --- a/prec/Makefile +++ b/prec/Makefile @@ -17,7 +17,7 @@ LIBMOD=psb_prec_mod$(.mod) LOCAL_MODS=$(MODOBJS:.o=$(.mod)) LIBNAME=$(PRECLIBNAME) COBJS= -INCDIRS=-I. -I$(LIBDIR) +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). OBJS=$(F90OBJS) $(COBJS) $(MPFOBJS) $(MODOBJS) lib: $(OBJS) diff --git a/test/fileread/Makefile b/test/fileread/Makefile index 0a821260..f36dd3ba 100644 --- a/test/fileread/Makefile +++ b/test/fileread/Makefile @@ -5,7 +5,7 @@ include ../../Make.inc LIBDIR=../../lib/ PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base -INCDIRS=-I$(LIBDIR) +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). DFOBJS=getp.o df_sample.o ZFOBJS=getp.o zf_sample.o @@ -23,7 +23,7 @@ zf_sample: $(ZFOBJS) /bin/mv zf_sample $(EXEDIR) .f90.o: - $(MPF90) $(F90COPT) $(INCDIRS) -c $< + $(MPF90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< clean: /bin/rm -f $(DFOBJS) $(ZFOBJS) \ diff --git a/test/pargen/Makefile b/test/pargen/Makefile index 74e7b520..32d2078d 100644 --- a/test/pargen/Makefile +++ b/test/pargen/Makefile @@ -9,7 +9,7 @@ PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base # Compilers and such # CCOPT= -g -INCDIRS=-I$(LIBDIR) +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). EXEDIR=./runs @@ -21,7 +21,7 @@ ppde90: ppde90.o .f90.o: - $(MPF90) $(F90COPT) $(INCDIRS) -c $< + $(MPF90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< clean: diff --git a/test/util/Makefile b/test/util/Makefile index 0e7a400f..9e766647 100644 --- a/test/util/Makefile +++ b/test/util/Makefile @@ -9,7 +9,7 @@ PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_base # We are using the public domain tool METIS from U. Minnesota. To get it # check URL http://www.cs.umn.edu:~karypis # -INCDIRS=-I$(LIBDIR) +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). ZH2MOBJS=zhb2mm.o DH2MOBJS=dhb2mm.o @@ -30,7 +30,7 @@ zmm2hb: $(ZM2HOBJS) $(MPF90) -o zmm2hb $(ZM2HOBJS) $(PSBLAS_LIB) $(LDLIBS) .f90.o: - $(MPF90) $(F90COPT) $(INCDIRS) -c $< + $(MPF90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< clean: /bin/rm -f $(MMHBOBJS) dhb2mm zhb2mm dmm2hb zmm2hb diff --git a/util/Makefile b/util/Makefile index 7991a50b..17d151a2 100644 --- a/util/Makefile +++ b/util/Makefile @@ -13,7 +13,8 @@ OBJS=$(BASEOBJS) $(MODOBJ) LIBMOD=psb_util_mod$(.mod) LOCAL_MODS=$(OBJS:.o=$(.mod)) LIBNAME=$(UTILLIBNAME) -INCDIRS=-I. -I$(LIBDIR) +FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). + lib: $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)