Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37918749
en ru br
ALT Linux repos
S:5.3.5-alt3

Group :: Sciences/Mathematics
RPM: mumps

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: MUMPS-shared-pord.patch
Download


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; \
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin