#!/bin/bash # To build ADIOS on Onyx with: Intel # E. Kornkven # Feb 2, 2023 PKG=ADIOS2 V=2.8.3 # Base location for this installation INSTALLdir=$(cd .. ; pwd) # Functions for this script function title { b="= == == == == ="; echo -e "\n\n${b} $1 ${b}\n\n"; unset b; } function bail { # Arg $1 : error message; Arg $2 : exit status echo -e $1 stoptime=$(date +%s) echo -e "\n\nExiting after $(($stoptime-$starttime)) seconds.\n" exit $2 } # For debugging #export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' echo -e "\n\nThis is script: $0 \n\n" # Start timer starttime=$(date +%s) # Module versions used set +x COMPILERV=19.1.3.304 module switch $(module -t list 2>&1 | grep PrgEnv) PrgEnv-intel module switch intel/${COMPILERV} module load cray-hdf5/1.12.0.0 module load cmake/intel-19.1.3.304/3.21.0 module unload craype-hugepages2M module load cray-python/3.8.5.0 module list set -x echo "" export CRAYPE_LINK_TYPE=dynamic # Untar source files. This creates ${INSTALLdir}/${PKG}-${V}. cd $INSTALLdir [ ! -d ${PKG}-${V} ] && tar -xf wrk/${PKG}-${V}.tar.gz SOURCEdir=${INSTALLdir}/${PKG}-${V} cd ${INSTALLdir} BUILDdir=${INSTALLdir}/build [[ ! -d ${BUILDdir} ]] && mkdir ${BUILDdir} # Configure ADIOS cd ${BUILDdir} title "CMake" cmake ${SOURCEdir} \ -DCMAKE_INSTALL_PREFIX=${INSTALLdir} \ -DCMAKE_INSTALL_BINDIR=${INSTALLdir}/bin \ -DCMAKE_INSTALL_LIBDIR=${INSTALLdir}/lib \ -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DCMAKE_Fortran_COMPILER=ftn \ -DCMAKE_BUILD_TYPE=Release \ -DADIOS2_USE_ZeroMQ=OFF \ -DADIOS2_USE_ZFP=OFF \ -DADIOS2_USE_SZ=OFF \ -DADIOS2_USE_MGARD=OFF \ -DADIOS2_BUILD_EXAMPLES=ON \ -DBUILD_TESTING=ON \ -DADIOS2_USE_Profiling=False \ -DCMAKE_PREFIX_PATH=${INSTALLdir}/lib/adios2 \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_PREFIX_PATH="${BUILDdir};${INSTALLdir}" \ -DMPIEXEC_EXECUTABLE:FILEPATH=/opt/cray/alps/default/bin/aprun \ # #-Dadios2_DIR="${INSTALLdir}/lib/cmake/adios2" \ stat_cmake=$? if [[ $stat_cmake != 0 ]]; then #bail "\nError in cmake = ${stat_cmake}... exiting.\n" $stat_cmake echo -e "\nError in cmake = ${stat_cmake}... trudging on... $stat_cmake \n" else echo -e "\nCmake terminated normally... continuing. \n" fi ## Make ADIOS title "Make" #export ADIOS2_DIR="${INSTALLdir}/lib/cmake/adios2" #export adios2_DIR="${INSTALLdir}/lib/cmake/adios2" export ADIOS2_DIR="${BUILDdir}" export adios2_DIR="${BUILDdir}" make -j8 #make stat_make=$? if [[ $stat_make != 0 ]]; then #bail "\nMake failed... exiting.\n" $stat_make echo -e "\nError in make = ${stat_make}... trudging on... $stat_make \n" else echo -e "\nMake terminated normally... continuing. \n" fi title "Make install" #export ADIOS2_DIR="${INSTALLdir}/lib/cmake/adios2" #export adios2_DIR="${INSTALLdir}/lib/cmake/adios2" export ADIOS2_DIR="${BUILDdir}" export adios2_DIR="${BUILDdir}" make install stat_install=$? if [[ $stat_install != 0 ]]; then #bail "\nMake Install failed... exiting.\n" $stat_install echo -e "\nError in make install = ${stat_install}... trudging on... $stat_install \n" else echo -e "\nMake install terminated normally... continuing. \n" fi # Stop timer and display elapsed time stoptime=$(date +%s) echo -e "\n\nBuild completed succesfully in $(($stoptime-$starttime)) seconds.\n" exit 0 ### <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<