From 5b16199f903eae379898c8be8abf231c98b4019d Mon Sep 17 00:00:00 2001 From: Jose Gracia Date: Mon, 16 May 2011 13:25:53 +0000 Subject: [PATCH] Install script for StarSs testing Added an install script for StarSs_testing. Builds from given commit in text git repository for Laki or Hermit. Usage: GIT_COMMIT=xyz TARGET=laki|hermit ./StarSs_testing_install.sh Note: On hermit ther is no access to git repository, so need to do the first couple of steps offline and copy the tar file into the $WORK_DIR. --- StarSs_testing_install.sh | 115 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 StarSs_testing_install.sh diff --git a/StarSs_testing_install.sh b/StarSs_testing_install.sh new file mode 100755 index 0000000..e03878a --- /dev/null +++ b/StarSs_testing_install.sh @@ -0,0 +1,115 @@ +#!/bin/bash -l +set -ev # exit on any error; echo commands + +# this script requires two variables $GIT_COMMIT and $TARGET. +# The former spcifies with git commit to install, the latter +# specifies the target system, ie "laki" or "hermit". +if [ -z ${GIT_COMMIT} ]; then + echo "Need to define variable GIT_COMMIT on commandline .. exiting."; + exit 1; +fi + +if [ -z ${TARGET} ]; then + echo "Need to define variable TARGET on commandline .. exiting."; + exit 1; +fi + +if [ ${TARGET} = "laki" ]; then + echo "Building for laki." +else + if [ ${TARGET} = "hermit" ]; then + echo "Building for hermit." + else + echo "TARGET needs to be hermit or laki ... exiting." + exit 1 + fi +fi + +# ok, we are good to go +STARSS_OPT_DIR=/sw/${TARGET}/hlrs/StarSs +STARSS_VERSION=2.3_c${GIT_COMMIT}-gnu-4.5 +STARSS_DIR=${STARSS_OPT_DIR}/${STARSS_VERSION} + +WORK_DIR=${HOME}/src + +# clean up mess from previous builds +cd ${WORK_DIR}; rm -rf hlrs-text StarSs_c${GIT_COMMIT} +if [ ${TARGET} = "laki" ]; then + rm -f StarSs_c${GIT_COMMIT}.tar +fi + + +# load modules +if [ ${TARGET} = "laki" ]; then + module load compiler/gnu/4.5 + module use /opt/amtopt/autotools/modulefiles + module load local +fi + +if [ ${TARGET} = "hermit" ]; then + module swap $(module list -l 2>&1 | awk '/^PrgEnv-/{print $1}') PrgEnv-gnu +fi + +# prep git repo, needs hlrs-gitolite in .ssh/config and ssh key +cd ${WORK_DIR} + +if [ ${TARGET} = "laki" ]; then + git clone hlrs-gitolite:hlrs-text + cd hlrs-text + git checkout -b ayudame origin/ayudame + cd ProgModel/SMPSs_repository/starss + git archive --format=tar --prefix=StarSs_c${GIT_COMMIT}/ -o ${WORK_DIR}/StarSs_c${GIT_COMMIT}.tar ${GIT_COMMIT} . +fi + +# unpack, configure and build +cd ${WORK_DIR} +tar xvf StarSs_c${GIT_COMMIT}.tar +cd StarSs_c${GIT_COMMIT} + +autoreconf -fiv 2>&1 | tee autoreconf.log +./configure --prefix=$STARSS_DIR \ + --with-flavour=smp \ + --enable-comm-thread \ + --enable-ayudame +gzip autoreconf.log; gzip config.log + +make 2>&1 | tee make.log +rm -rf ${STARSS_DIR}; make install 2>&1 | tee make_install.log +gzip make.log ; gzip make_install.log + +# save logs +cp -a autoreconf.log.gz config.log.gz make.log.gz make_install.log.gz $STARSS_DIR + +# copy header files +mkdir $STARSS_DIR/include/master +cp -a master/*.h $STARSS_DIR/include/master/ + +# setup smpss-cc.conf +if +if [ ${TARGET} = "hermit" ]; then + cd $STARSS_DIR/etc + cp -a smpss-cc.conf smpss-cc.conf_orig + cat smpss-cc.conf | \ + sed "s/^compiler =.*/compiler = cc/" | \ + sed "s/^linker =.*/linker = CC/" | \ + sed "s/^linker_parameters =.*/\0 -dynamic/" | \ + sed "s/^fortran_compiler =.*/fortran_compiler = ftn/" | \ + sed "s/^fortran_libs =.*/#\0\nfortran_libs = -lm/" \ + >> smpss-cc.conf_next + mv smpss-cc.conf_next smpss-cc.conf +fi + + +# do module +cd $STARSS_OPT_DIR +chmod -R g=u $STARSS_VERSION +chmod -R o=u $STARSS_VERSION +chmod -R o-w $STARSS_VERSION + +cd modulefiles +cat 2.3_testing-gnu-4.5 | \ + sed "s/set VERSION.*/set VERSION ${STARSS_VERSION}/" | \ + sed "s/ Installed.*/ Installed `date`/" > ${STARSS_VERSION} +chmod 664 ${STARSS_VERSION} +rm 2.3_testing-gnu-4.5 +ln -s ${STARSS_VERSION} 2.3_testing-gnu-4.5 \ No newline at end of file