Skip to content

Commit aad6f0c

Browse files
committed
Split library into:
libc-collfs: This part resides inside libc without any dependencies on tricky functions like printf() or on MPI. This part only provides redirects into an external library through a struct full of function pointers. libcollfs.so (from collfs.c): Normal user-space library that has the redirected IO code and the public API to activate the redirects and to push/pop MPI communicators.
1 parent e0f8994 commit aad6f0c

File tree

8 files changed

+569
-349
lines changed

8 files changed

+569
-349
lines changed

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CC = mpicc
44
#MPICC = gcc -m64
55
MPICC = mpicc
66
#CFLAGS = -I/bgsys/drivers/V1R4M2_200_2010-100508P/ppc/comm/default/include -I/bgsys/drivers/V1R4M2_200_2010-100508P/ppc/comm/sys/include -std=c99 -fPIC -Wall -Wextra ${CFLAGS_DEBUG}
7-
CFLAGS = -std=c99 -fPIC -Wall -Wextra ${CFLAGS_DEBUG}
7+
CFLAGS = -std=c99 -fPIC -Wall -Wextra ${CFLAGS_DEBUG} -D_LARGEFILE64_SOURCE
88
CFLAGS_DEBUG = -g3 -DDEBUG=1
99
#LDFLAGS = -Wl,-Bdynamic -Wl,-rpath,/home/aron/sys/lib -L/home/aron/sys/lib ${LIBDL}
1010
LDFLAGS = -dynamic -Wl,-Bdynamic -Wl,-rpath,/home/aron/bgsys/lib -L/home/aron/bgsys/lib ${LIBDL}
@@ -14,21 +14,26 @@ COLLFS_SRC_O = $(COLLFS_SRC_C:.c=.o)
1414

1515
all : libthefunc.so main
1616

17+
libc-collfs.so : libc-collfs.o
18+
${CC} -shared -g3 -o $@ $^
19+
libcollfs.so : collfs.o
20+
${CC} -shared -g3 -o $@ $^
1721
libthefunc.so : thefunc.o
1822
${CC} -shared -g3 -o $@ $^
1923
thefunc.o : thefunc.c
2024
${CC} ${CFLAGS} -c -fPIC $^
2125

22-
main : main.o libfoo.so
26+
main : main.o libfoo.so libcollfs.so libc-collfs.so
2327
${MPICC} -g3 -o $@ $^ ${LDFLAGS}
2428
.c.o :
25-
${MPICC} ${CFLAGS} -fPIC -c $^
29+
${CC} ${CFLAGS} -fPIC -c $^
2630

2731
libfoo.so : foo.o collfs.o
2832
${MPICC} -g3 -shared -o $@ $^ ${LDFLAGS}
2933

30-
collfs.o : collfs.c collfs.h
31-
foo.o : foo.c foo.h errmacros.h collfs.h
34+
collfs.o : collfs.c collfs.h libc-collfs.h
35+
libc-collfs.o : libc-collfs.c libc-collfs.h libc-collfs-private.h
36+
foo.o : foo.c foo.h errmacros.h collfs.h libc-collfs-private.h
3237
main.o : main.c errmacros.h
3338
thefunc.o : thefunc.h collfs.h
3439

0 commit comments

Comments
 (0)