Commit 596508de authored by Chuck Atkins's avatar Chuck Atkins Committed by Ben Boeckel
Browse files

sites: add build scripts for various sites

parent f9301ca4
#!/bin/bash
if [ $# -lt 4 ]
then
echo "Usage: $0 compiler compiler_version mpi mpi_version"
exit 1
fi
COMP=$1
COMP_VER=$2
MPI=$3
MPI_VER=$4
shift 4
case $COMP in
gcc)
COMP_MOD=compiler/gcc
COST_MOD=gnu
;;
intel)
COMP_MOD=compiler/intel
COST_MOD=intel
;;
*)
COMP_MOD=${COMP}
COST_MOD=${COMP}
;;
esac
case "${MPI}" in
impi|intel-mpi*)
MPI_MOD=$(module avail intel-mpi 2>&1 | grep -o "intel-mpi[^/]*/${MPI_VER}" | sed 's|\([^/]*\)/.*|\1|')
MPI=impi
;;
mpt|sgimpt)
MPI_MOD=mpt
MPI=sgimpt
;;
*)
MPI_MOD=${MPI}
;;
esac
module purge 1>/dev/null 2>&1
module load costinit
module load /app/startup/shell.module
module load ${COMP_MOD}/${COMP_VER}
module load ${MPI_MOD}/${MPI_VER}
module load binutils/2.23
module load git
module load lapack/${COST_MOD}/3.5.0
module load hdf5/${COST_MOD}/1.8.15
module list
BASENAME=5.1.2-osmesa_${COMP}-${COMP_VER}_${MPI}-${MPI_VER}
SRC=$(readlink -f $(dirname $(readlink -f $0))/../..)
DOWNLOADS=${PWD}/downloads
mkdir -p ${BASENAME}
cd ${BASENAME}
if [ "${COMP}" == "intel" ]
then
# Also load GCC to get proper C++11 support
module load gcc-compilers/4.8.4
export CC=icc CXX=icpc FC=ifort
if [ "${MPI}" == "impi" ]
then
export MPICC=mpiicc MPICXX=mpiicpc MPIFC=mpiifort
MPI_C_ARGS="-DMPI_C_COMPILER:FILEPATH=$(which mpiicc)"
MPI_CXX_ARGS="-DMPI_CXX_COMPILER:FILEPATH=$(which mpiicpc)"
MPI_F_ARGS="-DMPI_Fortran_COMPILER:FILEPATH=$(which mpiifort)"
fi
fi
~/Code/CMake/build/master/bin/cmake \
-DPARAVIEWSDK_PACKAGE_FILE_NAME=${BASENAME} \
-C${SRC}/cmake/sites/AFRL-Spirit.cmake \
${MPI_C_ARGS} ${MPI_CXX_ARGS} ${MPI_F_ARGS} \
"$@" ${SRC} 2>&1 | tee log.configure
make 2>&1 | tee log.build
~/Code/CMake/build/master/bin/ctest -R cpack-paraviewsdk-TGZ 2>&1 | tee log.package
#!/bin/bash
if [ $# -lt 4 ]
then
echo "Usage: $0 compiler compiler_version mpi mpi_version"
exit 1
fi
COMP=$1
COMP_VER=$2
MPI=$3
MPI_VER=$4
shift 4
case $COMP in
gcc)
COMP_MOD=gcc-compilers
COST_MOD=gnu
;;
intel)
COMP_MOD=intel-compilers
COST_MOD=intel
;;
*)
COMP_MOD=${COMP}
COST_MOD=${COMP}
;;
esac
case "${MPI}" in
impi|intel-mpi*)
MPI_MOD=$(module avail intel-mpi 2>&1 | grep -o "intel-mpi[^/]*/${MPI_VER}" | sed 's|\([^/]*\)/.*|\1|')
MPI=impi
;;
mpt|sgimpt)
MPI_MOD=mpt
MPI=sgimpt
;;
*)
MPI_MOD=${MPI}
;;
esac
module purge 1>/dev/null 2>&1
module load ${COMP_MOD}/${COMP_VER}
module load ${MPI_MOD}/${MPI_VER}
module load costinit
module load git
module load autoconf/${COST_MOD}
module load automake/${COST_MOD}
module load boost/${COST_MOD}/1.58.0
module load python/${COST_MOD}/2.7.9
module load numpy/${COST_MOD}/1.9.2
module load matplotlib/${COST_MOD}/1.4.3
module load hdf5/${COST_MOD}/1.8.15
export ACLOCAL="aclocal -I/usr/share/aclocal"
module list
BASENAME=5.1.2-osmesa_${COMP}-${COMP_VER}_${MPI}-${MPI_VER}
SRC=$(readlink -f $(dirname $(readlink -f $0))/../..)
mkdir -p ${BASENAME}
cd ${BASENAME}
if [ "${COMP}" == "intel" ]
then
# Also load GCC to get proper C++11 support
module load gcc-compilers/4.8.4
export CC=icc CXX=icpc FC=ifort
if [ "${MPI}" == "impi" ]
then
export MPICC=mpiicc MPICXX=mpiicpc MPIFC=mpiifort
MPI_C_ARGS="-DMPI_C_COMPILER:FILEPATH=$(which mpiicc)"
MPI_CXX_ARGS="-DMPI_CXX_COMPILER:FILEPATH=$(which mpiicpc)"
MPI_F_ARGS="-DMPI_Fortran_COMPILER:FILEPATH=$(which mpiifort)"
fi
fi
~/Code/CMake/build/master/bin/cmake \
-DPARAVIEWSDK_PACKAGE_FILE_NAME=${BASENAME} \
-C${SRC}/cmake/sites/AFRL-Thunder.cmake \
${MPI_C_ARGS} ${MPI_CXX_ARGS} ${MPI_F_ARGS} \
"$@" ${SRC} 2>&1 | tee log.configure
make 2>&1 | tee log.build
~/Code/CMake/build/master/bin/ctest -R cpack-paraviewsdk-TGZ 2>&1 | tee log.package
#!/bin/bash
if [ $# -ne 4 ]
then
echo "Usage: $0 compiler compiler_version mpi mpi_version"
exit 1
fi
COMP=$1
COMP_VER=$2
MPI=$3
MPI_VER=$4
module purge 1>/dev/null 2>&1
module load compiler/${COMP}/${COMP_VER}
module load mpi/${MPI}/${MPI_VER}
case $COMP in
gcc)
COST_MOD=gnu
;;
intel)
COST_MOD=intel
# Use a different GCC root to get C++11 working
export PATH=/apps/gnu_compiler/4.8.5/bin:$PATH
;;
*)
;;
esac
module load costinit
module load boost/${COST_MOD}/1.58.0
module load python/${COST_MOD}/2.7.10
module load numpy/${COST_MOD}/1.9.2
module load matplotlib/${COST_MOD}/1.4.3
module load hdf5/${COST_MOD}/1.8.15
BASENAME=5.1.2-osmesa_${COMP}-${COMP_VER}_${MPI}-${MPI_VER}
SRC=$(readlink -f $(dirname $(readlink -f $0))/../..)
DOWNLOADS=${PWD}/downloads
mkdir -p ${BASENAME}
cd ${BASENAME}
~/Code/CMake/build/bin/cmake \
-Dsuperbuild_download_location=${DOWNLOADS} \
-DPARAVIEWSDK_PACKAGE_FILE_NAME=${BASENAME} \
-C${SRC}/cmake/sites/ERDC-Topaz.cmake \
-DSUPERBUILD_PROJECT_PARALLELISM=14 \
${SRC}
make
~/Code/CMake/build/bin/ctest -R cpack-paraviewsdk-TGZ
#!/bin/bash
if [ $# -lt 4 ]
then
echo "Usage: $0 compiler compiler_version mpi mpi_version [extra cmake args]"
exit 1
fi
COMP=$1
COMP_VER=$2
MPI=$3
MPI_VER=$4
shift 4
case "${COMP}" in
intel)
COMP_MOD=intel
PE_MOD=intel
;;
gcc|gnu)
COMP_MOD=gcc
PE_MOD=gnu
;;
*)
COMP_MOD=${COMP}
PE_MOD=${COMP}
;;
esac
module purge
module load craype
module load craype-haswell
module load PrgEnv-${PE_MOD}
module swap ${COMP_MOD} ${COMP_MOD}/${COMP_VER}
module load ${MPI}/${MPI_VER}
module load cray-hdf5
module load friendly-testing cmake/3.6.1 git/2.3.3
export CC=$(which cc) CXX=$(which CC) FC=$(which ftn)
export CRAYPE_LINK_TYPE=dynamic
BASENAME=5.1.2-osmesa_${COMP}-${COMP_VER}_${MPI}-${MPI_VER}
SRC=$(readlink -f $(dirname $(readlink -f $0))/../..)
DOWNLOADS=${PWD}/downloads
mkdir -p ${BASENAME}
cd ${BASENAME}
cmake \
-Dsuperbuild_download_location=${DOWNLOADS} \
-DPARAVIEWSDK_PACKAGE_FILE_NAME=${BASENAME} \
-C${SRC}/cmake/sites/LANL-CLE6-Shared.cmake \
-DSUPERBUILD_PROJECT_PARALLELISM=10 \
"$@" ${SRC}
make
ctest -R cpack-paraviewsdk-TGZ
#!/bin/bash
##########
#MSUB -l nodes=1:ppn=1
#MSUB -l walltime=4:00:00
#MSUB -N pvbuild
####################
# Example Usage:
####################
#
# Submit a build on Lightshow for Intel 15.0.5 with OpenMPI 1.6.5.
# Note: Since Lightshow uses Nahelem CPUs, we will disable SWR and set
# the OSPray architecture to SSE.
#
# msub -v MACHINE=lightshow,COMP=intel,COMP_VER=15.0.5,MPI=openmpi,MPI_VER=1.6.5,SWR=0,OSPRAY=SSE /path/to/superbuild/source/Scripts/sites/LANL-TOSS2-Build.moab
#
# This will generate a logfile called lightshow.5.1.2-osmesa_intel-15.0.5_openmpi-1.6.5.out
# The build will be located in /usr/projects/packages/hpc_paraview/superbuild/build/lightshow/5.1.2-osmesa_intel-15.0.5_openmpi-1.6.5/
# Once finished, the result will be a file called 5.1.2-osmesa_intel-15.0.5_openmpi-1.6.5.tgz
#
####################
#
# Submit a build on Moonlight for Intel 16.0.3 with Intel MPI 5.1.3,
# specifying an alternate location to look for the downloadad tar files
# Note: Since Moonlight uses SandyBridge CPUs, we will leave SWR enabled
# by default and set the OSPray architecture to AVX.
#
# msub -v MACHINE=moonlight,COMP=intel,COMP_VER=16.0.3,MPI=impi,MPI_VER=5.1.3,OSPRAY=AVX,EXTRA_OPTS="-Dsuperbuild_download_location=/path/to/downloads" /path/to/superbuild/source/Scripts/sites/LANL-TOSS2-Build.moab
#
# This will generate a logfile called moonlight.5.1.2-osmesa_intel-16.0.3_impi-5.1.3.out
# The build will be located in /usr/projects/packages/hpc_paraview/superbuild/build/moonlight/5.1.2-osmesa_intel-16.0.3_impi-5.1.3
# Once finished, the result will be a file called 5.1.2-osmesa_intel-16.0.3_impi-5.1.3.tgz
#
####################
usage()
{
echo "This build script requires thr following variables to be set:"
echo " MACHINE - Machine name being built for"
echo " COMP - Compiler to build with (gcc or intel)"
echo " COMP_VER - Compiler version to build with"
echo " MPI - MPI distribution to use (openmpi or impi)"
echo " MPI_VER - MPI version to build with"
echo ""
echo "It also optionally accepts the following variables:"
echo " SWR - Whether or not to enable the SWR OSMesa driver."
echo " Values: 0, 1 (default)"
echo " OSPRAY - SIMD architecture to build OSPray with."
echo " Values: ALL (default), SSE, AVX, AVX2"
echo " EXTRA_OPTS - String containing additional CMake arguments to pass"
echo " during the configure step."
}
check_var()
{
local VARNAME="$1"
local DEFAULT="$2"
eval local VARVALUE=\$$VARNAME
if [ -z "$VARVALUE" ]
then
if [ $# -ge 2 ]
then
eval $VARNAME="${DEFAULT}"
else
echo "Error: ${VARNAME} is empty or not defined"
usage
exit 1
fi
fi
}
check_var MACHINE
check_var COMP
check_var COMP_VER
check_var MPI
check_var MPI_VER
check_var SWR 1
check_var OSPRAY ALL
check_var EXTRA_OPTS ""
case ${COMP} in
*)
COMP_MOD=${COMP}
;;
esac
case "${MPI}" in
impi|intel|intel-mpi*)
MPI_MOD=intel-mpi
MPI=impi
;;
*)
MPI_MOD=${MPI}
;;
esac
module purge
# Set newer GCC for binutils and C++11 headers
export PATH=/opt/rh/devtoolset-3/root/usr/bin:$PATH
module load ${COMP_MOD}/${COMP_VER}
module load ${MPI_MOD}/${MPI_VER}
module load friendly-testing cmake/3.6.0 git/2.3.3
BASENAME=5.1.2-osmesa_${COMP}-${COMP_VER}_${MPI}-${MPI_VER}
BASEDIR=/usr/projects/packages/hpc_paraview/superbuild
SRCDIR=${BASEDIR}/source/ParaViewSuperbuild
BINDIR=${BASEDIR}/build/${MACHINE}/${BASENAME}
LOG=${MACHINE}.${BASENAME}.out
# Make sure we use the correct MPI wrappers
if [ "${MPI}" == "impi" ] && [ "${COMP}" == "intel" ]
then
export MPICC=mpiicc MPICXX=mpiicpc MPIFC=mpiifort
MPI_C_ARGS="-DMPI_C_COMPILER:FILEPATH=$(which mpiicc)"
MPI_CXX_ARGS="-DMPI_CXX_COMPILER:FILEPATH=$(which mpiicpc)"
MPI_F_ARGS="-DMPI_Fortran_COMPILER:FILEPATH=$(which mpiifort)"
EXTRA_OPTS="${EXTRA_OPTS} ${MPI_C_ARGS} ${MPI_CXX_ARGS} ${MPI_F_ARGS}"
fi
if [ $SWR -eq 1 ]
then
EXTRA_OPTS="${EXTRA_OPTS} -DMESA_SWR_ENABLED=ON"
else
EXTRA_OPTS="${EXTRA_OPTS} -DMESA_SWR_ENABLED=OFF"
fi
EXTRA_OPTS="${EXTRA_OPTS} -DOSPRAY_BUILD_ISA=${OSPRAY}"
mkdir -p ${BINDIR}
cd ${BINDIR}
# This works around a cosmotools linker error. Still not sure why paraview has the
# associated linking problem but this seems to fix it
export LD_FLAGS="${LDFLAGS} -Wl,--allow-shlib-undefined"
cmake \
-DPARAVIEWSDK_PACKAGE_FILE_NAME=${BASENAME} \
-C${SRCDIR}/cmake/sites/LANL-TOSS2-Shared.cmake \
${EXTRA_OPTS} ${SRCDIR} 2>&1 | tee ~/${LOG}
make 2>&1 | tee -a ~/${LOG}
ctest -R cpack-paraviewsdk-TGZ 2>&1 | tee -a ~/${LOG}
proc ModulesHelp { } {
puts stderr "This loads the ParaView Catalyst environment"
}
proc ModulesDisplay { } {
puts stderr "Using ParaView Catalyst ${pv_module_version} built for ${current_compiler_name}/${pv_compiler_version} and ${current_mpi_name}/${pv_mpi_version}"
}
module-whatis "Loads the ParaView Catalyst environment"
conflict catalyst
conflict paraview
conflict ensight
conflict visit
set modules_loaded [split $env(LOADEDMODULES) :]
#
# Parse the currently laoded compiler
#
# The logic for detecting currently loaded compilers looks for modules matching
# either foo-compilers/foo_version or compiler/foo/foo_version. It also
# assumes that only a single version of a particuler compiler is loaded at
# any given time and that a gcc compiler may be loaded in addition to the
# compiler wanting to be used
#
set current_compilers [lsearch -inline -regexp -all ${modules_loaded} {^(compiler|[^/]+-compilers)/}]
if {[llength ${current_compilers}] == 0} {
puts stderr "Loading default compiler: ${default_compiler_mod}/${default_compiler_version}"
module load ${default_compiler_mod}/${default_compiler_version}
set current_compilers "${default_compiler_mod}/${default_compiler_version}"
}
set current_compiler_name ""
foreach compiler ${current_compilers} {
set s [split ${compiler} /]
set s0 [lindex ${s} 0]
if {${s0} == "compiler"} {
set n [lindex ${s} 1]
set v [lindex ${s} 2]
} else { # Matches [^/]+-compilers instead
set n [regsub {^([^/]+)-compilers} ${s0} {\1}]
set v [lindex ${s} 1]
}
if {${n} == "gnu"} {
set n "gcc"
}
# Allow GCC to be replaced by non-gcc compiler. This allows gcc to be
# loaded simultaneously with another compiler in order to provide necessary
# C++11 headers
if {${current_compiler_name} == "" || ${current_compiler_name} == "gcc"} {
set current_compiler ${compiler}
set current_compiler_name ${n}
set current_compiler_version ${v}
}
}
#
# Parse the currently loaded MPI module
#
set re_mpi {^(mpi/)?(openmi|mpich|mvapich|sgimpt|mpt|impi|intel-mpi|cray-mpich)/([^/]+)$}
set current_mpi [lsearch -inline -regexp ${modules_loaded} ${re_mpi}]
if {${current_mpi} == ""} {
puts stderr "Loading default MPI: ${default_mpi_mod}/${default_mpi_version}"
module load ${default_mpi_mod}/${default_mpi_version}
set current_mpi ${default_mpi_mod}/${default_mpi_version}
}
set current_mpi_match [regexp -inline ${re_mpi} ${current_mpi}]
set current_mpi_name [lindex ${current_mpi_match} 2]
set current_mpi_version [lindex ${current_mpi_match} 3]
switch ${current_mpi_name} {
mpt { set current_mpi_name "sgimpt" }
intel-mpi { set current_mpi_name "impi" }
default { }
}
if { ${current_compiler_name} == "gcc" } {
set current_compiler_mod "gnu"
} else {
set current_compiler_mod ${current_compiler_name}
}
# Grab all available installations
set pv_module_version [file tail $ModulesCurrentModulefile]
set pv_basedir $env(DAAC_HOME)/catalyst/${pv_module_version}
set available_dirs [glob -types d -nocomplain -directory ${pv_basedir} -tails */*/*/*]
if {[llength ${available_dirs}] == 0} {
puts stderr "No Catalyst installations found in ${pv_basedir}"
exit 1
}
# Only look in compiler compatible directories
set available_dirs [lsearch -all -inline ${available_dirs} ${current_compiler_mod}/*/${current_mpi_name}/*]
if {[llength ${available_dirs}] == 0} {
puts stderr "No Catalyst installations found compatible with the ${current_compiler_mod} compiler and ${current_mpi_name} MPI"
exit 1
}
# The following loop iterates through all installed configurations and looks
# for the closest compiler match without going over and then the closes MPI version match.
set pv_compiler_version ""
set pv_mpi_version ""
set cmp_pv_compiler_version ""
set cmp_pv_mpi_version ""
set cmp_current_compiler_version [regsub -all {\-} ${current_compiler_version} {.}]
set cmp_current_mpi_version [regsub -all {\-} ${current_mpi_version} {.}]
foreach dir ${available_dirs} {
set dsplit [split ${dir} /]
set test_compiler_version [lindex ${dsplit} 1]
set test_mpi_version [lindex ${dsplit} 3]
set cmp_test_compiler_version [regsub -all {\-} ${test_compiler_version} {.}]
set cmp_test_mpi_version [regsub -all {\-} ${test_mpi_version} {.}]
set cmp_current_compiler [package vcompare ${cmp_test_compiler_version} ${cmp_current_compiler_version}]
set cmp_current_mpi [package vcompare ${cmp_test_mpi_version} ${cmp_current_mpi_version}]
# Ignore install if either compiler or MPI versions are incompatible
if {${cmp_current_compiler} == 1 || ${cmp_current_mpi} == 1} { continue }
# Use it if it's the first one we've found
if {[string length ${pv_compiler_version}] == 0} {
set pv_compiler_version ${test_compiler_version}
set pv_mpi_version ${test_mpi_version}
set cmp_pv_compiler_version ${cmp_test_compiler_version}
set cmp_pv_mpi_version ${cmp_test_mpi_version}
continue
}
set cmp_pv_compiler [package vcompare ${cmp_test_compiler_version} ${cmp_pv_compiler_version}]
set cmp_pv_mpi [package vcompare ${cmp_test_mpi_version} ${cmp_pv_mpi_version}]
if {${cmp_pv_compiler} == 1 || (${cmp_pv_compiler} == 0 && ${cmp_pv_mpi} == 1)} {
set pv_compiler_version ${test_compiler_version}
set pv_mpi_version ${test_mpi_version}
set cmp_pv_compiler_version ${cmp_test_compiler_version}
set cmp_pv_mpi_version ${cmp_test_mpi_version}
}
}
if {[string length ${pv_compiler_version}] == 0} {
puts stderr "No Catalyst installations found compatible with the ${current_compiler_mod}/${current_compiler_version} compiler and ${current_mpi_name}/${current_mpi_version} MPI combination"
exit 2
}
puts stderr "Using ParaView Catalyst ${pv_module_version} built for ${current_compiler_name}-${pv_compiler_version} and ${current_mpi_name}-${pv_mpi_version}"
set pv_prefix ${pv_basedir}/${current_compiler_mod}/${pv_compiler_version}/${current_mpi_name}/${pv_mpi_version}
set pv_version [regexp -inline {[0-9]+\.[0-9]+} ${pv_module_version}]
if ![is-loaded costinit] {
module load costinit
}
if ![is-loaded lapack/${current_compiler_mod}] {
module load lapack/${current_compiler_mod}/${default_lapack_version}
}
if ![is-loaded hdf5/${current_compiler_mod}] {
module load hdf5/${current_compiler_mod}/${default_hdf5_version}
}
# Make sure we use the right set of GCC headers for C++11 compatibility
if { ${current_compiler_name} == "intel" } {
setenv GCC /app/gmpapp/gcc/platform/gcc-${default_intel_gcc_header_version}/bin
}
prepend-path PATH ${pv_prefix}/bin
prepend-path LD_LIBRARY_PATH ${pv_prefix}/lib
prepend-path LD_LIBRARY_PATH ${pv_prefix}/lib/paraview-${pv_version}
setenv PYTHONPATH ${pv_prefix}/lib/python2.7/site-packages
prepend-path PYTHONPATH ${pv_prefix}/lib/paraview-${pv_version}/site-packages
setenv ParaView_DIR ${pv_prefix}
set pv_version_full [regexp -inline {^[0-9\.]+} ${pv_module_version}]
exec $env(DAAC_HOME)/paraview/utils/daac_logger local DAAC_catalyst ${pv_version_full}
#%Module
set ModulesVersion "5.1.2-osmesa"
#%Module1.0
set default_compiler_mod intel-compiler
set default_compiler_version 15.0.3
set default_intel_gcc_header_version 4.8.4
set default_mpi_mod mpt
set default_mpi_version 2.12
set default_lapack_version 3.5.0
set default_hdf5_version 1.8.15
source [file join [file dirname $ModulesCurrentModulefile] .common]