Commit 1942465a authored by Brian Ermold's avatar Brian Ermold
Browse files

Update to build IDL quicklook script.

parent 7cbd071b
......@@ -47,7 +47,7 @@ do
case $i in
--clean) clean=1
;;
--conf) install="install-data"
--conf) conf_only=1
;;
--destdir=*) destdir="${i#*=}"
;;
......@@ -128,7 +128,9 @@ fi
# make install
if [ $purify ]; then
if [ $conf_only ]; then
install="install-data"
elif [ $purify ]; then
export CC="purify -cache-dir=$HOME/.purecache -windows=no gcc"
install="-e $install"
echo "------------------------------------------------------------------"
......@@ -142,4 +144,107 @@ else
run "make $install"
fi
exit
# If only building conf files, exit before IDL compilation
if [ $conf_only ]; then
exit 0
fi
cd ..
# BUILD IDL *sav files
proctype='vap'
process='langley'
execname="${process}_batch"
idl_dir=/apps/base/idl/idl86
if [ -z "$ADI_HOME" ]; then
ADI_HOME=/apps/ds
fi
if [ -z "$APPS_DS" ]; then
APPS_DS=/apps/ds
fi
# Get IDL version number from IDL installation directory
idl_version=$(echo $idl_dir | grep -Eo '[0-9]+$')
idlnn=idl$idl_version
IDLnn=IDL$idl_version
# Install IDL .sav file
echo "------------------------------------------------------------------"
bindir="$destdir$prefix/bin"
objdir="$destdir$prefix/bytecode"
sav_file="${execname}.sav"
echo "bindir: $bindir"
echo "objdir: $objdir"
if [ ! -d $bindir ]; then
run "mkdir -p $bindir"
fi
if [ ! -d $objdir ]; then
run "mkdir -p $objdir"
fi
# Set IDL_DLM_PATH for ADI bindings
ADI_DLM="${ADI_HOME}/lib64"
if [ "$idlnn" != "idl82" ]; then
ADI_DLM="${ADI_DLM}/${idlnn}"
fi
export IDL_DLM_PATH="${ADI_DLM}:<IDL_DEFAULT>"
# Set IDL environment
export IDL_DIR=$idl_dir
export IDL_PATH="+${IDL_DIR}/lib"
export IDL_PATH="+${APPS_DS}/lib:${IDL_PATH}"
export IDL_PATH="+${ADI_DLM}:${IDL_PATH}"
echo "IDL_DIR: $IDL_DIR"
echo "IDL_PATH: $IDL_PATH"
echo "IDL_DLM_PATH: $IDL_DLM_PATH"
# Build resolve statements
cd src
resolve=("resolve_routine, '${execname}'")
resolve+=("resolve_all")
# Build the build command
join_by()
{
local d=$1; shift
echo -n "$1"; shift;
printf "%s" "${@/#/$d}"
}
idl_buffer="buffer=['BUF_PNNL_RTD_LIC_99781','${IDL_DIR}/../license/license-BUF_PNNL_RTD_LIC_99781.bin']"
if (( $idl_version < 86 )); then
idl_buffer="/embedded"
fi
resolve=$(join_by ' & ' "${resolve[@]}")
save="save, file='$objdir/$sav_file', $idl_buffer, /routines, variables=0"
# Build the .sav file
run "rm -f $objdir/$sav_file"
echo "$resolve & $save & exit" | ${IDL_DIR}/bin/idl
if [ -e "$objdir/$sav_file" ]; then
echo "Installed $objdir/$sav_file"
else
echo "Could not create sav file: $sav_file"
exit 1
fi
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment