Skip to content

Commit

Permalink
Merge pull request #14 from JeffersonLab/complete_system_build_MMI
Browse files Browse the repository at this point in the history
Complete system build mmi
  • Loading branch information
markito3 authored Jan 8, 2019
2 parents d388a1e + e76ea16 commit d9317bf
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
*.tmp
14 changes: 14 additions & 0 deletions create_setup_scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

function create_script {
gt=`echo $gluex_top | sed -e 's./.\\\\/.g'`
sed -e "s/<gluex-top>/${gt}/" < $gi_path/$name.template > $1
}

gi_path=$1
gluex_top=$2
for name in gluex_env_boot.sh gluex_env_boot.csh gluex_env_local.sh gluex_env_local.csh; do
echo creating script $name
create_script $name
done

6 changes: 6 additions & 0 deletions gluex_env_boot.csh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
setenv BUILD_SCRIPTS <gluex-top>/build_scripts
set build_scripts_this=$BUILD_SCRIPTS
alias gxenv "source $build_scripts_this/gluex_env_clean.csh; setenv BUILD_SCRIPTS $build_scripts_this; source <gluex-top>/gluex_env_local.csh \!*"
alias gxclean "source $build_scripts_this/gluex_env_clean.csh"
echo $PATH | grep $build_scripts_this > /dev/null
if ($status) setenv PATH ${build_scripts_this}:$PATH
10 changes: 10 additions & 0 deletions gluex_env_boot.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export BUILD_SCRIPTS=<gluex-top>/build_scripts
build_scripts_this=$BUILD_SCRIPTS
function gxenv() { source $build_scripts_this/gluex_env_clean.sh; \
export BUILD_SCRIPTS=$build_scripts_this; \
source <gluex-top>/gluex_env_local.sh $1; \
}
function gxclean() { source $build_scripts_this/gluex_env_clean.sh; }
if [ `echo $PATH | grep -c $build_scripts_this` -eq 0 ]
then export PATH=$build_scripts_this:$PATH
fi
7 changes: 7 additions & 0 deletions gluex_env_local.csh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
setenv GLUEX_TOP <gluex-top>
if (! $?BUILD_SCRIPTS) setenv BUILD_SCRIPTS $GLUEX_TOP/build_scripts
setenv HALLD_VERSIONS $GLUEX_TOP/halld_versions
source $BUILD_SCRIPTS/gluex_env_version.csh $HALLD_VERSIONS/version_jlab.xml
setenv CCDB_CONNECTION mysql://ccdb_user@hallddb.jlab.org/ccdb
setenv JANA_CALIB_URL $CCDB_CONNECTION
setenv JANA_RESOURCE_DIR $GLUEX_TOP/resources
9 changes: 9 additions & 0 deletions gluex_env_local.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export GLUEX_TOP=<gluex-top>
if [ -z "$BUILD_SCRIPTS" ]
then export BUILD_SCRIPTS=$GLUEX_TOP/build_scripts
fi
export HALLD_VERSIONS=$GLUEX_TOP/halld_versions
source $BUILD_SCRIPTS/gluex_env_version.sh $HALLD_VERSIONS/version_jlab.xml
export CCDB_CONNECTION=mysql://ccdb_user@hallddb.jlab.org/ccdb
export JANA_CALIB_URL=$CCDB_CONNECTION
export JANA_RESOURCE_DIR=$GLUEX_TOP/resources
40 changes: 24 additions & 16 deletions gluex_install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#!/bin/bash
# GI_PATH is the fully qualified directory that contains this script
gi_script="${BASH_SOURCE[0]}";
if([ -h "${gi_script}" ]) then
while([ -h "${gi_script}" ]) do gi_script=`readlink "${gi_script}"`; done
fi
pushd . > /dev/null
cd `dirname ${gi_script}` > /dev/null
GI_PATH=`pwd`
popd > /dev/null
#
mkdir -p gluex_top
pushd gluex_top
pwd_string=`pwd`
mkdir -p resources
if [ -e build_scripts ]
then
echo build_scripts already here, skip installation
Expand All @@ -12,26 +23,23 @@ else
git checkout latest
popd
fi
export GLUEX_TOP=$pwd_string
export BUILD_SCRIPTS=$GLUEX_TOP/build_scripts
rm -fv setup.sh
echo export GLUEX_TOP=$pwd_string > setup.sh
echo export BUILD_SCRIPTS=\$GLUEX_TOP/build_scripts >> setup.sh
echo source \$BUILD_SCRIPTS/gluex_env_version.sh $pwd_string/version_jlab.xml >> setup.sh
rm -fv setup.csh
echo setenv GLUEX_TOP $pwd_string > setup.csh
echo setenv BUILD_SCRIPTS \$GLUEX_TOP/build_scripts >> setup.csh
echo source \$BUILD_SCRIPTS/gluex_env_version.csh $pwd_string/version_jlab.xml >> setup.csh
if [ -f version_jlab.xml ]
if [ -e halld_versions ]
then
echo version_jlab.xml exists, skip download
echo halld_versions already here, skip installation
else
echo getting version_jlab.xml from halldweb.jlab.org
wget --no-check-certificate https://halldweb.jlab.org/dist/version_jlab.xml
echo cloning halld_versions repository
git clone https://github.com/jeffersonlab/halld_versions
fi
source setup.sh
$GI_PATH/create_setup_scripts.sh $GI_PATH $pwd_string
source gluex_env_local.sh
make -f $BUILD_SCRIPTS/Makefile_all gluex_pass1
if [ $? -ne 0 ]
then
echo pass 1 failed, exiting
popd
exit 1
fi
source $BUILD_SCRIPTS/gluex_env_clean.sh
source setup.sh
source gluex_env_local.sh
make -f $BUILD_SCRIPTS/Makefile_all gluex_pass2
popd

0 comments on commit d9317bf

Please sign in to comment.