From b19705488cc7cfb30b23ff510be4cd6e8462828b Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 24 Dec 2008 12:53:55 +0000 Subject: [PATCH] Implement make_source_and_build() function for metis and scotch --- config_files/metis-4.0.sh | 20 ++++++++++++++++++-- config_files/scotch-4.0.sh | 26 ++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/config_files/metis-4.0.sh b/config_files/metis-4.0.sh index 17d1e8e..9411549 100755 --- a/config_files/metis-4.0.sh +++ b/config_files/metis-4.0.sh @@ -61,13 +61,29 @@ install_source_and_build() # install sources install_source +# build sources +cd ${PRODUCT_SRC_DIR} +test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} + +# patch for 64bit platforms +if test `uname -m` = "x86_64" ; then + sed -e "s%COPTIONS[[:space:]]*=[[:space:]]*\(.*\)%COPTIONS = -fPIC \1%g" Makefile.in > Makefile.in.new + mv Makefile.in.new Makefile.in +fi + +# make +check_job ${PRODUCT_DIR}/MAKE.LOG make + +# install +cp -rf Doc Graphs libmetis.a pmetis kmetis oemetis onmetis partdmesh partnmesh mesh2dual mesh2nodal graphchk ${PRODUCT_DIR} + # remove sources and temporary files after building if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi -# install binary -install_binary +# to generate environment scripts +try_preinstalled } install_binary() diff --git a/config_files/scotch-4.0.sh b/config_files/scotch-4.0.sh index 736f264..b5e5e12 100755 --- a/config_files/scotch-4.0.sh +++ b/config_files/scotch-4.0.sh @@ -61,13 +61,35 @@ install_source_and_build() # install sources install_source +# build sources +cd ${PRODUCT_SRC_DIR} +test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} + +cd src + +# create Makefile for Linux 64bit platforms +if test `uname -m` = "x86_64" ; then + sed -e "s%CFLAGS\([[:space:]]*\)=\([[:space:]]*\)\(.*\)%CFLAGS\1=\2-fPIC \3%g" \ + Make.inc/Makefile.inc.i686_pc_linux2.prof > Make.inc/Makefile.inc.x86_64_pc_linux2.prof + ln -sf Make.inc/Makefile.inc.x86_64_pc_linux2.prof Makefile.inc +else + ln -sf Make.inc/Makefile.inc.i686_pc_linux2.prof Makefile.inc +fi + +# make +check_job ${PRODUCT_DIR}/MAKE.LOG make + +# install +cd ${PRODUCT_SRC_DIR} +cp -rf bin doc grf tgt ${PRODUCT_DIR} + # remove sources and temporary files after building if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi -# install binary -install_binary +# to generate environment scripts +try_preinstalled } install_binary() -- 2.39.2