sit/packages/numlib/scotch/6.0.0
2024-03-28 02:45:19 +01:00

100 lines
3.5 KiB
Bash
Executable file

#!/bin/sh
# sit class file
#
# Christoph Niethammer <niethammer@hlrs.de> (C) 2012
#
# laki sit command:
# PREFIX_BASE=/opt COMPILER=gnu COMPILER_VERSION=4.8.1 MPI=openmpi MPI_VERSION=1.6.5 ./sit numlib/scotch/6.0.0
#
# hermit sit command:
# PREFIX_BASE=/opt/hlrs COMPILER=pgi COMPILER_VERSION=13.10.0 ./sit numlib/scotch/6.0.0
CATEGORY="numlib"
PACKAGE="scotch"
VERSION="6.0.0"
URL="http://www.labri.fr/perso/pelegrin/scotch/"
INSTALLER="Elke Flehmig <flehmig@hlrs.de>"
# Archive A and package name P
A=${PACKAGE}_${VERSION}.tar.gz
P=${PACKAGE}_${VERSION}/src
BUILDDIR=$SRCDIR
src_prepare() {
case $PLATFORM in
hermit|hermit1)
# there are some GNU extensions Cray compiler doesn't (yet) know about
# module swap PrgEnv-cray PrgEnv-gnu
echo "Building for hermit."
# link most fitting Makefile.inc sample:
cd $SRCDIR
cp Make.inc/Makefile.inc.x86-64_cray-xt4_linux2 Makefile.inc
echo "Linking Makefile.inc in $SRCDIR"
# adjust CFLAGS:
# remove not working options: -c99 -fast -fastsse
# add options: -DINTSIZE64 -DCOMMON_MEMORY_TRACE -DSCOTCH_METIS_PREFIX
# -DINTSIZE64 - set 64bit type width
# -DCOMMON_MEMORY_TRACE - enable monitoring of memory allocation
# -DSCOTCH_METIS_PREFIX - prefix scotch versions of metis files so as to avoid multiply defined symbol conflicts when using scotch and metis together
patch Makefile.inc < $SRC_POOL/6.0.0_Makefile.inc_patch_cray
;;
laki|*)
echo "Building for laki."
# link most fitting Makefile.inc sample:
cd $SRCDIR
cp Make.inc/Makefile.inc.x86-64_pc_linux2 Makefile.inc
echo "Linking Makefile.inc in $SRCDIR"
# add options to CFLAGS:
# -DINTSIZE64 -DCOMMON_MEMORY_TRACE -DSCOTCH_METIS_PREFIX
# -DINTSIZE64 - set 64bit type width
# -DCOMMON_MEMORY_TRACE - enable monitoring of memory allocation
# -DSCOTCH_METIS_PREFIX - prefix scotch versions of metis files so as to avoid multiply defined symbol conflicts when using scotch and metis together
# set CCD to avoid compilation errors for ptscotch:
# CCD = mpicc
patch Makefile.inc < $SRC_POOL/6.0.0_Makefile.inc_patch_laki
;;
esac
# set installation target path for prefix:
cd $SRCDIR
sed -i -e "/^prefix.*\?= /s#/usr/local#$PREFIX#" Makefile
}
sit_configure() {
sit_info "Configure not required"
}
src_build() {
sit_info "Building scotch..."
make scotch || sit_fail "Building scotch failed"
sit_info "Building ptscotch..."
make ptscotch || sit_fail "Building ptscotch failed"
}
# check fails on cray (for now...)
src_pretest() {
# add stdint.h to testfile to avoid failure
patch check/test_strat_seq.c < $SRC_POOL/6.0.0_test_strat_seq.c_patch_laki
sit_info "Checking scotch..."
make check || sit_fail "Checking scotch failed"
# ptcheck uses mpirun/requires qsub, which we will not process here
# may be done separately after installation...
# patch check/test_strat_par.c < $SRC_POOL/6.0.0_test_strat_par.c_patch_laki
# make ptcheck
}
src_install() {
mkdir -p $PREFIX
make install || sit_fail "Installation failed"
}
src_postinst() {
# mv documentation to target (not included in make install)
cd ${WORKDIR}/${PACKAGE}_${VERSION}; mv doc $PREFIX
sit_info "NOTE: you may want to run 'make ptcheck' on laki, but this has to be done via qsub as it calls mpirun!"
sit_info "NOTE: try 'make check' and 'ptcheck' on cray, but some may fail or have to be run with mpirun...!"
}