From 7b93b571cd7ebc41e955a33831e673d2a430fa82 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 25 Jan 2006 14:57:00 +0000 Subject: [PATCH] Added ifdefs for 64-bit addresses. --- Make.inc.gfortran | 3 +- Make.inc.ifc71 | 72 ++++++++++++++++++++++++++++------------ Make.inc.ifc8 | 1 + src/prec/fort_slu_impl.c | 4 +++ src/prec/fort_umf_impl.c | 11 +++--- 5 files changed, 65 insertions(+), 26 deletions(-) diff --git a/Make.inc.gfortran b/Make.inc.gfortran index 9b9ba0d5..12a10789 100644 --- a/Make.inc.gfortran +++ b/Make.inc.gfortran @@ -1,4 +1,4 @@ -.mod=.mod +ù.mod=.mod .fh=.fh .SUFFIXES: .f90 $(.mod) @@ -40,6 +40,7 @@ UMFDIR=$(HOME)/LIB/Umfpack_gcc41 UMF=-lumfpack -lamd -L$(UMFDIR) UMFDEF=-DHave_UMF_ -I$(UMFDIR) +# Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) AR=ar -cur diff --git a/Make.inc.ifc71 b/Make.inc.ifc71 index 73023219..8e0b735e 100644 --- a/Make.inc.ifc71 +++ b/Make.inc.ifc71 @@ -1,39 +1,69 @@ -# Using Intel Fortran compiler version 7.0 .mod=.mod +.fh=.fh .SUFFIXES: .f90 $(.mod) -F90=${IFC7}/bin/ifc -FC=${IFC7}/bin/ifc + + +####################### Section 1 ####################### +# Define your compilers and compiler flags here # +########################################################## +F90=/opt/intel/compiler70/ia32/bin/ifc +FC=/opt/intel/compiler70/ia32/bin/ifc F77=$(FC) F90COPT=-O3 -FCOPT=-O3 +FCOPT=-O3 CC=gcc CCOPT=-O3 + +####################### Section 2 ####################### +# Define your linker and linker flags here # +########################################################## F90LINK=/usr/local/mpich-ifc71/bin/mpif90 -FLINK=mpif77 +FLINK=/usr/local/mpich-ifc71/mpif77 MPF90=/usr/local/mpich-ifc71/bin/mpif90 -MPCC=/usr/local/mpich-ifc71/bin/mpicc -# -# -BLAS=-lblas -L$(HOME)/LIB +MPCC=/usr/local/mpich-ifc71/bin/mpicc + +####################### Section 3 ####################### +# Specify paths to libraries # +########################################################## +BLAS=-lblasintel -L$(HOME)/LIB BLACS=-lmpiblacsifc71 -L$(HOME)/LIB -SLU=-lslu_lx_ifc8 -# -CDEFINES=-DAdd_ + + +####################### Section 4 ####################### +# Other useful tools&defines # +########################################################## +SLUDIR=/usr/local/SuperLU_3.0 +SLU=-lslu_lx_ifc8 -L$(SLUDIR) +SLUDEF=-DHave_SLU_ -I$(SLUDIR) + +UMFDIR=$(HOME)/LIB/Umfpack_gcc41 +UMF=-lumfpack -lamd -L$(UMFDIR) +UMFDEF=-DHave_UMF_ -I$(UMFDIR) + +CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) + AR=ar -cur RANLIB=ranlib -TYPEMODS = TYPESP$(.mod) TYPEDESC$(.mod) TYPEPREC$(.mod) REALLOC$(.mod) -CONSTMODS = TOOLS_CONST$(.mod) -BLASMODS = $(TYPEMODS) F90PSBLAS$(.mod) F90COMM$(.mod) -METHDMODS = F90METHD$(.mod) -TOOLSMODS = $(CONSTMODS) PSIMOD$(.mod) F90TOOLS$(.mod) F90SERIAL$(.mod) STRING$(.mod) -PRECMODS = F90PREC$(.mod) -F90MODS= $(BLASMODS) $(PRECMODS) $(METHDMODS) $(TOOLSMODS) F90SPARSE$(.mod) -MODS=$(LIBDIR)/TOOLS_CONST$(.mod) $(LIBDIR)/TYPESP$(.mod) $(LIBDIR)/REALLOC$(.mod) \ - $(LIBDIR)/TYPEDESC$(.mod) $(LIBDIR)/parts.f90 $(LIBDIR)/STRING$(.mod) +####################### 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) # Under Linux/gmake there is a rule interpreting .mod as Modula source! $(.mod).o: diff --git a/Make.inc.ifc8 b/Make.inc.ifc8 index bfcd7b62..7d8e423e 100644 --- a/Make.inc.ifc8 +++ b/Make.inc.ifc8 @@ -40,6 +40,7 @@ UMFDIR=$(HOME)/LIB/Umfpack_gcc41 UMF=-lumfpack -lamd -L$(UMFDIR) UMFDEF=-DHave_UMF_ -I$(UMFDIR) +# Add -DLargeFptr for 64-bit addresses CDEFINES=-DAdd_ $(SLUDEF) $(UMFDEF) AR=ar -cur diff --git a/src/prec/fort_slu_impl.c b/src/prec/fort_slu_impl.c index 7a36855e..2767d1ec 100644 --- a/src/prec/fort_slu_impl.c +++ b/src/prec/fort_slu_impl.c @@ -54,7 +54,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define HANDLE_SIZE 8 /* kind of integer to hold a pointer. Use int. This might need to be changed on 64-bit systems. */ +#ifdef LargeFptr +typedef long long fptr; /* 32-bit by default */ +#else typedef int fptr; /* 32-bit by default */ +#endif typedef struct { SuperMatrix *L; diff --git a/src/prec/fort_umf_impl.c b/src/prec/fort_umf_impl.c index d0862290..28f1b48c 100644 --- a/src/prec/fort_umf_impl.c +++ b/src/prec/fort_umf_impl.c @@ -57,8 +57,11 @@ Availability: #include "umfpack.h" #endif +#ifdef LargeFptr +typedef long long fptr; /* 64-bit*/ +#else typedef int fptr; /* 32-bit by default */ - +#endif void fort_umf_factor_(int *n, int *nnz, @@ -162,7 +165,7 @@ fort_umf_solve_(int *itrans, int *n, } *info = umfpack_di_solve(trans,NULL,NULL,NULL, - x,b,*numptr,Control,Info); + x,b,(void *) *numptr,Control,Info); #else fprintf(stderr," UMF Not Configured, fix make.inc and recompile\n"); @@ -193,8 +196,8 @@ fort_umf_free_( */ #ifdef Have_UMF_ void *Symbolic, *Numeric ; - Symbolic = *symptr; - Numeric = *numptr; + Symbolic = (void *) *symptr; + Numeric = (void *) *numptr; umfpack_di_free_numeric(&Numeric); umfpack_di_free_symbolic(&Symbolic);