107 lines
3.3 KiB
Bash
107 lines
3.3 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -ex
|
||
|
|
||
|
# need options <tarname parmetis> <parmetis version> <compiler> <compiler version> <mpi> <mpi version>"
|
||
|
# e.g.: ./install_parmetis.sh parmetis-4.0.3 4.0.3
|
||
|
# gnu 5.2.0 openmpi 1.10.1
|
||
|
|
||
|
TARFILE="$1.tar.gz"
|
||
|
PARMETIS_VERSION=$2
|
||
|
COMPILER=$3
|
||
|
COMPILER_VERSION=$4
|
||
|
MPI=$5
|
||
|
MPI_VERSION=$6
|
||
|
|
||
|
INSTDIR="/opt/numlib/parmetis/$PARMETIS_VERSION-$MPI-$MPI_VERSION-$COMPILER-$COMPILER_VERSION"
|
||
|
|
||
|
MODULEDIR="/opt/numlib/parmetis/modulefiles"
|
||
|
MODULEFILE="$PARMETIS_VERSION-$MPI-$MPI_VERSION-$COMPILER-$COMPILER_VERSION"
|
||
|
|
||
|
SRC_POOL="/lustre/nec/ws2/ws/hpcoftet-parmetis_install-0"
|
||
|
WORKDIR_BASE="$SRC_POOL/$1"
|
||
|
|
||
|
if [ ! -e "$SRC_POOL" ]; then
|
||
|
ws_allocate parmetis_install 5
|
||
|
fi
|
||
|
|
||
|
SIT_DIR="/zhome/academic/HLRS/hlrs/hpcoftet/sit3/sit/trunk/install_scripts"
|
||
|
mv $TARFILE $SRC_POOL
|
||
|
cd "$SIT_DIR"
|
||
|
#configure and install with sit
|
||
|
SRC_POOL=$SRC_POOL WORKDIR_BASE=$WORKDIR_BASE PREFIX_BASE=/opt COMPILER=$COMPILER COMPILER_VERSION=$COMPILER_VERSION MPI=$MPI MPI_VERSION=$MPI_VERSION ./sit numlib/parmetis/$PARMETIS_VERSION
|
||
|
|
||
|
|
||
|
#*************************** modulefile ******************************
|
||
|
|
||
|
cd "$MODULEDIR"
|
||
|
cat >"$MODULEFILE" <<EOF
|
||
|
#%Module
|
||
|
#
|
||
|
#=============================================================
|
||
|
# Installation info :
|
||
|
# Module:numlib/parmetis/$PARMETIS_VERSION-$MPI-$MPI_VERSION-$COMPILER-$COMPILER_VERSION
|
||
|
#
|
||
|
# This installation is for parmetis with 64bit data type width and openmpi-gnu
|
||
|
#
|
||
|
# prereq: mpi/openmpi/$MPI_VERSION-$COMPILER-$COMPILER_VERSION
|
||
|
#
|
||
|
# -- 1. -- Download parmetis:
|
||
|
# http://glaros.dtc.umn.edu/gkhome/metis/parmetis/download
|
||
|
#
|
||
|
# -- 2. -- Installation with sit
|
||
|
# $SRC_POOL $WORKDIR_BASE PREFIX_BASE=/opt $COMPILER $COMPILER_VERSION $MPI $MPI_VERSION ./sit numlib/petsc/$PARMETIS_VERSION
|
||
|
#=============================================================
|
||
|
|
||
|
set PARMETIS_BASE $INSTDIR
|
||
|
set mpipath mpi/openmpi/$MPI_VERSION-$COMPILER-$COMPILER_VERSION
|
||
|
set compiler $COMPILER
|
||
|
set compversion $COMPILER_VERSION
|
||
|
|
||
|
setenv PARMETIS_VERSION "$PETSC_VERSION"
|
||
|
setenv PARMETIS_DIR "$INSTDIR"
|
||
|
|
||
|
conflict numlib/parmetis
|
||
|
|
||
|
prepend-path LD_LIBRARY_PATH \$PARMETIS_BASE/lib
|
||
|
append-path INCLUDE \$PARMETIS_BASE/include
|
||
|
prepend-path PATH \$PARMETIS_BASE/bin
|
||
|
|
||
|
|
||
|
module-whatis "ParMETIS version $PARMETIS_VERSION"
|
||
|
|
||
|
proc ModulesHelp { } {
|
||
|
global PARMETIS_VERSION
|
||
|
|
||
|
puts stderr "ParMETIS version $PARMETIS_VERSION"
|
||
|
puts stderr "\n\tmtest - tests the adaptive partitioning routines"
|
||
|
puts stderr "\tparmetis - is the entry point of the ILUT"
|
||
|
puts stderr "\tpometis - is the entry point of the ILUT"
|
||
|
puts stderr "\tptest - tests the adaptive partitioning routines"
|
||
|
puts stderr "\n\tview Manual at /opt/numlib/parmetis/$PARMETIS_VERSION-$MPI-$MPI_VERSION-$COMPILER-$COMPILER_VERSION/manual.pdf\n"
|
||
|
puts stderr "\tFor further information visit"
|
||
|
puts stderr "\thttp://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview"
|
||
|
}
|
||
|
|
||
|
|
||
|
if { [module-info mode] == "load"
|
||
|
|| [module-info mode] == "show"
|
||
|
|| [module-info mode] == "display" } {
|
||
|
if { ! [is-loaded compiler/\$compiler/\$compversion] } {
|
||
|
if { [is-loaded compiler/\$compiler] } {
|
||
|
module unload compiler/\$compiler
|
||
|
}
|
||
|
module load compiler/\$compiler/\$compversion
|
||
|
}
|
||
|
if { ! [is-loaded \$mpipath] } {
|
||
|
if { [is-loaded mpi/openmpi] } {
|
||
|
module unload mpi/openmpi
|
||
|
}
|
||
|
module load \$mpipath
|
||
|
}
|
||
|
}
|
||
|
|
||
|
EOF
|
||
|
|
||
|
chmod 664 "$MODULEFILE"
|