From f7064fa18183d8f86db1e51d71487bc3f01fd56f Mon Sep 17 00:00:00 2001 From: Tom Payerle Date: Thu, 21 Jan 2021 23:41:11 -0500 Subject: [PATCH] mumps: Fix for problematic src/makefile patch (#20590) (#20758) * mumps: Fix for problematic src/makefile patch (#20590) Minor change in src/Makefile between 5.2.0 and 5.3.3 causing patch to break. Split into 2 patchfiles * mumps: Additional patch for fixing #20590 This is to fix issue wherein build fails on Ubuntu due to undefined symbols, despite symbols being included in other libraries referenced on the compilation line. I believe the issue is that the inclusion of libsmumps.so was (due to my original patch) causing libmumps_common.so to be automatically loaded, but since libpords.so was not also required, the error was occuring. I have added libpords.so along with libmumps_common.so to be explicit dependencies of libsmumps.so, etc., which seems to resolve the issue. --- ...ile.patch => mumps.src-makefile.5.2.patch} | 0 .../mumps/mumps.src-makefile.5.3.patch | 24 +++++++++++++++++++ .../repos/builtin/packages/mumps/package.py | 5 +++- 3 files changed, 28 insertions(+), 1 deletion(-) rename var/spack/repos/builtin/packages/mumps/{mumps.src-makefile.patch => mumps.src-makefile.5.2.patch} (100%) create mode 100644 var/spack/repos/builtin/packages/mumps/mumps.src-makefile.5.3.patch diff --git a/var/spack/repos/builtin/packages/mumps/mumps.src-makefile.patch b/var/spack/repos/builtin/packages/mumps/mumps.src-makefile.5.2.patch similarity index 100% rename from var/spack/repos/builtin/packages/mumps/mumps.src-makefile.patch rename to var/spack/repos/builtin/packages/mumps/mumps.src-makefile.5.2.patch diff --git a/var/spack/repos/builtin/packages/mumps/mumps.src-makefile.5.3.patch b/var/spack/repos/builtin/packages/mumps/mumps.src-makefile.5.3.patch new file mode 100644 index 0000000000..eb88806723 --- /dev/null +++ b/var/spack/repos/builtin/packages/mumps/mumps.src-makefile.5.3.patch @@ -0,0 +1,24 @@ +diff -Naur spack-src/src/Makefile spack-src.patched/src/Makefile +--- spack-src/src/Makefile 2020-06-15 05:57:25.000000000 -0400 ++++ spack-src.patched/src/Makefile 2021-01-08 14:43:28.655026604 -0500 +@@ -193,7 +193,7 @@ + $(RANLIB) $@ + + $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT): $(OBJS_MOD) $(OBJS_OTHER) +- $(AR)$@ $? ++ $(AR)$@ $? $(EXTRA_LIBS4MUMPS) + $(RANLIB) $@ + + # Dependencies between modules: +@@ -405,9 +405,9 @@ + + .SUFFIXES: .c .F .o + .F.o: +- $(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF)$*.o ++ $(FC) $(OPTF) $(FC_PIC_FLAG) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF)$*.o + .c.o: +- $(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC)$*.o ++ $(CC) $(OPTC) $(CC_PIC_FLAG) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC)$*.o + + $(ARITH)mumps_c.o: mumps_c.c + $(CC) $(OPTC) -I../include $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \ diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index cede6d24b3..da3174e539 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -55,7 +55,8 @@ class Mumps(Package): patch('gfortran8.patch', when='@5.1.2') # The following patches src/Makefile to fix some dependency # issues in lib[cdsz]mumps.so - patch('mumps.src-makefile.patch', when='+shared') + patch('mumps.src-makefile.5.2.patch', when='@5.2.0 +shared') + patch('mumps.src-makefile.5.3.patch', when='@5.3.0: +shared') def write_makefile_inc(self): if ('+parmetis' in self.spec or '+ptscotch' in self.spec) and ( @@ -79,6 +80,8 @@ def write_makefile_inc(self): orderings = ['-Dpord'] # All of the lib[cdsz]mumps.* libs depend on mumps_common extra_libs4mumps = ['-L$(topdir)/lib', '-lmumps_common'] + # and mumps_common depends on pord + extra_libs4mumps += ['-L$(topdir)/PORD/lib', '-lpord'] if '+ptscotch' in self.spec or '+scotch' in self.spec: makefile_conf.extend([