summarylogtreecommitdiffstats
path: root/shared-pord.patch
blob: 64c8d8cf8a4d73b556dd9e76e51c21dd81f5e498 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Create static and shared versions of the PORD library.

Index: mumps/PORD/lib/Makefile
===================================================================
--- mumps.orig/PORD/lib/Makefile	2020-10-01 23:16:20.992316016 +0800
+++ mumps/PORD/lib/Makefile	2020-10-01 23:16:20.984316062 +0800
@@ -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,17 @@
 .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)-$(SOVERSION).so -o libpord$(PLAT)-$(VERSION).so -Wl,-z,defs
+	ln -s libpord$(PLAT)-$(VERSION).so libpord$(PLAT)-$(SOVERSION).so
+	ln -s libpord$(PLAT)-$(VERSION).so $@
+
 clean:
 	rm -f *.o
 
 realclean:
-	rm -f *.o libpord.a
+	rm -f *.o libpord*.a *.so
Index: mumps/Makefile
===================================================================
--- mumps.orig/Makefile	2020-10-01 23:16:20.992316016 +0800
+++ mumps/Makefile	2020-10-01 23:16:20.988316040 +0800
@@ -57,7 +57,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)
 
@@ -65,19 +65,25 @@
 	(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; \