From 5bd730a74df792f5097df9c441fab424f56e722b Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Fri, 29 Nov 2019 12:01:25 +0100 Subject: [PATCH 1/8] ADD: build_claw.sh script --- package_builder/build_claw.sh | 228 ++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100755 package_builder/build_claw.sh diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh new file mode 100755 index 0000000..c074a34 --- /dev/null +++ b/package_builder/build_claw.sh @@ -0,0 +1,228 @@ +#!/usr/bin/env bash + +slave=arolla + +exitError() +{ + echo "ERROR $1: $3" 1>&2 + echo "ERROR LOCATION=$0" 1>&2 + echo "ERROR LINE=$2" 1>&2 + exit $1 +} + +TEMP=$@ +eval set -- "$TEMP --" +fwd_args="" +compiler_target="all" +while true; do + case "$1" in + --dir|-d) package_basedir=$2; shift 2;; + --idir|-i) install_dir=$2; shift 2;; + --local) install_local="yes"; shift;; + --compiler|-c) compiler_target=$2; shift 2;; + -- ) shift; break ;; + * ) fwd_args="$fwd_args $1"; shift ;; + esac +done + +if [[ -z ${package_basedir} ]]; then + exitError 3221 ${LINENO} "package basedir has to be specified" +fi +if [[ -z ${install_dir} ]]; then + exitError 3225 ${LINENO} "package install dir has to be specified" +fi + +# Setup +echo $@ +base_path=$PWD + +if [[ ${install_local} == "yes" ]]; then + install_path_prefix_="${base_path}/install" +else + install_path_prefix_="${install_dir}/claw" +fi + +set_apache_ant_env() +{ + # Check the ${slave} machine, add modules and export variables accordingly + if [[ "${slave}" == "arolla" ]]; then + module load cmake + export YACC="bison -y" + export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64" + elif [[ "${slave}" == "kesch" ]]; then + export YACC="bison -y" + module load PE/18.12 + module load cmake + module load java + elif [[ "${slave}" == "daint" ]]; then + export JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk + elif [[ "${slave}" == "tave" ]]; then + module load java + fi +} + +set_claw_env() +{ + if [[ "${compiler}" == "gnu" ]]; then + module rm PrgEnv-pgi && module rm PrgEnv-cray + module load PrgEnv-gnu + if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "tave" ]] || [[ "${slave}" == "arolla" ]]; then + export FC=gfortran + export CC=gcc + export CXX=g++ + elif [[ "${slave}" == "daint" ]]; then + module load cudatoolkit + # On Daint the cray wrapper must be used regardless the compiling env. + export FC=ftn + export CC=cc + export CXX=CC + fi + elif [[ "${compiler}" == "pgi" ]]; then + module rm PrgEnv-gnu && module rm PrgEnv-cray + if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]]; then + if [[ "${slave}" == "kesch" ]]; then + module load PrgEnv-pgi + else + module load PrgEnv-pgi/19.4 + fi + module load gcc + export FC=pgfortran + export CC=gcc + export CXX=g++ + elif [[ "${slave}" == "daint" ]]; then + module load PrgEnv-pgi + module load pgi-icon/19.9 + module load cudatoolkit + module load gcc/7.1.0 + # On Daint the cray wrapper must be used regardless the compiling env. + # Use GNU gcc for the C/C++ part as PGI is broken. + export FC=ftn + export CC=gcc + export CXX=g++ + elif [[ "${slave}" == "tave" ]]; then + module load PrgEnv-pgi + export FC=ftn + export CC=gcc + export CXX=g++ + fi + elif [[ "${compiler}" == "cray" ]]; then + module load PrgEnv-cray + if [[ "${slave}" == "kesch" ]]; then + module load gcc + export CC=cc + export CXX=CC + elif [[ "${slave}" == "arolla" ]]; then + module load cce/8.7.7 + module load gcc/7.2.0 + export CC=gcc + export CXX=g++ + elif [[ "${slave}" == "daint" ]]; then + module load daint-gpu + export CRAYPE_LINK_TYPE=dynamic + export CC=cc + export CXX=CC + elif [[ "${slave}" == "tave" ]]; then + module load gcc + export CC=gcc + export CXX=g++ + fi + export FC=ftn + elif [[ "${compiler}" == "intel" ]]; then + # Only for Piz Daint and Grande Tave + module rm PrgEnv-gnu + module rm PrgEnv-cray + module rm PrgEnv-pgi + module load PrgEnv-intel + module load gcc + export FC=ftn + export CC=gcc + export CXX=g++ + fi + # Workaround to avoid buggy Perl installation + if [[ "${slave}" == "tave" ]]; then + module rm Perl + fi +} + +build_compiler_target() +{ +set_apache_ant_env + + +# Build claw-compiler dependency apache-ant +echo "==============================" +echo "Build claw-compiler dependency: apache-ant" +if [ ! -d ${package_basedir}/hpc-scripts ] ; then + git clone git@github.com:clementval/hpc-scripts.git ${package_basedir}/hpc-scripts +fi +cd ${package_basedir}/hpc-scripts/cscs +if [[ ! -f ../../ant/apache-ant-1.10.2/bin/ant || $REBUILD == YES ]] ; then + if [ $REBUILD == YES ] ; then + echo `pwd` + echo "Rebuilding apache-ant" + echo "rm -r ../../ant" + rm -r ../../ant + fi + ./install.ant -i ../../ant || error_exit "Error : apach-ant build failed" +fi +cd ../../ant/apache-ant-1.10.2 +export ANT_HOME=`pwd` + +cd $base_path + +set_claw_env + +# Build claw-compiler +echo "==============================" +echo "Build claw-compiler" +if [ ! -d ${package_basedir}/claw-compiler ] ; then + git clone git@github.com:claw-project/claw-compiler.git ${package_basedir}/claw-compiler +fi + +cd ${package_basedir}/claw-compiler + +export claw_compiler_install=$install_path_prefix_ + +if [[ ! -f $claw_compiler_install/bin/clawfc || $REBUILD == YES ]]; then + if [ $REBUILD == YES ] ; then + echo `pwd` + echo "Rebuilding claw-compiler" + echo "rm -r build" + rm -r build + fi + + export PATH=$ANT_HOME/bin:$PATH + + # Get OMNI Compiler as submodule + git submodule init + git submodule update + + if [ ! -d build ] ; then + mkdir build + fi + cd build + + if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]]; then + cmake -DCMAKE_INSTALL_PREFIX="$base_path/$claw_compiler_install" .. + elif [[ "${slave}" == "daint" ]] || [[ "${slave}" == "tave" ]]; then + cmake -DCMAKE_INSTALL_PREFIX="$base_path/$claw_compiler_install" -DOMNI_MPI_CC="MPI_CC=cc" -DOMNI_MPI_FC="MPI_FC=ftn" .. + fi + + # Compile and run unit tests + # make all transformation test && make install + make + make install +fi +} + +# Build +if [ "${compiler_target}" != "all" ]; then + if [ "${install_local}" != "yes" ] ; then + install_path_prefix_="${install_path_prefix_}/${compiler_target}" + fi + build_compiler_target "${compiler_target}" "${install_path_prefix_}" +else + for c_ in ${compilers[@]}; do + build_compiler_target "${c_}" "${install_path_prefix_}/$c_/" + done +fi From 7e5f6aae32a29393d2e67e7fc55351a5291e094b Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Fri, 29 Nov 2019 12:08:40 +0100 Subject: [PATCH 2/8] FIX: salve variable --- package_builder/build_claw.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh index c074a34..58f44fe 100755 --- a/package_builder/build_claw.sh +++ b/package_builder/build_claw.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -slave=arolla - exitError() { echo "ERROR $1: $3" 1>&2 From 37e3fc990f39b291a782d2a4aa27b501a553608e Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Fri, 29 Nov 2019 14:49:38 +0100 Subject: [PATCH 3/8] ADD: enable the use of build_apkg.sh script for claw --- package_builder/build_claw.sh | 141 ++++++++-------------------------- 1 file changed, 34 insertions(+), 107 deletions(-) diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh index 58f44fe..17fe1cf 100755 --- a/package_builder/build_claw.sh +++ b/package_builder/build_claw.sh @@ -40,112 +40,28 @@ else install_path_prefix_="${install_dir}/claw" fi -set_apache_ant_env() +build_compiler_target() { - # Check the ${slave} machine, add modules and export variables accordingly - if [[ "${slave}" == "arolla" ]]; then - module load cmake - export YACC="bison -y" - export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64" - elif [[ "${slave}" == "kesch" ]]; then - export YACC="bison -y" - module load PE/18.12 - module load cmake - module load java - elif [[ "${slave}" == "daint" ]]; then - export JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk - elif [[ "${slave}" == "tave" ]]; then - module load java - fi -} -set_claw_env() -{ - if [[ "${compiler}" == "gnu" ]]; then - module rm PrgEnv-pgi && module rm PrgEnv-cray - module load PrgEnv-gnu - if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "tave" ]] || [[ "${slave}" == "arolla" ]]; then - export FC=gfortran - export CC=gcc - export CXX=g++ - elif [[ "${slave}" == "daint" ]]; then - module load cudatoolkit - # On Daint the cray wrapper must be used regardless the compiling env. - export FC=ftn - export CC=cc - export CXX=CC - fi - elif [[ "${compiler}" == "pgi" ]]; then - module rm PrgEnv-gnu && module rm PrgEnv-cray - if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]]; then - if [[ "${slave}" == "kesch" ]]; then - module load PrgEnv-pgi - else - module load PrgEnv-pgi/19.4 - fi - module load gcc - export FC=pgfortran - export CC=gcc - export CXX=g++ - elif [[ "${slave}" == "daint" ]]; then - module load PrgEnv-pgi - module load pgi-icon/19.9 - module load cudatoolkit - module load gcc/7.1.0 - # On Daint the cray wrapper must be used regardless the compiling env. - # Use GNU gcc for the C/C++ part as PGI is broken. - export FC=ftn - export CC=gcc - export CXX=g++ - elif [[ "${slave}" == "tave" ]]; then - module load PrgEnv-pgi - export FC=ftn - export CC=gcc - export CXX=g++ - fi - elif [[ "${compiler}" == "cray" ]]; then - module load PrgEnv-cray - if [[ "${slave}" == "kesch" ]]; then - module load gcc - export CC=cc - export CXX=CC - elif [[ "${slave}" == "arolla" ]]; then - module load cce/8.7.7 - module load gcc/7.2.0 - export CC=gcc - export CXX=g++ - elif [[ "${slave}" == "daint" ]]; then - module load daint-gpu - export CRAYPE_LINK_TYPE=dynamic - export CC=cc - export CXX=CC - elif [[ "${slave}" == "tave" ]]; then - module load gcc - export CC=gcc - export CXX=g++ - fi - export FC=ftn - elif [[ "${compiler}" == "intel" ]]; then - # Only for Piz Daint and Grande Tave - module rm PrgEnv-gnu - module rm PrgEnv-cray - module rm PrgEnv-pgi - module load PrgEnv-intel - module load gcc - export FC=ftn - export CC=gcc - export CXX=g++ - fi - # Workaround to avoid buggy Perl installation - if [[ "${slave}" == "tave" ]]; then - module rm Perl - fi -} +if [[ "${slave}" == "kesch" || "${slave}" == "arolla" ]]; then + export YACC="bison -y" +fi -build_compiler_target() -{ -set_apache_ant_env +export compiler=$1 +local install_path=$2 +echo "Compiling and installing for $compiler (install path: $install_path)" +install_args="-i ${install_path}/" + +setFortranEnvironment + +if [ $? -ne 0 ]; then + exitError 3331 ${LINENO} "Invalid fortran environment" +fi + +writeModuleList ${base_path}/modules.log loaded "FORTRAN MODULES" ${base_path}/modules_fortran.env + +echo "Building for ${compiler} compiler" # Build claw-compiler dependency apache-ant echo "==============================" @@ -168,8 +84,6 @@ export ANT_HOME=`pwd` cd $base_path -set_claw_env - # Build claw-compiler echo "==============================" echo "Build claw-compiler" @@ -199,18 +113,31 @@ if [[ ! -f $claw_compiler_install/bin/clawfc || $REBUILD == YES ]]; then mkdir build fi cd build - + if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]]; then - cmake -DCMAKE_INSTALL_PREFIX="$base_path/$claw_compiler_install" .. + cmake -DCMAKE_INSTALL_PREFIX="$claw_compiler_install" .. elif [[ "${slave}" == "daint" ]] || [[ "${slave}" == "tave" ]]; then - cmake -DCMAKE_INSTALL_PREFIX="$base_path/$claw_compiler_install" -DOMNI_MPI_CC="MPI_CC=cc" -DOMNI_MPI_FC="MPI_FC=ftn" .. + cmake -DCMAKE_INSTALL_PREFIX="$claw_compiler_install" -DOMNI_MPI_CC="MPI_CC=cc" -DOMNI_MPI_FC="MPI_FC=ftn" .. fi # Compile and run unit tests # make all transformation test && make install make make install + + #remove build directories + cd $base_path + rm -rf ant/ claw-compiler/ hpc-scripts/ +fi + +if [ $? -ne 0 ]; then + exitError 3333 "Unable to compile claw with ${compiler}" fi + +# Copy module files +cp modules_fortran.env ${install_path}/modules.env +unsetFortranEnvironment + } # Build From fe267265974f06ee36df499ef4beb0cfb409635a Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Mon, 2 Dec 2019 12:20:57 +0100 Subject: [PATCH 4/8] FIX: compilation errors --- env.arolla.sh | 3 +++ env.kesch-test.sh | 1 - env.kesch.sh | 6 ++++++ package_builder/build_claw.sh | 24 +++++++++++++++--------- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/env.arolla.sh b/env.arolla.sh index 2277993..cab065f 100644 --- a/env.arolla.sh +++ b/env.arolla.sh @@ -61,6 +61,9 @@ setupDefaults() export BOOST_PATH=${BOOST_ROOT} export BOOST_INCLUDE=${BOOST_ROOT}/include/ + export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64 + export YACC="bison -y" + # default options if [ -z "${target}" ] ; then target="gpu" diff --git a/env.kesch-test.sh b/env.kesch-test.sh index b24cee2..d1e3aee 100644 --- a/env.kesch-test.sh +++ b/env.kesch-test.sh @@ -62,7 +62,6 @@ setupDefaults() export BOOST_PATH=${BOOST_ROOT} export BOOST_INCLUDE=${BOOST_ROOT}/include/ - # default options if [ -z "${target}" ] ; then target="gpu" diff --git a/env.kesch.sh b/env.kesch.sh index c6f65eb..396ec8c 100644 --- a/env.kesch.sh +++ b/env.kesch.sh @@ -62,6 +62,7 @@ setupDefaults() export BOOST_PATH=${BOOST_ROOT} export BOOST_INCLUDE=${BOOST_ROOT}/include/ + export YACC="bison -y" # default options if [ -z "${target}" ] ; then @@ -139,6 +140,7 @@ module load gcc/5.4.0-2.26 module load cmake module load hdf5/1.8.18-gmvolf-17.02 module load git +module load java EOF module purge @@ -227,6 +229,7 @@ module load craype-haswell module load CrayCCE/.17.06 module load netCDF-Fortran/4.4.4-CrayCCE-17.06 module load cmake +module load java export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF else @@ -239,6 +242,7 @@ module swap cudatoolkit/8.0.61 module load PrgEnv-CrayCCE/17.06 module load netCDF-Fortran/4.4.4-CrayCCE-17.06 module load cmake +module load java export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF fi @@ -255,6 +259,7 @@ module load craype-network-infiniband module load PrgEnv-gnu/17.02 module load netcdf-fortran/4.4.4-gmvolf-17.02 module load cmake +module load java export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF module purge @@ -270,6 +275,7 @@ module load craype-network-infiniband module load PrgEnv-pgi/18.5 module load netcdf-fortran/4.4.4-pgi-18.5-gcc-5.4.0-2.26 module load cmake +module load java export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF module purge diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh index 17fe1cf..f27e9d5 100755 --- a/package_builder/build_claw.sh +++ b/package_builder/build_claw.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# set default variables + +test -n "${REBUILD}" || REBUILD=YES +test -n "${slave}" || exitError "Error : slave must be defined" + exitError() { echo "ERROR $1: $3" 1>&2 @@ -33,6 +38,7 @@ fi # Setup echo $@ base_path=$PWD +setupDefaults if [[ ${install_local} == "yes" ]]; then install_path_prefix_="${base_path}/install" @@ -43,16 +49,16 @@ fi build_compiler_target() { -if [[ "${slave}" == "kesch" || "${slave}" == "arolla" ]]; then - export YACC="bison -y" -fi - export compiler=$1 local install_path=$2 echo "Compiling and installing for $compiler (install path: $install_path)" install_args="-i ${install_path}/" +if [ ! -d ${install_path} ] ; then + mkdir -p ${install_path} +fi + setFortranEnvironment if [ $? -ne 0 ]; then @@ -74,8 +80,8 @@ if [[ ! -f ../../ant/apache-ant-1.10.2/bin/ant || $REBUILD == YES ]] ; then if [ $REBUILD == YES ] ; then echo `pwd` echo "Rebuilding apache-ant" - echo "rm -r ../../ant" - rm -r ../../ant + echo "rm -rf ../../ant" + rm -rf ../../ant fi ./install.ant -i ../../ant || error_exit "Error : apach-ant build failed" fi @@ -99,8 +105,8 @@ if [[ ! -f $claw_compiler_install/bin/clawfc || $REBUILD == YES ]]; then if [ $REBUILD == YES ] ; then echo `pwd` echo "Rebuilding claw-compiler" - echo "rm -r build" - rm -r build + echo "rm -rf build" + rm -rf build fi export PATH=$ANT_HOME/bin:$PATH @@ -114,7 +120,7 @@ if [[ ! -f $claw_compiler_install/bin/clawfc || $REBUILD == YES ]]; then fi cd build - if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]]; then + if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]] ; then cmake -DCMAKE_INSTALL_PREFIX="$claw_compiler_install" .. elif [[ "${slave}" == "daint" ]] || [[ "${slave}" == "tave" ]]; then cmake -DCMAKE_INSTALL_PREFIX="$claw_compiler_install" -DOMNI_MPI_CC="MPI_CC=cc" -DOMNI_MPI_FC="MPI_FC=ftn" .. From ff1a4a4b71921ff1770e72c2c4fb26ba19e107fb Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Mon, 2 Dec 2019 13:44:41 +0100 Subject: [PATCH 5/8] ADD: possibility to use tsa as slave --- env.arolla.sh | 5 +++-- package_builder/build_claw.sh | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/env.arolla.sh b/env.arolla.sh index cab065f..643d93d 100644 --- a/env.arolla.sh +++ b/env.arolla.sh @@ -60,8 +60,7 @@ setupDefaults() export BOOST_ROOT=/project/c14/install/kesch/boost/boost_1_67_0/ export BOOST_PATH=${BOOST_ROOT} export BOOST_INCLUDE=${BOOST_ROOT}/include/ - - export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64 + export YACC="bison -y" # default options @@ -145,6 +144,7 @@ setCppEnvironment() module load cuda92/toolkit/9.2.88 craype-accel-nvidia70 module load boost/1.70.0-gmvolf-18.12-python2 module load /users/jenkins/easybuild/arolla-ln/modules/all/cmake/3.14.5 + export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64" EOF else #Use this modules in case COSMO_TESTENV is set @@ -161,6 +161,7 @@ else module load PrgEnv-gnu/18.1 module load cuda10.0/toolkit/10.0.130 module load cmake/3.14.5 + export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64" EOF fi diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh index f27e9d5..d5b321e 100755 --- a/package_builder/build_claw.sh +++ b/package_builder/build_claw.sh @@ -5,6 +5,12 @@ test -n "${REBUILD}" || REBUILD=YES test -n "${slave}" || exitError "Error : slave must be defined" +# hack for tsa +if [ "$slave" == "tsa" ] ; then + export COSMO_TESTENV=ON + slave=arolla +fi + exitError() { echo "ERROR $1: $3" 1>&2 From c18b1ba8becd7252816da1e4f4b4ad35435419ca Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Wed, 4 Dec 2019 10:26:06 +0100 Subject: [PATCH 6/8] FIX: problem between relative and absolute paths --- package_builder/build_claw.sh | 72 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh index d5b321e..d15ceb7 100755 --- a/package_builder/build_claw.sh +++ b/package_builder/build_claw.sh @@ -61,8 +61,8 @@ echo "Compiling and installing for $compiler (install path: $install_path)" install_args="-i ${install_path}/" -if [ ! -d ${install_path} ] ; then - mkdir -p ${install_path} +if [ ! -d ${install_dir} ] ; then + mkdir -p ${install_dir} fi setFortranEnvironment @@ -75,46 +75,43 @@ writeModuleList ${base_path}/modules.log loaded "FORTRAN MODULES" ${base_path}/m echo "Building for ${compiler} compiler" -# Build claw-compiler dependency apache-ant -echo "==============================" -echo "Build claw-compiler dependency: apache-ant" -if [ ! -d ${package_basedir}/hpc-scripts ] ; then - git clone git@github.com:clementval/hpc-scripts.git ${package_basedir}/hpc-scripts -fi -cd ${package_basedir}/hpc-scripts/cscs -if [[ ! -f ../../ant/apache-ant-1.10.2/bin/ant || $REBUILD == YES ]] ; then +cd $base_path + +export claw_compiler_install=$base_path/$install_path_prefix_ + +if [[ ! -f $claw_compiler_install/libexec/claw_f_lib.sh || $REBUILD == YES ]]; then + if [ $REBUILD == YES ] ; then echo `pwd` - echo "Rebuilding apache-ant" - echo "rm -rf ../../ant" - rm -rf ../../ant + echo "Rebuilding claw-compiler" + echo "rm -rf $claw_compiler_install" + rm -rf $claw_compiler_install + fi + + # Build claw-compiler dependency apache-ant + echo "==============================" + echo "Build claw-compiler dependency: apache-ant" + if [ ! -d ${package_basedir}/hpc-scripts ] ; then + git clone git@github.com:clementval/hpc-scripts.git ${package_basedir}/hpc-scripts fi - ./install.ant -i ../../ant || error_exit "Error : apach-ant build failed" -fi -cd ../../ant/apache-ant-1.10.2 -export ANT_HOME=`pwd` -cd $base_path + cd ${package_basedir}/hpc-scripts/cscs + ./install.ant -i ../../ant || error_exit "Error : apach-ant build failed" + + cd ../../ant/apache-ant-1.10.2 + export ANT_HOME=`pwd` -# Build claw-compiler -echo "==============================" -echo "Build claw-compiler" -if [ ! -d ${package_basedir}/claw-compiler ] ; then - git clone git@github.com:claw-project/claw-compiler.git ${package_basedir}/claw-compiler -fi + cd $base_path -cd ${package_basedir}/claw-compiler + # Build claw-compiler + echo "==============================" + echo "Build claw-compiler" + if [ ! -d ${package_basedir}/claw-compiler ] ; then + git clone git@github.com:claw-project/claw-compiler.git ${package_basedir}/claw-compiler + fi -export claw_compiler_install=$install_path_prefix_ + cd ${package_basedir}/claw-compiler -if [[ ! -f $claw_compiler_install/bin/clawfc || $REBUILD == YES ]]; then - if [ $REBUILD == YES ] ; then - echo `pwd` - echo "Rebuilding claw-compiler" - echo "rm -rf build" - rm -rf build - fi - export PATH=$ANT_HOME/bin:$PATH # Get OMNI Compiler as submodule @@ -139,15 +136,20 @@ if [[ ! -f $claw_compiler_install/bin/clawfc || $REBUILD == YES ]]; then #remove build directories cd $base_path + cd $package_basedir rm -rf ant/ claw-compiler/ hpc-scripts/ +else + echo "claw-compiler already installed under $claw_compiler_install" fi if [ $? -ne 0 ]; then exitError 3333 "Unable to compile claw with ${compiler}" fi +cd $base_path + # Copy module files -cp modules_fortran.env ${install_path}/modules.env +cp modules_fortran.env $base_path/${install_path}/modules.env unsetFortranEnvironment } From dcc26a23e6f970885886764bfd96efed063193b0 Mon Sep 17 00:00:00 2001 From: Elsa Germann Date: Wed, 4 Dec 2019 13:41:55 +0100 Subject: [PATCH 7/8] ADD: possibility to use relative and absolute paths --- package_builder/build_claw.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package_builder/build_claw.sh b/package_builder/build_claw.sh index d15ceb7..9ac7eef 100755 --- a/package_builder/build_claw.sh +++ b/package_builder/build_claw.sh @@ -47,7 +47,7 @@ base_path=$PWD setupDefaults if [[ ${install_local} == "yes" ]]; then - install_path_prefix_="${base_path}/install" + install_path_prefix_="${base_path}/claw" else install_path_prefix_="${install_dir}/claw" fi @@ -77,7 +77,11 @@ echo "Building for ${compiler} compiler" cd $base_path -export claw_compiler_install=$base_path/$install_path_prefix_ +if [ "${install_path_prefix_:0:1}" != "/" ]; then + install_path_prefix_=$base_path/$install_path_prefix_ +fi + +export claw_compiler_install=$install_path_prefix_ if [[ ! -f $claw_compiler_install/libexec/claw_f_lib.sh || $REBUILD == YES ]]; then @@ -122,7 +126,7 @@ if [[ ! -f $claw_compiler_install/libexec/claw_f_lib.sh || $REBUILD == YES ]]; t mkdir build fi cd build - + if [[ "${slave}" == "kesch" ]] || [[ "${slave}" == "arolla" ]] ; then cmake -DCMAKE_INSTALL_PREFIX="$claw_compiler_install" .. elif [[ "${slave}" == "daint" ]] || [[ "${slave}" == "tave" ]]; then @@ -149,7 +153,7 @@ fi cd $base_path # Copy module files -cp modules_fortran.env $base_path/${install_path}/modules.env +cp modules_fortran.env ${install_path}/modules.env unsetFortranEnvironment } From 5f0b446f1e86e9f76a8ba5529bd22aa55278b17d Mon Sep 17 00:00:00 2001 From: Xavier Lapillonne Date: Wed, 4 Dec 2019 22:43:31 +0100 Subject: [PATCH 8/8] change cmake version on kesch --- env.kesch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/env.kesch.sh b/env.kesch.sh index c6f65eb..8640b8b 100644 --- a/env.kesch.sh +++ b/env.kesch.sh @@ -136,7 +136,7 @@ module load craype-haswell module load cudatoolkit/8.0.61 module load mvapich2gdr_gnu/2.2_cuda_8.0 module load gcc/5.4.0-2.26 -module load cmake +module load /users/jenkins/easybuild/kesch/modules/all/cmake/3.14.5 module load hdf5/1.8.18-gmvolf-17.02 module load git EOF @@ -226,7 +226,7 @@ module load craype-network-infiniband module load craype-haswell module load CrayCCE/.17.06 module load netCDF-Fortran/4.4.4-CrayCCE-17.06 -module load cmake +module load /users/jenkins/easybuild/kesch/modules/all/cmake/3.14.5 export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF else @@ -238,7 +238,7 @@ module load craype-accel-nvidia35 module swap cudatoolkit/8.0.61 module load PrgEnv-CrayCCE/17.06 module load netCDF-Fortran/4.4.4-CrayCCE-17.06 -module load cmake +module load /users/jenkins/easybuild/kesch/modules/all/cmake/3.14.5 export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF fi @@ -254,7 +254,7 @@ module load craype-haswell module load craype-network-infiniband module load PrgEnv-gnu/17.02 module load netcdf-fortran/4.4.4-gmvolf-17.02 -module load cmake +module load /users/jenkins/easybuild/kesch/modules/all/cmake/3.14.5 export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF module purge @@ -269,7 +269,7 @@ module load craype-haswell module load craype-network-infiniband module load PrgEnv-pgi/18.5 module load netcdf-fortran/4.4.4-pgi-18.5-gcc-5.4.0-2.26 -module load cmake +module load /users/jenkins/easybuild/kesch/modules/all/cmake/3.14.5 export GRIBAPI_COSMO_RESOURCES_VERSION=${GRIBAPI_COSMO_RESOURCES_VERSION} EOF module purge