# 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()
# 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()