Commit 009209f0 authored by Philip Carns's avatar Philip Carns

experimental: weak symbol stubs for pnetcdf and hdf5 functions


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/branches/weak-symbol-devel@879 3b7491f3-a168-0410-bf4b-c445ed680a29
parent d96ba0d8
all: lib/libdarshan-posix.a lib/libdarshan-mpi-io.a
all: lib/libdarshan-posix.a lib/libdarshan-mpi-io.a lib/libdarshan-stubs.a
DESTDIR =
srcdir = @srcdir@
......@@ -45,6 +45,9 @@ lib/darshan-mpi-init-finalize.o: lib/darshan-mpi-init-finalize.c darshan.h darsh
lib/darshan-mpi-init-finalize.po: lib/darshan-mpi-init-finalize.c darshan.h darshan-dynamic.h $(DARSHAN_LOG_FORMAT) | 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-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
......@@ -54,6 +57,9 @@ lib/darshan-pnetcdf.po: lib/darshan-pnetcdf.c darshan.h $(DARSHAN_LOG_FORMAT) |
lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-hdf5-stubs.o: lib/darshan-hdf5-stubs.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-hdf5.po: lib/darshan-hdf5.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
......@@ -81,6 +87,9 @@ lib/lookup8.po: lib/lookup8.c
lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o lib/darshan-mpi-init-finalize.o lib/darshan-pnetcdf.o lib/darshan-hdf5.o
ar rcs $@ $^
lib/libdarshan-stubs.a: lib/darshan-pnetcdf-stubs.o lib/darshan-hdf5-stubs.o
ar rcs $@ $^
lib/libdarshan-posix.a: lib/darshan-posix.o lib/lookup3.o lib/lookup8.o
ar rcs $@ $^
......
/*
* (C) 2009 by Argonne National Laboratory.
* See COPYRIGHT 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 __real_H5Fcreate(const char *filename, unsigned flags,
hid_t create_plist, hid_t access_plist) __attribute__((weak));
hid_t __real_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 __real_H5Fopen(const char *filename, unsigned flags,
hid_t access_plist) __attribute__((weak));
hid_t __real_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 __real_H5Fclose(hid_t file_id) __attribute__((weak));
herr_t __real_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);
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
/*
* (C) 2009 by Argonne National Laboratory.
* See COPYRIGHT 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 __real_ncmpi_create(MPI_Comm comm, const char *path,
int cmode, MPI_Info info, int *ncidp) __attribute__((weak));
int __real_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 __real_ncmpi_open(MPI_Comm comm, const char *path,
int omode, MPI_Info info, int *ncidp) __attribute__((weak));
int __real_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 __real_ncmpi_close(int ncid) __attribute__((weak));
int __real_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
*/
......@@ -11,8 +11,8 @@ Requires.private:
darshan_prefix=@prefix@
darshan_includedir=
darshan_libdir= -L${darshan_prefix}/lib
darshan_linkopts="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64"
darshan_linkopts="-Wl,-u,MPI_Init,-u,MPI_Wtime,-u,H5Fcreate,-u,ncmpi_create,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64"
Cflags:
Libs: ${darshan_linkopts} ${darshan_libdir} -lfmpich -lmpichcxx -ldarshan-mpi-io -ldarshan-posix
Libs: ${darshan_linkopts} ${darshan_libdir} -lfmpich -lmpichcxx -ldarshan-mpi-io -ldarshan-posix -ldarshan-stubs
Libs.private:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment