summarylogtreecommitdiffstats
path: root/shared-libseq.patch
blob: 4c05c15eff56ae1ef70e331be0faa084bf0b6a8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Create a shared version of the sequential library, MUST BE LAST IN SERIES

Index: mumps/libseq/Makefile
===================================================================
--- mumps.orig/libseq/Makefile	2020-10-01 23:16:43.684187324 +0800
+++ mumps/libseq/Makefile	2020-10-01 23:16:43.680187348 +0800
@@ -8,15 +8,20 @@
 
 include ../Makefile.inc
 
-libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
+libmpiseq: libmpiseq$(PLAT).a libmpiseq$(PLAT).so
 
-libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
-	$(AR)$@ mpi.o mpic.o elapse.o
+libmpiseq$(PLAT).a: mpi.o mpic.o elapse.o
+	$(AR) $@ mpi.o mpic.o elapse.o
 	$(RANLIB) $@
+libmpiseq$(PLAT).so: mpi.o mpic.o elapse.o
+	$(FC) $(OPTL) -shared $^ -Wl,-soname,libmpiseq$(PLAT)-$(SOVERSION).so -o libmpiseq$(PLAT)-$(VERSION).so -Wl,-z,defs
+	ln -s libmpiseq$(PLAT)-$(VERSION).so libmpiseq$(PLAT)-$(SOVERSION).so
+	ln -s libmpiseq$(PLAT)-$(VERSION).so $@
+
 .f.o:
-	$(FC) $(OPTF)              -c $*.f $(OUTF)$*.o
+	$(FC) $(OPTF)              -fPIC -c $*.f $(OUTF)$*.o
 .c.o:
-	$(CC) $(OPTC) $(CDEFS) -I. -c $*.c $(OUTC)$*.o
+	$(CC) $(OPTC) $(CDEFS) -I. -fPIC -c $*.c $(OUTC)$*.o
 
 clean:
-	$(RM) *.o *$(LIBEXT)
+	$(RM) *.o *.a *.so
Index: mumps/Makefile
===================================================================
--- mumps.orig/Makefile	2020-10-01 23:16:43.684187324 +0800
+++ mumps/Makefile	2020-10-01 23:16:43.680187348 +0800
@@ -63,6 +63,7 @@
 
 libseqneeded:
 	(cd libseq; $(MAKE))
+	cp libseq/lib* $(libdir)
 
 # Build the libpord.a library and copy it into $(topdir)/lib
 $(libdir)/libpord$(PLAT).a: