DAMASK_EICMD/installation/mods_MarcMentat2010/apply_DAMASK_modifications

108 lines
3.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
DEFAULT_INSTALLDIR='/msc'
2011-11-14 20:29:16 +05:30
DEFAULT_ACMLDIR='/opt/acml4.0.0'
DEFAULT_VERSION='2010.2'
WORKINGDIR=`dirname $0`
while [ ! -d "$WORKINGDIR/$VERSION" ] || [ -z "$VERSION" ]
do
echo "Input version of MARC/MENTAT installation: [${DEFAULT_VERSION}]"
read VERSION
if [ -z "$VERSION" ]; then
VERSION=${DEFAULT_VERSION}
fi
done
echo "MSC version: $VERSION"
INSTALLDIR=''
2011-11-14 20:29:16 +05:30
if [ -f $WORKINGDIR/../../lib/pathinfo ]; then
INSTALLDIR=`grep msc $WORKINGDIR/../../lib/pathinfo | head -n1 | awk 'BEGIN { FS = "[ \t]+" } ; { print $2 }'`
fi
while [ ! -d "$INSTALLDIR" ] || [ -z "$INSTALLDIR" ]
do
echo "Input path of MARC/MENTAT installation: [${DEFAULT_INSTALLDIR}]"
read INSTALLDIR
if [ -z $INSTALLDIR ]; then
INSTALLDIR=${DEFAULT_INSTALLDIR}
fi
done
INSTALLDIR=${INSTALLDIR%/} # remove trailing slash
echo "MSC installation path: $INSTALLDIR"
2011-11-14 20:29:16 +05:30
ACMLDIR=''
if [ -f $WORKINGDIR/../../lib/pathinfo ]; then
INSTALLDIR=`grep acml $WORKINGDIR/../../lib/pathinfo | head -n1 | awk 'BEGIN { FS = "[ \t]+" } ; { print $2 }'`
fi
while [ ! -d "$ACMLDIR" ] || [ -z "$ACMLDIR" ]
do
echo "Input path of ACML installation: [${DEFAULT_ACMLDIR}]"
read ACMLDIR
if [ -z $ACMLDIR ]; then
ACMLDIR=${DEFAULT_ACMLDIR}
fi
done
ACMLDIR=${ACMLDIR%/} # remove trailing slash
echo "ACML installation path: $ACMLDIR"
# tools
echo ''
echo 'copying Marc tools...'
theDIR=$INSTALLDIR/marc$VERSION/tools
for filename in 'comp_user' \
'comp_user_h' \
'comp_user_mp' \
'run_marc' \
'run_h_marc' \
'run_mp_marc' \
2010-11-24 13:25:08 +05:30
'include_linux64'; do
cp $WORKINGDIR/$VERSION/Marc_tools/$filename $theDIR
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
2011-11-14 20:29:16 +05:30
echo $theDIR/$filename | xargs perl -pi -e "s:%ACMLDIR%:${ACMLDIR}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
echo $filename
done
# Mentat scripts
echo ''
echo 'copying Mentat scripts...'
theDIR=$INSTALLDIR/mentat$VERSION/bin
for filename in 'edit_window' \
'submit1' \
'submit2' \
'submit3'; do
cp $WORKINGDIR/$VERSION/Mentat_bin/$filename $theDIR
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
2011-11-14 20:29:16 +05:30
echo $theDIR/$filename | xargs perl -pi -e "s:%ACMLDIR%:${ACMLDIR}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
echo $filename
done
# Mentat scripts
echo ''
echo 'copying Mentat menus...'
theDIR=$INSTALLDIR/mentat$VERSION/menus
for filename in 'job_run.ms'; do
cp $WORKINGDIR/$VERSION/Mentat_menus/$filename $theDIR
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
echo $filename
done
# compile menus
echo ''
echo 'compiling menus...'
$INSTALLDIR/mentat$VERSION/bin/mentat -compile $INSTALLDIR/mentat$VERSION/menus/linux64/main.msb
# setting access rights
echo ''
echo 'setting file access rights...'
chmod 555 $INSTALLDIR/marc$VERSION/tools/run_*_marc
chmod 555 $INSTALLDIR/marc$VERSION/tools/comp_user?*
echo ''
echo 'done.'