diff --git a/etc/makeFiles/kahip/files b/etc/makeFiles/kahip/files index 9ecb867..1d5f775 100644 --- a/etc/makeFiles/kahip/files +++ b/etc/makeFiles/kahip/files @@ -1,4 +1,6 @@ -/* NOTE: make any changes to this file in etc/wmakeFiles/ */ +/* + * NOTE: make any changes to this file in ThirdParty etc/wmakeFiles/ + */ interface/kaHIP_interface.cpp @@ -66,5 +68,4 @@ algorithms/cycle_search.cpp partition/uncoarsening/refinement/cycle_improvements/cycle_refinement.cpp partition/uncoarsening/refinement/tabu_search/tabu_search.cpp - -LIB = $(FOAM_EXT_LIBBIN)/libkahip +LIB = $(KAHIP_LIB_DIR)/libkahip diff --git a/etc/makeFiles/kahip/options b/etc/makeFiles/kahip/options index 00da709..35c7a58 100644 --- a/etc/makeFiles/kahip/options +++ b/etc/makeFiles/kahip/options @@ -1,5 +1,5 @@ /* - * NOTE: make any changes to this file in etc/wmakeFiles/ + * NOTE: make any changes to this file in ThirdParty etc/wmakeFiles/ * Must use -DNDEBUG to disable kahip debug mode. * Using -DMODE_NODESEP is not strictly required for building the library. */ @@ -9,10 +9,13 @@ EXE_INC = \ ${COMP_OPENMP} \ -DNDEBUG -DMODE_NODESEP \ -I. \ - -I$(KAHIP_LIB_SRC) \ - -I$(KAHIP_LIB_SRC)/partition \ - -I$(KAHIP_LIB_SRC)/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement + -I./partition \ + -I./partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement LIB_LIBS = - PROJECT_LIBS = + +/* failsafe location */ +ifeq (,$(strip $(KAHIP_LIB_DIR))) +KAHIP_LIB_DIR = $(FOAM_EXT_LIBBIN) +endif diff --git a/etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Darwin.shlib b/etc/makeFiles/scotch/Makefile.inc.Darwin.shlib similarity index 75% rename from etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Darwin.shlib rename to etc/makeFiles/scotch/Makefile.inc.Darwin.shlib index 75d75a2..b9e4c5a 100644 --- a/etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Darwin.shlib +++ b/etc/makeFiles/scotch/Makefile.inc.Darwin.shlib @@ -33,9 +33,18 @@ CFLAGS = $(WM_CFLAGS) -fPIC -O3 \ -DCOMMON_RANDOM_FIXED_SEED \ -DSCOTCH_DETERMINISTIC \ -DSCOTCH_RENAME \ + -DIDXSIZE64 \ -Drestrict=__restrict -# 32-bit vs. 64-bit labels +# Use 32/64-bit integers +# --------------- +# Unfortunately -DINT32 seems to fail when openmpi is build without +# Fortran! The MPI_INT32_T is interpreted as MPI_INTEGER4 which does +# not exist +# --------------- +# ifeq ($(WM_LABEL_SIZE),32) +# CFLAGS += -DINTSIZE32 +# endif ifeq ($(WM_LABEL_SIZE),64) CFLAGS += -DINTSIZE64 endif @@ -50,7 +59,8 @@ LN = ln MKDIR = mkdir MV = mv RANLIB = echo -LEX = flex -Pscotchyy -olex.yy.c -YACC = bison -pscotchyy -y -b y + +LEX = flex "-Pscotchyy$(SCOTCH_NAME_SUFFIX)" -olex.yy.c +YACC = bison "-pscotchyy$(SCOTCH_NAME_SUFFIX)" -y -b y #------------------------------------------------------------------------------ diff --git a/etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux-Mingw.shlib b/etc/makeFiles/scotch/Makefile.inc.Linux-Mingw.shlib similarity index 80% rename from etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux-Mingw.shlib rename to etc/makeFiles/scotch/Makefile.inc.Linux-Mingw.shlib index 1172327..7254e21 100644 --- a/etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux-Mingw.shlib +++ b/etc/makeFiles/scotch/Makefile.inc.Linux-Mingw.shlib @@ -40,15 +40,23 @@ CCS = x86_64-w64-mingw32-gcc $(CFLAGS_WINMPI) CCP = x86_64-w64-mingw32-gcc $(CFLAGS_WINMPI) CCD = gcc $(CFLAGS_WINMPI) CFLAGS = $(WM_CFLAGS) -fPIC -O3 \ - -DCOMMON_PTHREAD_FILE \ + -DCOMMON_PTHREAD_FILE -DSCOTCH_PTHREAD \ -UCOMMON_FILE_COMPRESS \ -DCOMMON_RANDOM_FIXED_SEED \ -DSCOTCH_DETERMINISTIC \ -DSCOTCH_RENAME \ - -DSCOTCH_PTHREAD \ + -DIDXSIZE64 \ -Drestrict=__restrict -# 32-bit vs. 64-bit labels +# Use 32/64-bit integers +# --------------- +# Unfortunately -DINT32 seems to fail when openmpi is build without +# Fortran! The MPI_INT32_T is interpreted as MPI_INTEGER4 which does +# not exist +# --------------- +# ifeq ($(WM_LABEL_SIZE),32) +# CFLAGS += -DINTSIZE32 +# endif ifeq ($(WM_LABEL_SIZE),64) CFLAGS += -DINTSIZE64 endif @@ -67,7 +75,8 @@ LN = ln MKDIR = mkdir MV = mv RANLIB = echo -LEX = flex -Pscotchyy -olex.yy.c -YACC = bison -pscotchyy -y -b y + +LEX = flex "-Pscotchyy$(SCOTCH_NAME_SUFFIX)" -olex.yy.c +YACC = bison "-pscotchyy$(SCOTCH_NAME_SUFFIX)" -y -b y #------------------------------------------------------------------------------ diff --git a/etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux.shlib b/etc/makeFiles/scotch/Makefile.inc.Linux.shlib similarity index 75% rename from etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux.shlib rename to etc/makeFiles/scotch/Makefile.inc.Linux.shlib index 6a3eef1..20d29be 100644 --- a/etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux.shlib +++ b/etc/makeFiles/scotch/Makefile.inc.Linux.shlib @@ -33,9 +33,18 @@ CFLAGS = $(WM_CFLAGS) -fPIC -O3 \ -DCOMMON_RANDOM_FIXED_SEED \ -DSCOTCH_DETERMINISTIC \ -DSCOTCH_RENAME \ + -DIDXSIZE64 \ -Drestrict=__restrict -# 32-bit vs. 64-bit labels +# Use 32/64-bit integers +# --------------- +# Unfortunately -DINT32 seems to fail when openmpi is build without +# Fortran! The MPI_INT32_T is interpreted as MPI_INTEGER4 which does +# not exist +# --------------- +# ifeq ($(WM_LABEL_SIZE),32) +# CFLAGS += -DINTSIZE32 +# endif ifeq ($(WM_LABEL_SIZE),64) CFLAGS += -DINTSIZE64 endif @@ -50,7 +59,8 @@ LN = ln MKDIR = mkdir MV = mv RANLIB = echo -LEX = flex -Pscotchyy -olex.yy.c -YACC = bison -pscotchyy -y -b y + +LEX = flex "-Pscotchyy$(SCOTCH_NAME_SUFFIX)" -olex.yy.c +YACC = bison "-pscotchyy$(SCOTCH_NAME_SUFFIX)" -y -b y #------------------------------------------------------------------------------ diff --git a/makeKAHIP b/makeKAHIP index e3422f1..fbe8d55 100755 --- a/makeKAHIP +++ b/makeKAHIP @@ -57,62 +57,85 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { echo " Check your OpenFOAM environment and installation" exit 1 } -. etc/tools/ThirdPartyFunctions +. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ +# Obtain version from OpenFOAM etc/config.sh file: _foamConfig kahip -kahipPACKAGE=${KAHIP_VERSION:-kahip-system} +PACKAGE="${KAHIP_VERSION:-system}" targetType=libso +# Hint for cmake findMPI +if [ -d "$MPI_ARCH_PATH" ] +then + export MPI_HOME="$MPI_ARCH_PATH" +fi + #------------------------------------------------------------------------------ -usage() -{ - exec 1>&2 - while [ "$#" -ge 1 ]; do echo "$1"; shift; done +printVersions() { listPackageVersions kahip; exit 0; } +printHelp() { /bin/cat<