From 3b5d70ac8214b8a0879cc3c041af3b754325deed Mon Sep 17 00:00:00 2001 From: Elke Flehmig Date: Wed, 3 Jul 2013 08:55:55 +0000 Subject: [PATCH] new scripts for scotch installation --- packages/numlib/scotch/6.0.0 | 95 +++++++++++++++++++ .../scotch/6.0.0_Makefile.inc_patch_cray | 4 + .../scotch/6.0.0_Makefile.inc_patch_laki | 6 ++ .../scotch/6.0.0_test_strat_par.c_patch_laki | 2 + .../scotch/6.0.0_test_strat_seq.c_patch_laki | 2 + 5 files changed, 109 insertions(+) create mode 100755 packages/numlib/scotch/6.0.0 create mode 100644 packages/numlib/scotch/6.0.0_Makefile.inc_patch_cray create mode 100644 packages/numlib/scotch/6.0.0_Makefile.inc_patch_laki create mode 100644 packages/numlib/scotch/6.0.0_test_strat_par.c_patch_laki create mode 100644 packages/numlib/scotch/6.0.0_test_strat_seq.c_patch_laki diff --git a/packages/numlib/scotch/6.0.0 b/packages/numlib/scotch/6.0.0 new file mode 100755 index 0000000..2e318ed --- /dev/null +++ b/packages/numlib/scotch/6.0.0 @@ -0,0 +1,95 @@ +#!/bin/sh +# sit class file +# +# Christoph Niethammer (C) 2012 +# + +CATEGORY="numlib" +PACKAGE="scotch" +VERSION="6.0.0" +URL="http://www.labri.fr/perso/pelegrin/scotch/" +INSTALLER="Elke Flehmig " + +# 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 + ln -s 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 + ln -s 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 + +# 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 +} + + ;; +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" +} + +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...!" +} diff --git a/packages/numlib/scotch/6.0.0_Makefile.inc_patch_cray b/packages/numlib/scotch/6.0.0_Makefile.inc_patch_cray new file mode 100644 index 0000000..993ed7d --- /dev/null +++ b/packages/numlib/scotch/6.0.0_Makefile.inc_patch_cray @@ -0,0 +1,4 @@ +12c12 +< CFLAGS = -O3 -c99 -fast -fastsse -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DIDXSIZE64 +--- +> CFLAGS = -O3 -std=gnu99 -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DSCOTCH_RENAME_PARSER -DIDXSIZE64 -DINTSIZE64 -DCOMMON_MEMORY_TRACE -DSCOTCH_METIS_PREFIX diff --git a/packages/numlib/scotch/6.0.0_Makefile.inc_patch_laki b/packages/numlib/scotch/6.0.0_Makefile.inc_patch_laki new file mode 100644 index 0000000..00b263f --- /dev/null +++ b/packages/numlib/scotch/6.0.0_Makefile.inc_patch_laki @@ -0,0 +1,6 @@ +11,12c11,12 +< CCD = gcc +< CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -DIDXSIZE64 +--- +> CCD = mpicc +> CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -DIDXSIZE64 -DINTSIZE64 -DCOMMON_MEMORY_TRACE -DSCOTCH_METIS_PREFIX diff --git a/packages/numlib/scotch/6.0.0_test_strat_par.c_patch_laki b/packages/numlib/scotch/6.0.0_test_strat_par.c_patch_laki new file mode 100644 index 0000000..136045f --- /dev/null +++ b/packages/numlib/scotch/6.0.0_test_strat_par.c_patch_laki @@ -0,0 +1,2 @@ +55a56 +> #include diff --git a/packages/numlib/scotch/6.0.0_test_strat_seq.c_patch_laki b/packages/numlib/scotch/6.0.0_test_strat_seq.c_patch_laki new file mode 100644 index 0000000..2403fb4 --- /dev/null +++ b/packages/numlib/scotch/6.0.0_test_strat_seq.c_patch_laki @@ -0,0 +1,2 @@ +54a55 +> #include