26
31
#------------------------- mpi wrappers -----------------------
27
# Build libmpiwrap.so for the primary target only.
32
# Build libmpiwrap.so for the primary target, and for the secondary
29
35
# This is really horrible.
31
# Don't let automake install this, since it puts it in the
32
# wrong place. Instead install it ourselves in the right
37
# Don't let automake install this, since it puts the .so's in the
38
# wrong place. Instead install them ourselves in the right
33
39
# place using the install-exec-local target below.
35
41
# Also, automake isn't good at supporting non-$(CC) compilers.
36
42
# But we need to use $(MPI_CC) here. Hence the nasty hack of
37
# directly saying how to build libmpiwrap.so, instead of
43
# directly saying how to build libmpiwrap-*.so, instead of
38
44
# using automake's standard gunk.
41
noinst_PROGRAMS = libmpiwrap.so
42
#libmpiwrap_so_SOURCES = mpiwrap.c
43
#libmpiwrap_so_CFLAGS = $(AM_FLAG_M3264_PRI) \
44
# -g -O -fPIC -fno-omit-frame-pointer \
45
# -I../include -I@MPI_PREFIX@/include
46
#libmpiwrap_so_LDFLAGS = $(AM_FLAG_M3264_PRI) -g -shared
48
# Note re leading '-'s: tells GNU make to keep going even if command fails
50
libmpiwrap.so: libmpiwrap.c
51
-$(MPI_CC) -g -O -fno-omit-frame-pointer -Wall -fPIC -shared \
53
$(AM_FLAG_M3264_PRI) \
54
-o libmpiwrap.so libmpiwrap.c
47
HACKY_FLAGS_PRI = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \
49
`echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g`
50
HACKY_FLAGS_SEC = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \
52
`echo $(AM_FLAG_M3264_SEC) | sed s/maix/q/g`
54
HACKY_FLAGS_PRI = -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
56
HACKY_FLAGS_SEC = -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
61
## First, we have to say how to build the .so's ..
65
noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_PRI@.so
66
libmpiwrap-@VG_PLATFORM_PRI@.so: libmpiwrap.c
67
$(MPI_CC) $(HACKY_FLAGS_PRI) \
69
-o libmpiwrap-@VG_PLATFORM_PRI@.so libmpiwrap.c
72
noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_SEC@.so
73
libmpiwrap-@VG_PLATFORM_SEC@.so: libmpiwrap.c
74
$(MPI_CC) $(HACKY_FLAGS_SEC) \
76
-o libmpiwrap-@VG_PLATFORM_SEC@.so libmpiwrap.c
80
## And here we say how to install them.
82
# The following install hack is serialised by "libmpiwrap.so".
56
86
install-exec-local:
57
88
# convert (eg) X86_LINUX to x86-linux
58
89
# really should use sed here, rather than assume tr is available
59
90
pD=`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \
60
$(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD;
61
-pD=`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \
62
$(INSTALL_PROGRAM) ./libmpiwrap.so $(DESTDIR)$(valdir)/$$pD
91
$(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \
92
rm -f ./libmpiwrap.so; \
93
cp ./libmpiwrap-@VG_PLATFORM_PRI@.so ./libmpiwrap.so; \
94
$(INSTALL_PROGRAM) ./libmpiwrap.so \
95
$(DESTDIR)$(valdir)/$$pD; \
99
pD=`echo @VG_PLATFORM_SEC@ | tr A-Z_ a-z-` ; \
100
$(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \
101
rm -f ./libmpiwrap.so; \
102
cp ./libmpiwrap-@VG_PLATFORM_SEC@.so ./libmpiwrap.so; \
103
$(INSTALL_PROGRAM) ./libmpiwrap.so \
104
$(DESTDIR)$(valdir)/$$pD; \
105
rm -f ./libmpiwrap.so
109
## And some hacks to keep 'make dist' happy.
110
## It would seem that using nodist_SOURCES is the right fix, but
111
## I can't figure out how to do it.
113
#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_PRI@.c
114
#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_SEC@.c
120
libmpiwrap-@VG_PLATFORM_PRI@.c:
121
rm -f libmpiwrap-@VG_PLATFORM_PRI@.c
122
touch libmpiwrap-@VG_PLATFORM_PRI@.c
124
if VGP_HAVE_SECONDARY
125
libmpiwrap-@VG_PLATFORM_SEC@.c:
126
rm -f libmpiwrap-@VG_PLATFORM_SEC@.c
127
touch libmpiwrap-@VG_PLATFORM_SEC@.c
132
rm -f libmpiwrap-.c \
133
libmpiwrap-@VG_PLATFORM_PRI@.c libmpiwrap-@VG_PLATFORM_SEC@.c
65
136
#----------------------------------------------------------