linux-cc.patch 1.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
--- /opt/cray/xt-asyncpe/5.01/bin/linux-cc	2011-08-12 12:43:14.000000000 -0500
+++ bin/linux-cc	2012-08-09 14:08:50.742694968 -0500
@@ -1444,6 +1444,39 @@ else
      HDF5_INCFLAGS=
 fi
 
+###
+# Process Darshan libraries
+###
+
+if [ ${CRAY_DARSHAN_DIR:+1} ] ; then
+
+   unset LIBDARSHAN
+   unset DARSHAN_POST_LINK_OPTS
+
+   # disable darshan if dynamic linking
+   if [ "$XTPE_LINK_TYPE" != "dynamic" ] ; then
+
+      case $PE_ENV in     
+      PGI )
+         LIBDARSHAN=`${CRAY_DARSHAN_DIR}/bin/darshan-config --post-ld-flags`
+         DARSHAN_POST_LINK_OPTS=`${CRAY_DARSHAN_DIR}/bin/darshan-config --pre-ld-flags`
+      ;;
+      GNU )
+         LIBDARSHAN=`${CRAY_DARSHAN_DIR}/bin/darshan-config --post-ld-flags`
+         DARSHAN_POST_LINK_OPTS=`${CRAY_DARSHAN_DIR}/bin/darshan-config --pre-ld-flags`
+      ;;
+      *)
+         # TODO: test with other environments (Pathscale, Intel, and Cray)
+      ;;
+      esac
+
+   fi
+
+else
+   LIBDARSHAN=
+   DARSHAN_POST_LINK_OPTS=
+fi
+
 ##
 # PMI
 ##
@@ -1678,7 +1711,7 @@ fi
 
 CNL_LIBS_LIST="$CNL_LIBS_LIST $LIBGA $LIBONESIDED $LIBNTK $LIBSCIFFT $LIBPETSC \
     $LIBTPSL $LIBNETCDF $LIBHDF5 $LIBACML $LIBSCI_ACC $LIBSCI $LIBFFTW ${as_needed_on} $LIBMPT $LIBMPICH2 \
-    $LIBSHMEM $LIBSMA $LIBXPMEM $LIBDMAPP $LIBUGNI $LIBPORTALS $LIBPMI $LIBALPS $LIBUDREG ${as_needed_off}" 
+    $LIBSHMEM $LIBSMA $LIBXPMEM $LIBDMAPP $LIBUGNI $LIBPORTALS $LIBPMI $LIBALPS $LIBUDREG ${as_needed_off} $LIBDARSHAN" 
 
 LIBSPATH="$PRODUCT_LDFLAGS $APP_LIBS_DIR $CNL_LIBS_DIR $SE_LIBS_DIR"
 
@@ -1706,6 +1739,10 @@ fi
         eval $($BUILD_OPTS)
    fi
 
+if [ ${DARSHAN_POST_LINK_OPTS:+1} ] ; then
+   POST_COMPILE_OPTS="${DARSHAN_POST_LINK_OPTS} ${POST_LINK_OPTS}" 
+fi
+
 comp_only=0
 
 for arg