| We are having trouble compiling git.mumps with similar errors (using ifort 2017, yikes). Could the forwarded patches be applied to petsc/pkg-mumps, please? Thanks in advance (and sorry if this should be handled @petsc-maint), Pierre
|
Set flags according to the Make.seq.inc file Index: mumps/examples/Makefile =================================================================== --- mumps.orig/examples/Makefile +++ mumps/examples/Makefile @@ -27,28 +27,28 @@ LIBSMUMPS = $(libdir)/libsmumps$(PLAT)$(LIBEXT) $(LIBMUMPS_COMMON) ssimpletest: $(LIBSMUMPS) [email protected] - $(FL) -o $@ $(OPTL) ssimpletest.o $(LIBSMUMPS) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) + $(FL) -o $@ $(OPTL) ssimpletest.o $(LIBSMUMPS) $(LORDERINGS) $(LIBS) $(MUMPS_LIBF77) $(LIBBLAS) $(LIBOTHERS) LIBDMUMPS = $(libdir)/libdmumps$(PLAT)$(LIBEXT) $(LIBMUMPS_COMMON) dsimpletest: $(LIBDMUMPS) [email protected] - $(FL) -o $@ $(OPTL) dsimpletest.o $(LIBDMUMPS) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) + $(FL) -o $@ $(OPTL) dsimpletest.o $(LIBDMUMPS) $(LORDERINGS) $(LIBS) $(MUMPS_LIBF77) $(LIBBLAS) $(LIBOTHERS) LIBCMUMPS = $(libdir)/libcmumps$(PLAT)$(LIBEXT) $(LIBMUMPS_COMMON) csimpletest: $(LIBCMUMPS) [email protected] - $(FL) -o $@ $(OPTL) csimpletest.o $(LIBCMUMPS) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) + $(FL) -o $@ $(OPTL) csimpletest.o $(LIBCMUMPS) $(LORDERINGS) $(LIBS) $(MUMPS_LIBF77) $(LIBBLAS) $(LIBOTHERS) LIBZMUMPS = $(libdir)/libzmumps$(PLAT)$(LIBEXT) $(LIBMUMPS_COMMON) zsimpletest: $(LIBZMUMPS) [email protected] - $(FL) -o $@ $(OPTL) zsimpletest.o $(LIBZMUMPS) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) + $(FL) -o $@ $(OPTL) zsimpletest.o $(LIBZMUMPS) $(LORDERINGS) $(LIBS) $(MUMPS_LIBF77) $(LIBBLAS) $(LIBOTHERS) c_example: $(LIBDMUMPS) [email protected] - $(FL) -o $@ $(OPTL) [email protected] $(LIBDMUMPS) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) + $(FL) -o $@ $(OPTL) [email protected] $(LIBDMUMPS) $(LORDERINGS) $(LIBS) $(MUMPS_LIBF77) $(LIBBLAS) $(LIBOTHERS) multiple_arithmetics_example: $(LIBSMUMPS) $(LIBDMUMPS) $(LIBCMUMPS) $(LIBZMUMPS) [email protected]
## ## This file derives by that original in MUMPS 4.10.0. ## Adapted by Antonio Trande from Make.inc/Makefile.gfortran.PAR for RPM packaging for Fedora. ##
#Begin orderings # NOTE that PORD is distributed within MUMPS by default. If you would like to # use other orderings, you need to obtain the corresponding package and modify # the variables below accordingly. # For example, to have Metis available within MUMPS: # 1/ download Metis and compile it # 2/ uncomment (suppress # in first column) lines # starting with LMETISDIR, LMETIS # 3/ add -Dmetis in line ORDERINGSF # ORDERINGSF = -Dpord -Dmetis # 4/ Compile and install MUMPS # make clean; make (to clean up previous installation) # # Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 5.1 and later) orderings are now available for MUMPS. # SCOTCHDIR = /usr #ISCOTCH = -I$(SCOTCHDIR)/include # You have to choose one among the following two lines depending on # the type of analysis you want to perform. If you want to perform only # sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF # variable below); for both parallel and sequential analysis choose the second # line (remember to add -Dptscotch in the ORDERINGSF variable below) LSCOTCH = -L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr LSCOTCH = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr LPORDDIR = $(topdir)/PORD/lib/ IPORD = -I$(topdir)/PORD/include/ LPORD = -L$(LPORDDIR) -lpord$(PLAT) #LMETISDIR = /local/metis/ #IMETIS = # Metis doesn't need include files (Fortran interface avail.) # You have to choose one among the following two lines depending on # the type of analysis you want to perform. If you want to perform only # sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF # variable below); for both parallel and sequential analysis choose the second # line (remember to add -Dparmetis in the ORDERINGSF variable below) LMETIS = -L$(LMETISDIR) -lmetis #LMETIS = -L$(LMETISDIR) -lparmetis -lmetis # The following variables will be used in the compilation process. # Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively. #ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis ORDERINGSF = -Dpord ORDERINGSC = $(ORDERINGSF) LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) IORDERINGSF = $(ISCOTCH) IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) #End orderings ######################################################################## ################################################################################ PLAT = LIBEXT = .so OUTC = -o OUTF = -o RM = /bin/rm -f CC = gcc FC = gfortran FL = gfortran AR = ar vr #RANLIB = ranlib RANLIB = echo SCALAP = -lscalapack -lmpiblacs #INCPAR = -I/usr/local/include INCPAR = $(MUMPS_INCDIR) #LIBPAR = $(SCALAP) -L/usr/local/lib/ -llammpio -llamf77mpi -lmpi -llam -lutil -ldl -lpthread MPIFLIB = @@MPIFORTRANLIB@@ MPICLIB = @@MPICLIB@@ METISLIB = -lmetis LIBPAR = $(SCALAP) $(MPIFLIB) # See point 17 in the FAQ to have more details on the compilation of mpich with gfortran INCSEQ = -I$(topdir)/libseq LIBSEQ = -L$(topdir)/libseq -lmpiseq$(PLAT) #LIBBLAS = -L/usr/lib/xmm/ -lf77blas -latlas #LIBBLAS = -lblas LIBOTHERS = -lpthread #Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER) CDEFS = -DAdd_ #Begin Optimized options OPTF = @@CFLAGS@@ -Dintel_ -Wno-unused-dummy-argument -Wno-maybe-uninitialized OPTL = @@-O@@ OPTC = @@CFLAGS@@ #End Optimized options INCS = $(INCPAR) #LIB = $(LIBPAR) LIBSEQNEEDED =
Create a shared version of the MUMPS library.
Index: mumps/src/Makefile
===================================================================
--- mumps.orig/src/Makefile
+++ mumps/src/Makefile
@@ -23,8 +23,10 @@
include $(topdir)/Makefile.inc
-mumps_lib: $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
- $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
+mumps_lib: $(libdir)/libmumps_common$(PLAT).a \
+ $(libdir)/libmumps_common$(PLAT).so \
+ $(libdir)/lib$(ARITH)mumps$(PLAT).a \
+ $(libdir)/lib$(ARITH)mumps$(PLAT).so
OBJS_COMMON_MOD = \
ana_omp_m.o\
@@ -177,14 +179,23 @@
$(ARITH)tools.o\
$(ARITH)type3_root.o
-$(libdir)/libmumps_common$(PLAT)$(LIBEXT): $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
- $(AR)$@ $?
+$(libdir)/libmumps_common$(PLAT).a: $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
+ $(AR) $@ $?
$(RANLIB) $@
-$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT): $(OBJS_MOD) $(OBJS_OTHER)
- $(AR)$@ $?
+$(libdir)/libmumps_common$(PLAT).so: $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
+ $(FC) -shared $^ -Wl,-soname,libmumps_common$(PLAT)-$(SONAME_VERSION).so $(OPTL) -L$(libdir) $(LORDERINGS) -lpthread $(MUMPS_LIBF77) $(MPIFLIB) $(MPICLIB) $(METISLIB) -o $(libdir)/libmumps_common$(PLAT)-$(SONAME_VERSION).so $(OPTL) -Wl,-z,defs
+ ln -fs libmumps_common$(PLAT)-$(SONAME_VERSION).so $@
+
+$(libdir)/lib$(ARITH)mumps$(PLAT).a: $(OBJS_MOD) $(OBJS_OTHER)
+ $(AR) $@ $?
$(RANLIB) $@
+$(libdir)/lib$(ARITH)mumps$(PLAT).so: $(OBJS_MOD) $(OBJS_OTHER)
+ $(FC) -shared $^ -Wl,-soname,lib$(ARITH)mumps$(PLAT)-$(SONAME_VERSION).so $(OPTL) -L$(libdir) -lmumps_common$(PLAT) $(MUMPS_LIBF77) $(LORDERINGS) $(MPIFLIB) $(METISLIB) $(SCALAP) -o $(libdir)/lib$(ARITH)mumps$(PLAT)-$(SONAME_VERSION).so $(OPTL) -Wl,-z,defs
+ ln -fs lib$(ARITH)mumps$(PLAT)-$(SONAME_VERSION).so $@
+
+
# Dependencies between modules:
# i) arithmetic-dependent modules:
$(ARITH)ana_aux.o: $(ARITH)mumps_struc_def.o \
@@ -382,13 +393,13 @@
.SUFFIXES: .c .F .o
.F.o:
- $(FC) $(OPTF) $(INCS) $(IORDERINGSF) $(ORDERINGSF) -I. -I../include -c $*.F $(OUTF)$*.o
+ $(FC) $(OPTF) $(INCS) $(IORDERINGSF) $(ORDERINGSF) -I. -I../include -fPIC -c $*.F $(OUTF)$*.o
.c.o:
- $(CC) $(OPTC) $(INCS) -I../include $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC)$*.o
+ $(CC) $(OPTC) $(INCS) -I../include $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -fPIC -c $*.c $(OUTC)$*.o
$(ARITH)mumps_c.o: mumps_c.c
$(CC) $(OPTC) $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \
- $(IORDERINGSC) $(ORDERINGSC) -I../include -c mumps_c.c $(OUTC)$@
+ $(IORDERINGSC) $(ORDERINGSC) -I../include -fPIC -c mumps_c.c $(OUTC)$@
clean:
$(RM) *.o *.mod
Create static and shared versions of the PORD library.
Index: mumps/PORD/lib/Makefile
===================================================================
--- mumps.orig/PORD/lib/Makefile
+++ mumps/PORD/lib/Makefile
@@ -9,7 +9,7 @@
INCLUDES = -I../include
-COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS)
+COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS) -fPIC
OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
multisector.o gelim.o bucket.o tree.o \
@@ -24,12 +24,16 @@
.c.o:
$(CC) $(COPTIONS) -c $*.c $(OUTC)$*.o
-libpord$(LIBEXT):$(OBJS)
- $(AR)$@ $(OBJS)
+libpord$(PLAT).a:$(OBJS)
+ $(AR) $@ $(OBJS)
$(RANLIB) $@
+libpord$(PLAT).so: $(OBJS)
+ $(CC) -shared $(OBJS) -Wl,-soname,libpord$(PLAT)-$(SONAME_VERSION).so -o libpord$(PLAT)-$(SONAME_VERSION).so $(OPTL) -Wl,-z,defs
+ ln -fs libpord$(PLAT)-$(SONAME_VERSION).so $@
+
clean:
rm -f *.o
realclean:
- rm -f *.o libpord.a
+ rm -f *.o libpord*.a *.so
Index: mumps/Makefile
===================================================================
--- mumps.orig/Makefile
+++ mumps/Makefile
@@ -54,7 +54,7 @@
multi_example: s d c z
(cd examples ; $(MAKE) multi)
-requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT)
+requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT).a $(libdir)/libpord$(PLAT).so
# dummy MPI library (sequential version)
@@ -62,19 +62,26 @@
(cd libseq; $(MAKE))
# Build the libpord.a library and copy it into $(topdir)/lib
-$(libdir)/libpord$(PLAT)$(LIBEXT):
+$(libdir)/libpord$(PLAT).a:
if [ "$(LPORDDIR)" != "" ] ; then \
cd $(LPORDDIR); \
$(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT); \
fi;
if [ "$(LPORDDIR)" != "" ] ; then \
- cp $(LPORDDIR)/libpord$(LIBEXT) $@; \
+ cp $(LPORDDIR)/libpord$(PLAT).a $@; \
fi;
+$(libdir)/libpord$(PLAT).so:
+ if [ "$(LPORDDIR)" != "" ] ; then \
+ cd $(LPORDDIR); make CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" ARFUNCT= RANLIB="$(RANLIB)" libpord$(PLAT).so; fi;
+ if [ "$(LPORDDIR)" != "" ] ; then \
+ cp -a $(LPORDDIR)/libpord*.so lib/; fi;
+
+
clean:
(cd src; $(MAKE) clean)
(cd examples; $(MAKE) clean)
- (cd $(libdir); $(RM) *$(PLAT)$(LIBEXT))
+ (cd $(libdir); $(RM) *$(PLAT).a *$(PLAT).so)
(cd libseq; $(MAKE) clean)
if [ "$(LPORDDIR)" != "" ] ; then \
cd $(LPORDDIR); $(MAKE) realclean; \
|
