[Darshan-commits] [Git][darshan/darshan][master] 2 commits: simplify static linking implementation
Shane Snyder
xgitlab at cels.anl.gov
Thu Apr 9 13:02:15 CDT 2020
Shane Snyder pushed to branch master at darshan / darshan
Commits:
f759e67f by Shane Snyder at 2020-04-09T13:02:12-05:00
simplify static linking implementation
- - - - -
bbdfb4f9 by Shane Snyder at 2020-04-09T13:02:12-05:00
Merge branch 'dev-cleanup-static-link' into 'master'
simplify static linking implementation
See merge request darshan/darshan!44
- - - - -
7 changed files:
- darshan-runtime/Makefile.in
- darshan-runtime/darshan-config.in
- − darshan-runtime/lib/darshan-hdf5-stubs.c
- − darshan-runtime/lib/darshan-pnetcdf-stubs.c
- darshan-runtime/lib/pkgconfig/darshan-runtime.pc.in
- darshan-runtime/share/ld-opts/darshan-hdf5-ld-opts
- darshan-runtime/share/ld-opts/darshan-pnetcdf-ld-opts
Changes:
=====================================
darshan-runtime/Makefile.in
=====================================
@@ -20,7 +20,7 @@ DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
DARSHAN_VERSION = @DARSHAN_VERSION@
ifndef DISABLE_STATIC_LIB
-all: lib/libdarshan.a lib/libdarshan-stubs.a
+all: lib/libdarshan.a
endif
ifndef DISABLE_LDPRELOAD
all: lib/libdarshan.so
@@ -155,18 +155,12 @@ lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h darshan-common.h $(DARSHAN_LOG_
lib/darshan-hdf5.po: lib/darshan-hdf5.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-hdf5-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
-lib/darshan-hdf5-stubs.o: lib/darshan-hdf5-stubs.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
- $(CC) $(CFLAGS) -c $< -o $@
-
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-pnetcdf-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-pnetcdf.po: lib/darshan-pnetcdf.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-pnetcdf-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
-lib/darshan-pnetcdf-stubs.o: lib/darshan-pnetcdf-stubs.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
- $(CC) $(CFLAGS) -c $< -o $@
-
lib/darshan-lustre.o: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
@@ -210,20 +204,11 @@ lib/libdarshan.a: lib/darshan-core-init-finalize.o lib/darshan-core.o lib/darsha
lib/libdarshan.so: lib/darshan-core-init-finalize.po lib/darshan-core.po lib/darshan-common.po $(DARSHAN_DYNAMIC_MOD_OBJS) lib/lookup3.po lib/lookup8.po
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
-ifdef BUILD_HDF5_MODULE
-lib/libdarshan-stubs.a: lib/darshan-hdf5-stubs.o lib/darshan-pnetcdf-stubs.o
- ar rcs $@ $^
-else
-lib/libdarshan-stubs.a: lib/darshan-pnetcdf-stubs.o
- ar rcs $@ $^
-endif
-
install:: all
install -d $(DESTDIR)$(libdir)
ifndef DISABLE_STATIC_LIB
install -m 755 lib/libdarshan.a $(DESTDIR)$(libdir)
- install -m 755 lib/libdarshan-stubs.a $(DESTDIR)$(libdir)
endif
ifndef DISABLE_LDPRELOAD
install -m 755 lib/libdarshan.so $(DESTDIR)$(libdir)
=====================================
darshan-runtime/darshan-config.in
=====================================
@@ -12,7 +12,7 @@ DARSHAN_LD_FLAGS="@LDFLAGS@"
# app used a library which in turn used one of those HLLs).
PRE_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan -lz -Wl,@$DARSHAN_SHARE_PATH/ld-opts/darshan-base-ld-opts"
-POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -Wl,--start-group -ldarshan -ldarshan-stubs -Wl,--end-group -lz -lrt -lpthread"
+POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan -lz -lrt -lpthread"
# NOTE:
# - when dynamic linking there is no need for wrapping options, we simply
=====================================
darshan-runtime/lib/darshan-hdf5-stubs.c deleted
=====================================
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2015 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- */
-
-/* This file contains stubs for the H5F functions intercepted by Darshan.
- * They are defined as weak symbols in order to satisfy dependencies of the
- * hdf5 wrappers in cases where hdf5 is not being used.
- */
-
-
-#include "darshan-runtime-config.h"
-#include <stdio.h>
-#include <pthread.h>
-#include <string.h>
-#include "mpi.h"
-#include "darshan.h"
-
-/* hope this doesn't change any time soon */
-typedef int hid_t;
-typedef int herr_t;
-
-hid_t H5Fcreate(const char *filename, unsigned flags,
- hid_t create_plist, hid_t access_plist) __attribute__((weak));
-
-hid_t H5Fcreate(const char *filename, unsigned flags,
- hid_t create_plist, hid_t access_plist)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan H5Fcreate() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-}
-
-hid_t H5Fopen(const char *filename, unsigned flags,
- hid_t access_plist) __attribute__((weak));
-
-hid_t H5Fopen(const char *filename, unsigned flags,
- hid_t access_plist)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan H5Fopen() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-}
-
-herr_t H5Fclose(hid_t file_id) __attribute__((weak));
-
-herr_t H5Fclose(hid_t file_id)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan H5Fclose() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-}
-
-herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum) __attribute__((weak));
-
-herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan H5get_libversion() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
=====================================
darshan-runtime/lib/darshan-pnetcdf-stubs.c deleted
=====================================
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2015 University of Chicago.
- * See COPYRIGHT notice in top-level directory.
- *
- */
-
-/* This file contains stubs for the ncmpi functions intercepted by Darshan.
- * They are defined as weak symbols in order to satisfy dependencies of the
- * pnetcdf wrappers in cases where pnetcdf is not being used.
- */
-
-#include "darshan-runtime-config.h"
-#include <stdio.h>
-#include <pthread.h>
-#include <string.h>
-#include "mpi.h"
-#include "darshan.h"
-
-int ncmpi_create(MPI_Comm comm, const char *path,
- int cmode, MPI_Info info, int *ncidp) __attribute__((weak));
-
-int ncmpi_create(MPI_Comm comm, const char *path,
- int cmode, MPI_Info info, int *ncidp)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan ncmpi_create() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-}
-
-int ncmpi_open(MPI_Comm comm, const char *path,
- int omode, MPI_Info info, int *ncidp) __attribute__((weak));
-
-int ncmpi_open(MPI_Comm comm, const char *path,
- int omode, MPI_Info info, int *ncidp)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan ncmpi_open() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-}
-
-int ncmpi_close(int ncid) __attribute__((weak));
-
-int ncmpi_close(int ncid)
-{
- int rank;
-
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if(rank == 0)
- {
- fprintf(stderr, "WARNING: Darshan ncmpi_close() stub called; this is probably the result of a link-time problem.\n");
- }
-
- return(-1);
-
-}
-
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ts=8 sts=4 sw=4 expandtab
- */
=====================================
darshan-runtime/lib/pkgconfig/darshan-runtime.pc.in
=====================================
@@ -16,4 +16,4 @@ darshan_linkopts="-Wl,@${darshan_share}/ld-opts/darshan-base-ld-opts"
Cflags:
Libs: -ldarshan
-Libs.private: ${darshan_linkopts} ${darshan_libdir} -lfmpich -lmpichcxx -Wl,--start-group -ldarshan -ldarshan-stubs -Wl,--end-group
+Libs.private: ${darshan_linkopts} ${darshan_libdir} -lfmpich -lmpichcxx -ldarshan
=====================================
darshan-runtime/share/ld-opts/darshan-hdf5-ld-opts
=====================================
@@ -1,4 +1,3 @@
---undefined=__wrap_H5Fcreate
--wrap=H5Fcreate
--wrap=H5Fopen
--wrap=H5Fclose
=====================================
darshan-runtime/share/ld-opts/darshan-pnetcdf-ld-opts
=====================================
@@ -1,4 +1,3 @@
---undefined=__wrap_ncmpi_create
--wrap=ncmpi_create
--wrap=ncmpi_open
--wrap=ncmpi_close
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/50c4669deba4a794b4be91e9a4fb5bddca162991...bbdfb4f9dd0f86dcb3ce452fba4addbff9c9e53f
--
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/50c4669deba4a794b4be91e9a4fb5bddca162991...bbdfb4f9dd0f86dcb3ce452fba4addbff9c9e53f
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20200409/b23cb943/attachment-0001.html>
More information about the Darshan-commits
mailing list