From 06e1239502e7cc91f62161f8bab35bbe0119f2e5 Mon Sep 17 00:00:00 2001 From: Maurice Brémond Date: Mon, 14 Oct 2019 17:44:54 +0200 Subject: gnu: mumps: Build and install shared libraries. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/mumps-shared-libseq.patch, gnu/packages/patches/mumps-shared-mumps.patch, gnu/packages/patches/mumps-shared-pord.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/maths.scm (mumps)[source](patches): Add them. [arguments]: In 'configure' phase, adjust "Makefile.inc" for shared library support. In 'install' phase, install libmpiseq.so when it exists. Co-authored-by: Ludovic Courtès --- gnu/packages/patches/mumps-shared-pord.patch | 77 ++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 gnu/packages/patches/mumps-shared-pord.patch (limited to 'gnu/packages/patches/mumps-shared-pord.patch') diff --git a/gnu/packages/patches/mumps-shared-pord.patch b/gnu/packages/patches/mumps-shared-pord.patch new file mode 100644 index 0000000000..48062d4f89 --- /dev/null +++ b/gnu/packages/patches/mumps-shared-pord.patch @@ -0,0 +1,77 @@ +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 @@ OBJS = graph.o gbipart.o gbisect.o ddcre + .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)-5.1.2.so -o libpord$(PLAT)-5.1.2.so -Wl,-z,defs ++ ln -s libpord$(PLAT)-5.1.2.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 @@ dexamples: d + 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,25 @@ libseqneeded: + (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; \ -- cgit v1.2.3