Print

Print


Commit in SimDist/scripts on MAIN
slic-ldpath.sh.in+56added 1.1
script for setting up load path if all packages are compiled with shared libs

SimDist/scripts
slic-ldpath.sh.in added at 1.1
diff -N slic-ldpath.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ slic-ldpath.sh.in	29 Jun 2011 21:19:43 -0000	1.1
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# This is a relocateable script for setting up the library load path for SimDist libraries
+# on multiple platforms (Linux, OSX, Cygwin).  It must be processed by SimDist's configure
+# to produce ./scripts/slic-ldpath.sh which can then be sourced on the user's machine.
+#
+# It tries to find the local SimDist installation using two ways...
+#
+# --Check if it is the current directory and then proceed automatically if it appears okay.
+# --Check for user setting of SIM_HOME which is checked for validity.
+#
+# If neither works, an error message is printing requesting manual setting of SIM_HOME.
+#
+# The tricks used in ./scripts/slic.sh cannot be used here because this script is included
+# rather than run so information on the path is lost.
+#
+
+# Check if running from the SimDist base dir.
+if [ ! -d ./packages/slic ]; then
+    # Not in base dir, so check if SIM_HOME was set.
+    if [ -z "$SIM_HOME" ]; then
+        # Oops!  Need the user to tell us where SIM_HOME is located.
+        echo "ERROR:  This script doesn't know where SimDist is locally installed.  Please set SIM_HOME to point to the SimDist base dir."
+        exit 1
+    fi
+# Looks like curr dir is SimDist.
+else
+    SIM_HOME=`pwd`
+fi
+
+# Check that the SIM_HOME var points to SimDist area.
+if [ ! -d $SIM_HOME/packages/slic ]; then
+    echo "ERROR: The SIM_HOME variable setting does not appear to point to a valid SimDist."
+    exit 1
+fi
+
+echo "SIM_HOME=${SIM_HOME}"
+
+# Figure out library paths for deps based on relative SimDist path.
+# FIXME: The relative paths should be figured out in configure, not here.  Then SIM_HOME dir can then be added in front here.
+CLHEP_LIB_DIR=${SIM_HOME}/packages/clhep/@CLHEP_VERSION@/lib
+G4_LIB_DIR=${SIM_HOME}/packages/geant4/@GEANT4_VERSION@/lib/@G4SYSTEM@
+GDML_LIB_DIR=${SIM_HOME}/packages/gdml/@GDML_VERSION@/CPPGDML/build/@G4SYSTEM@/lib
+XERCES_LIB_DIR=${SIM_HOME}/packages/xerces/@XERCES_VERSION@/lib
+LCIO_LIB_DIR=${SIM_HOME}/packages/lcio/@LCIO_VERSION@/lib
+LCDD_LIB_DIR=${SIM_HOME}/packages/lcdd/@LCDD_VERSION@/lib
+HEPPDT_LIB_DIR=${SIM_HOME}/packages/heppdt/@[log in to unmask]
+HEPPID_LIB_DIR=${SIM_HOME}/packages/heppdt/@[log in to unmask]
+SLIC_LIB_DIR=${SIM_HOME}/packages/slic/@SLIC_VERSION@/lib
+
+#QT_LIB_DIR=@QTHOME@/lib
+
+unset @OS_SHARED_LIBS_VAR@
+export @OS_SHARED_LIBS_VAR@=${CLHEP_LIB_DIR}:${G4_LIB_DIR}:${GDML_LIB_DIR}:${XERCES_LIB_DIR}:${LCIO_LIB_DIR}:${LCDD_LIB_DIR}:${HEPPDT_LIB_DIR}:${HEPPID_LIB_DIR}:${SLIC_LIB_DIR}
+
+echo "@OS_SHARED_LIBS_VAR@=${@OS_SHARED_LIBS_VAR@}"
CVSspam 0.2.8