darshan-config.in 1.06 KB
Newer Older
Philip Carns's avatar
Philip Carns committed
1 2 3 4 5 6
#!/bin/sh

CP_WRAPPERS="@CP_WRAPPERS@"
DARSHAN_LIB_PATH="@darshan_lib_path@"
DARSHAN_LD_FLAGS="@LDFLAGS@"

7 8 9 10 11 12
# NOTE:
# - we deliberately list libdarshan-mpi-io twice in the link command.  The
#   first is necessary to correctly use the MPI profiling interface.  The
#   final one is necessary to give the linker a change to resolve indirect
#   dependencies on PnetCDF and HDF5 symbols (if the app used a library which 
#   in turn used one of those HLLs).
Philip Carns's avatar
Philip Carns committed
13
PRE_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan-mpi-io -lz $CP_WRAPPERS"
14
POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan-posix -ldarshan-mpi-io -lz -lrt -lpthread"
15

Philip Carns's avatar
Philip Carns committed
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

usage="\
Usage: darshan-config [--pre-ld-flags] [--post-ld-flags]"

if test $# -eq 0; then
      echo "${usage}" 1>&2
      exit 1
fi

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --pre-ld-flags)
      echo $PRE_LD_FLAGS
      ;;
    --post-ld-flags)
      echo $POST_LD_FLAGS
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done