Building Software Against Binary Globus Toolkit Releases

Today I read about GridWay winning the “Best Demo Prize” at the EGEE 2007 Conference in Budapest (Congratulations to the GridWay Team!), and this reminded me about the problem of building applications against the binary Globus Toolkit (GT) releases. Namely, building software like GridWay against the binary GT install usually fails with link errors. The problem is that the .la files in the $GLOBUS_LOCATION/lib directory have hardcoded the original build path for the dependency libraries. This issue has been known for some time (see, e.g. GT bug #174), and it persists in the 4.0.x releases of the Toolkit. The easiest solution is to build and install your GT from sources. However, if this is not an option, one can use a script that modifies the hardcoded paths in the binary GT install (do not worry, the script does not modify binary files :-)):
#!/bin/sh
# fix_paths.sh
# Script for modifying hardcoded library dependency paths in the binary
# Globus Toolkit installation.
# Usage.
usage() {
echo "Usage: $0 [oldPath] [newPath]"
}
oldPath=$1
newPath=$2
if [ $# -ne 2 ]; then
usage
exit 1
fi
if [ "$GLOBUS_LOCATION" = "" ]; then
echo "\$GLOBUS_LOCATION is not defined."
exit 1
fi
echo "Replacing $oldPath by $newPath in various ASCII files."
cd $GLOBUS_LOCATION
# Try to avoid header files, *.gar and *.jar files, config xml files, etc.
fileList=`find . -type f ! -name '*.h' -a ! -name '*.gar' -a ! -name '*.xml' -a ! -name '*.jar' -a ! -name '*LICENSE*'`
cnt=0
for f in $fileList; do
isAscii=`file $f | grep ASCII`
if [ "$isAscii" != "" ]; then
cmd="cat $f | sed 's?$oldPath?$newPath?g' > $f.tmp"
eval $cmd
diffPath=`diff $f.tmp $f`
if [ "$diffPath" != "" ]; then
echo "Fixing: $f"
mv $f.tmp $f
cnt=`expr $cnt + 1`
else
rm -f $f.tmp
fi
fi
done
echo "Fixed $cnt files."
exit 0
In order to use the above script, one has to determine the hardcoded paths by looking into one of the .la files in the $GLOBUS_LOCATION/lib directory. For example:
$ export GLOBUS_LOCATION=/scratch/veseli/devel/lib/globus-4.0.5/$ cd $GLOBUS_LOCATION/lib$ pwd/scratch/veseli/devel/lib/globus-4.0.5/lib$ grep dependency_libs libxmlsec1_openssl_gcc32.ladependency_libs=' -L/home/condor/execute/dir_22100/userdir/install/lib'$ ~/fix_paths.sh /home/condor/execute/dir_22100/userdir/install/lib /scratch/veseli/devel/lib/globus-4.0.5/libReplacing /home/condor/execute/dir_22100/userdir/install/lib by /scratch/veseli/devel/lib/globus-4.0.5/lib in various ASCII files.…Fixed 330 files.$ grep dependency_libs libxmlsec1_openssl_gcc32.ladependency_libs=' -L/scratch/veseli/devel/lib/globus-4.0.5/lib'
Once you correct the library dependency paths using this script, you should be able to compile and link external software packages against your binary GT installation.

Comments