darshan-config.in 1.13 KB
Newer Older
1 2 3
#!/bin/sh

DARSHAN_LIB_PATH="@darshan_lib_path@"
4
DARSHAN_SHARE_PATH="@darshan_share_path@"
5 6
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).
13

14
PRE_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan -lz -Wl,@$DARSHAN_SHARE_PATH/ld-opts/darshan-base-ld-opts"
15
POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -Wl,--start-group -ldarshan -ldarshan-stubs -Wl,--end-group -lz -lrt -lpthread"
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