diff --git a/cmake/ExternalGitTags.cmake b/cmake/ExternalGitTags.cmake index e29c492f4..5e9421bdf 100644 --- a/cmake/ExternalGitTags.cmake +++ b/cmake/ExternalGitTags.cmake @@ -38,20 +38,6 @@ set(EXTERN_BUTTERFLYPACK_GIT_TAG "Git tag for external ButterflyPACK build" ) -# GKlib (for METIS and ParMETIS) -set(EXTERN_GKLIB_URL - "https://github.com/KarypisLab/GKlib.git" CACHE STRING - "URL for external GKlib build" -) -set(EXTERN_GKLIB_GIT_BRANCH - "master" CACHE STRING - "Git branch for external GKlib build" -) -set(EXTERN_GKLIB_GIT_TAG - "8bd6bad750b2b0d90800c632cf18e8ee93ad72d7" CACHE STRING # 03/26/2023 - "Git tag for external GKlib build" -) - # GSLIB set(EXTERN_GSLIB_URL "https://github.com/Nek5000/gslib.git" CACHE STRING @@ -124,7 +110,7 @@ set(EXTERN_MAGMA_GIT_TAG # METIS set(EXTERN_METIS_URL - "https://github.com/KarypisLab/METIS.git" CACHE STRING + "https://bitbucket.org/petsc/pkg-metis.git" CACHE STRING "URL for external METIS build" ) set(EXTERN_METIS_GIT_BRANCH @@ -132,7 +118,7 @@ set(EXTERN_METIS_GIT_BRANCH "Git branch for external METIS build" ) set(EXTERN_METIS_GIT_TAG - "e0f1b88b8efcb24ffa0ec55eabb78fbe61e58ae7" CACHE STRING # 04/02/2023 + "8b194fdf09661ac41b36fa16db0474d38f46f1ac" CACHE STRING # 01/10/2023 "Git tag for external METIS build" ) @@ -166,7 +152,7 @@ set(EXTERN_MUMPS_GIT_TAG # ParMETIS set(EXTERN_PARMETIS_URL - "https://github.com/KarypisLab/ParMETIS.git" CACHE STRING + "https://bitbucket.org/petsc/pkg-parmetis.git" CACHE STRING "URL for external ParMETIS build" ) set(EXTERN_PARMETIS_GIT_BRANCH @@ -174,7 +160,7 @@ set(EXTERN_PARMETIS_GIT_BRANCH "Git branch for external ParMETIS build" ) set(EXTERN_PARMETIS_GIT_TAG - "8ee6a372ca703836f593e3c450ca903f04be14df" CACHE STRING # 03/26/2023 + "f5e3aab04fd5fe6e09fa02f885c1c29d349f9f8b" CACHE STRING # 01/11/2023 "Git tag for external ParMETIS build" ) diff --git a/cmake/ExternalHYPRE.cmake b/cmake/ExternalHYPRE.cmake index 7af157628..1e2d74090 100644 --- a/cmake/ExternalHYPRE.cmake +++ b/cmake/ExternalHYPRE.cmake @@ -86,6 +86,9 @@ endif() # User might specify the MPI compiler wrappers directly, otherwise we need to supply MPI # as found from the CMake module +if(NOT MPI_FOUND) + message(FATAL_ERROR "MPI is not found when trying to build HYPRE") +endif() if(NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER) set(HYPRE_MPI_LIBRARIES) set(HYPRE_MPI_LIBRARY_DIRS) diff --git a/cmake/ExternalMETIS.cmake b/cmake/ExternalMETIS.cmake index fb1021eee..56ca9dd48 100644 --- a/cmake/ExternalMETIS.cmake +++ b/cmake/ExternalMETIS.cmake @@ -2,96 +2,71 @@ # SPDX-License-Identifier: Apache-2.0 # -# Build METIS and ParMETIS +# Build METIS and ParMETIS (from PETSc forks) # # Force build order -set(GKLIB_DEPENDENCIES) -set(METIS_DEPENDENCIES gklib) -set(PARMETIS_DEPENDENCIES gklib metis) +set(METIS_DEPENDENCIES) +set(PARMETIS_DEPENDENCIES metis) -# Build GKlib -set(GKLIB_OPTIONS ${PALACE_SUPERBUILD_DEFAULT_ARGS}) -list(APPEND GKLIB_OPTIONS - "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" - "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" -) -if(CMAKE_BUILD_TYPE MATCHES "Debug|debug|DEBUG") - list(APPEND GKLIB_OPTIONS - "-DDEBUG=ON" - "-DASSERT=ON" - "-DASSERT2=ON" - ) -endif() +# METIS does not add OpenMP flags +set(METIS_C_FLAGS "${CMAKE_C_FLAGS}") +set(METIS_MATH_LIB "m") if(PALACE_WITH_OPENMP) - list(APPEND GKLIB_OPTIONS - "-DOPENMP=ON" - ) + find_package(OpenMP REQUIRED) + set(METIS_C_FLAGS "${OpenMP_C_FLAGS} ${HYPRE_CFLAGS}") + string(REPLACE ";" "$" METIS_OPENMP_LIBRARIES "${OpenMP_C_LIBRARIES}") + set(METIS_MATH_LIB "${METIS_OPENMP_LIBRARIES}$${METIS_MATH_LIB}") endif() -string(REPLACE ";" "; " GKLIB_OPTIONS_PRINT "${GKLIB_OPTIONS}") -message(STATUS "GKLIB_OPTIONS: ${GKLIB_OPTIONS_PRINT}") - -# Some build fixes -set(GKLIB_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/GKlib/patch_build.diff" - "${CMAKE_SOURCE_DIR}/extern/patch/GKlib/patch_install.diff" -) - -include(ExternalProject) -ExternalProject_Add(gklib - DEPENDS ${GKLIB_DEPENDENCIES} - GIT_REPOSITORY ${EXTERN_GKLIB_URL} - GIT_TAG ${EXTERN_GKLIB_GIT_TAG} - SOURCE_DIR ${CMAKE_BINARY_DIR}/extern/GKlib - BINARY_DIR ${CMAKE_BINARY_DIR}/extern/GKlib-build - INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - PREFIX ${CMAKE_BINARY_DIR}/extern/GKlib-cmake - UPDATE_COMMAND "" - PATCH_COMMAND git apply "${GKLIB_PATCH_FILES}" - CONFIGURE_COMMAND ${CMAKE_COMMAND} "${GKLIB_OPTIONS}" - TEST_COMMAND "" -) - -# Build METIS (build settings are passed from GKlib) +# Build METIS set(METIS_OPTIONS ${PALACE_SUPERBUILD_DEFAULT_ARGS}) list(APPEND METIS_OPTIONS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" - "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" - "-DGKlib_ROOT=${CMAKE_INSTALL_PREFIX}" + "-DCMAKE_C_FLAGS=${METIS_C_FLAGS}" + "-DGKLIB_PATH=${CMAKE_BINARY_DIR}/extern/metis/GKlib" + "-DGKRAND=1" + "-DMATH_LIB=${METIS_MATH_LIB}" ) +if(CMAKE_BUILD_TYPE MATCHES "Debug|debug|DEBUG") + list(APPEND METIS_OPTIONS "-DDEBUG=1") +else() + list(APPEND METIS_OPTIONS "-DDEBUG=0") +endif() +if(BUILD_SHARED_LIBS) + list(APPEND METIS_OPTIONS "-DSHARED=1") +else() + list(APPEND METIS_OPTIONS "-DSHARED=0") +endif() +if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") + list(APPEND METIS_OPTIONS "-DMSVC=1") +else() + list(APPEND METIS_OPTIONS "-DMSVC=0") +endif() +if(PALACE_WITH_64BIT_INT) + list(APPEND METIS_OPTIONS "-DMETIS_USE_LONGINDEX=1") +else() + list(APPEND METIS_OPTIONS "-DMETIS_USE_LONGINDEX=0") +endif() +# list(APPEND METIS_OPTIONS "-DMETIS_USE_DOUBLEPRECISION=1") string(REPLACE ";" "; " METIS_OPTIONS_PRINT "${METIS_OPTIONS}") message(STATUS "METIS_OPTIONS: ${METIS_OPTIONS_PRINT}") # Some build fixes set(METIS_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/METIS/patch_build.diff" - "${CMAKE_SOURCE_DIR}/extern/patch/METIS/patch_install.diff" + "${CMAKE_SOURCE_DIR}/extern/patch/metis/patch_build.diff" ) -# Configure width of real and integer values -list(APPEND METIS_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/METIS/patch_real32.diff" -) -if(PALACE_WITH_64BIT_INT) - list(APPEND METIS_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/METIS/patch_idx64.diff" - ) -else() - list(APPEND METIS_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/METIS/patch_idx32.diff" - ) -endif() - +include(ExternalProject) ExternalProject_Add(metis DEPENDS ${METIS_DEPENDENCIES} GIT_REPOSITORY ${EXTERN_METIS_URL} GIT_TAG ${EXTERN_METIS_GIT_TAG} - SOURCE_DIR ${CMAKE_BINARY_DIR}/extern/METIS - BINARY_DIR ${CMAKE_BINARY_DIR}/extern/METIS-build + SOURCE_DIR ${CMAKE_BINARY_DIR}/extern/metis + BINARY_DIR ${CMAKE_BINARY_DIR}/extern/metis-build INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - PREFIX ${CMAKE_BINARY_DIR}/extern/METIS-cmake + PREFIX ${CMAKE_BINARY_DIR}/extern/metis-cmake UPDATE_COMMAND "" PATCH_COMMAND git apply "${METIS_PATCH_FILES}" CONFIGURE_COMMAND ${CMAKE_COMMAND} ${METIS_OPTIONS} @@ -100,30 +75,52 @@ ExternalProject_Add(metis # Build ParMETIS (as needed) if(PALACE_WITH_SUPERLU OR PALACE_WITH_STRUMPACK) - set(PARMETIS_OPTIONS ${METIS_OPTIONS}) + set(PARMETIS_OPTIONS ${PALACE_SUPERBUILD_DEFAULT_ARGS}) list(APPEND PARMETIS_OPTIONS - "-Dmetis_ROOT=${CMAKE_INSTALL_PREFIX}" + "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" + "-DGKLIB_PATH=${CMAKE_BINARY_DIR}/extern/metis/GKlib" + "-DMETIS_PATH=${CMAKE_INSTALL_PREFIX}" ) + if(BUILD_SHARED_LIBS) + list(APPEND PARMETIS_OPTIONS "-DSHARED=1") + else() + list(APPEND PARMETIS_OPTIONS "-DSHARED=0") + endif() + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") + list(APPEND PARMETIS_OPTIONS "-DMSVC=1") + else() + list(APPEND PARMETIS_OPTIONS "-DMSVC=0") + endif() + + # User might specify the MPI compiler wrappers directly, otherwise we need to supply MPI + # as found from the CMake module + if(NOT MPI_FOUND) + message(FATAL_ERROR "MPI is not found when trying to build ParMETIS") + endif() + if(NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER) + list(APPEND PARMETIS_OPTIONS + "-DMPI_LIBRARIES=${MPI_C_LIBRARIES}" + "-DMPI_INCLUDE_PATH=${MPI_C_INCLUDE_DIRS}" + ) + endif() string(REPLACE ";" "; " PARMETIS_OPTIONS_PRINT "${PARMETIS_OPTIONS}") message(STATUS "PARMETIS_OPTIONS: ${PARMETIS_OPTIONS_PRINT}") - # Apply some fixes for build and from Spack build - # (https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/parmetis) + # Some build fixes set(PARMETIS_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/ParMETIS/patch_build.diff" - "${CMAKE_SOURCE_DIR}/extern/patch/ParMETIS/patch_install.diff" - "${CMAKE_SOURCE_DIR}/extern/patch/ParMETIS/patch_spack.diff" + "${CMAKE_SOURCE_DIR}/extern/patch/parmetis/patch_build.diff" ) ExternalProject_Add(parmetis DEPENDS ${PARMETIS_DEPENDENCIES} GIT_REPOSITORY ${EXTERN_PARMETIS_URL} GIT_TAG ${EXTERN_PARMETIS_GIT_TAG} - SOURCE_DIR ${CMAKE_BINARY_DIR}/extern/ParMETIS - BINARY_DIR ${CMAKE_BINARY_DIR}/extern/ParMETIS-build + SOURCE_DIR ${CMAKE_BINARY_DIR}/extern/parmetis + BINARY_DIR ${CMAKE_BINARY_DIR}/extern/parmetis-build INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - PREFIX ${CMAKE_BINARY_DIR}/extern/ParMETIS-cmake + PREFIX ${CMAKE_BINARY_DIR}/extern/parmetis-cmake UPDATE_COMMAND "" PATCH_COMMAND git apply "${PARMETIS_PATCH_FILES}" CONFIGURE_COMMAND ${CMAKE_COMMAND} "${PARMETIS_OPTIONS}" @@ -132,19 +129,16 @@ if(PALACE_WITH_SUPERLU OR PALACE_WITH_STRUMPACK) endif() # Save variables to cache -include(GNUInstallDirs) if(BUILD_SHARED_LIBS) set(_METIS_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) else() set(_METIS_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX}) endif() -set(_METIS_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libGKlib${_METIS_LIB_SUFFIX}) -set(_METIS_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libmetis${_METIS_LIB_SUFFIX}$${_METIS_LIBRARIES}) -set(METIS_LIBRARIES ${_METIS_LIBRARIES} CACHE STRING +set(METIS_LIBRARIES ${CMAKE_INSTALL_PREFIX}/lib/libmetis${_METIS_LIB_SUFFIX} CACHE STRING "List of library files for METIS" ) if(PALACE_WITH_SUPERLU OR PALACE_WITH_STRUMPACK) - set(PARMETIS_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libparmetis${_METIS_LIB_SUFFIX} CACHE STRING + set(PARMETIS_LIBRARIES ${CMAKE_INSTALL_PREFIX}/lib/libparmetis${_METIS_LIB_SUFFIX} CACHE STRING "List of library files for ParMETIS" ) endif() diff --git a/cmake/ExternalSTRUMPACK.cmake b/cmake/ExternalSTRUMPACK.cmake index 66f22f570..9b0cfaf64 100644 --- a/cmake/ExternalSTRUMPACK.cmake +++ b/cmake/ExternalSTRUMPACK.cmake @@ -87,7 +87,7 @@ if(PALACE_STRUMPACK_WITH_BUTTERFLYPACK) # Nested Fortran functions in ButterflyPACK cause a static linkage problem Clang on MacOS if(NOT BUILD_SHARED_LIBS AND - (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND CMAKE_C_COMPILER_ID MATCHES "Clang")) + (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_C_COMPILER_ID MATCHES "Clang")) list(TRANSFORM BUTTERFLYPACK_OPTIONS REPLACE ".*BUILD_SHARED_LIBS.*" "-DBUILD_SHARED_LIBS=ON" ) @@ -127,7 +127,7 @@ if(PALACE_STRUMPACK_WITH_BUTTERFLYPACK) include(GNUInstallDirs) if(BUILD_SHARED_LIBS OR - (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND CMAKE_C_COMPILER_ID MATCHES "Clang")) + (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_C_COMPILER_ID MATCHES "Clang")) set(_BUTTERFLYPACK_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) else() set(_BUTTERFLYPACK_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX}) diff --git a/extern/patch/GKlib/patch_build.diff b/extern/patch/GKlib/patch_build.diff deleted file mode 100644 index 92d6dbf1b..000000000 --- a/extern/patch/GKlib/patch_build.diff +++ /dev/null @@ -1,636 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9cd1b4b..8bac52d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,31 +1,185 @@ --cmake_minimum_required(VERSION 2.8) --project(GKlib C) -+cmake_minimum_required(VERSION 3.13) - --option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) -+project(GKlib VERSION 0.0.1 LANGUAGES C) - --get_filename_component(abs "." ABSOLUTE) --set(GKLIB_PATH ${abs}) --unset(abs) --include(GKlibSystem.cmake) -+set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - --include_directories(".") --if(MSVC) -- include_directories("win32") -- file(GLOB win32_sources RELATIVE "win32" "*.c") --else(MSVC) -- set(win32_sources, "") --endif(MSVC) -+if(NOT CMAKE_BUILD_TYPE) -+ set(CMAKE_BUILD_TYPE Release) -+endif() - --add_library(GKlib ${GKlib_sources} ${win32_sources}) -+# ----------------------------------------------------------------------------- -+include(CheckCCompilerFlag) -+include(CheckCSourceCompiles) -+include(CheckFunctionExists) -+include(CheckIncludeFile) -+include(CMakePackageConfigHelpers) -+include(GNUInstallDirs) - --if(UNIX) -- target_link_libraries(GKlib m) --endif(UNIX) -+# ----------------------------------------------------------------------------- -+# User Options -+option(ASSERT "turn asserts on" OFF) -+option(ASSERT2 "additional assertions" OFF) -+option(DEBUG "add debugging support" OFF) -+option(GPROF "add gprof support" OFF) -+option(OPENMP "enable OpenMP support" OFF) -+option(PCRE "enable PCRE support" OFF) -+option(GKREGEX "enable GKREGEX support" OFF) -+option(GKRAND "enable GKRAND support" OFF) -+ -+if(NOT MSVC) -+ find_library(CMATH_LIB m REQUIRED) -+endif() -+ -+# ----------------------------------------------------------------------------- -+# This section from unmerged issue: https://github.com/KarypisLab/GKlib/pull/8 -+check_include_file(execinfo.h HAVE_EXECINFO_H) -+check_function_exists(getline HAVE_GETLINE) -+ -+if(PCRE) -+ check_include_file(pcreposix.h HAVE_PCREPOSIX_H) -+ if(NOT HAVE_PCREPOSIX_H) -+ message(WARNING "PCRE was requested, but is not available") -+ endif() -+endif() -+ -+if(NOT HAVE_PCREPOSIX_H) -+ check_include_file(regex.h HAVE_REGEX_H) -+ if(NOT HAVE_REGEX_H) -+ set(USE_GKREGEX ON) -+ endif() -+endif() -+ -+# Windows (Is this needed?) -+if(MSVC OR MINGW) -+ set(USE_GKREGEX ON) -+endif() -+ -+if(GPROF) -+ check_c_compiler_flag("-pg" HAVE_GPROF_SUPPORT) -+ if(NOT HAVE_GPROF_SUPPORT) -+ message(WARNING "GPROF support was requested, but is not available") -+ endif() -+endif() -+ -+if(OPENMP) -+ find_package(OpenMP) -+ if(NOT OpenMP_C_FOUND) -+ message(WARNING "OpenMP was requested, but is not available") -+ endif() -+endif() -+ -+# thread local storage -+if(NOT DEFINED HAVE_TLS) -+ set(TLS_NAME -+ "" -+ CACHE INTERNAL "Thread local keyword") -+ foreach(tls_name "__thread" "__declspec(thread)") -+ unset(HAVE_TLS CACHE) -+ check_c_source_compiles("${tls_name} int x; int main(void) { return 0; }" HAVE_TLS) -+ if(HAVE_TLS) -+ set(TLS_NAME -+ ${tls_name} -+ CACHE INTERNAL "Thread local keyword") -+ break() -+ else() -+ -+ endif() -+ endforeach() -+endif() -+ -+ -+add_library(${PROJECT_NAME}_compile_definitions INTERFACE) -+ -+target_compile_definitions( -+ ${PROJECT_NAME}_compile_definitions -+ INTERFACE $<$:LINUX> -+ $<$>:NDEBUG> -+ $<$>:NDEBUG2> -+ $<$,$>:DEBUG> -+ $<$:GKRAND> -+ $<$:HAVE_EXEC_INFO_H> -+ $<$:USE_PCRE> -+ $<$,$>:HAVE_PCREPOSIX_H> -+ $<$:HAVE_REGEX_H> -+ $<$:USE_GKREGEX> -+ $<$:HAVE_GETLINE> -+ __thread=${TLS_NAME} -+ $<$>:_FILE_OFFSET_BITS=64> -+ $<$:WIN32> -+ $<$:MSC> -+ $<$:_CRT_SECURE_NO_DEPRECATE>) -+ -+# ----------------------------------------------------------------------------- -+ -+add_library(${PROJECT_NAME}) -+add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -+ -+target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) -+set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE True) -+ -+file(GLOB GKlib_sources ${PROJECT_SOURCE_DIR}/*.c) -+file(GLOB GKlib_headers ${PROJECT_SOURCE_DIR}/*.h) -+ -+target_sources(${PROJECT_NAME} PRIVATE ${GKlib_sources} ${GKlib_headers} -+ $<$:win32/adapt.c win32/adapt.h>) -+ -+target_include_directories(${PROJECT_NAME} PUBLIC $ -+ $) -+ -+target_link_libraries( -+ ${PROJECT_NAME} -+ PUBLIC $<$>:${CMATH_LIB}> -+ PRIVATE ${PROJECT_NAME}_compile_definitions) -+ -+target_compile_options( -+ ${PROJECT_NAME} PRIVATE $<$:-fno-strict-aliasing> -+ ) -+ -+target_compile_options(${PROJECT_NAME} PUBLIC $<$,$>:-pg>) -+ -+ -+if(OpenMP_C_FOUND) -+ target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_C) -+endif() -+# ----------------------------------------------------------------------------- - - include_directories("test") - add_subdirectory("test") - --install(TARGETS GKlib -- ARCHIVE DESTINATION lib/${LINSTALL_PATH} -- LIBRARY DESTINATION lib/${LINSTALL_PATH}) --install(FILES ${GKlib_includes} DESTINATION include/${HINSTALL_PATH}) -+# ----------------------------------------------------------------------------- -+ -+configure_package_config_file(GKlibConfig.cmake.in cmake/GKlibConfig.cmake -+ INSTALL_DESTINATION lib/cmake/GKlib) -+ -+write_basic_package_version_file( -+ cmake/GKlibConfigVersion.cmake -+ VERSION ${PROJECT_VERSION} -+ COMPATIBILITY SameMajorVersion) -+ -+configure_file(GKlibConfig.cmake.in GKlibConfig.cmake @ONLY) -+ -+# ----------------------------------------------------------------------------- -+ -+# install library -+install( -+ TARGETS ${PROJECT_NAME} -+ EXPORT GKlibTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ -+install( -+ FILES ${GKlib_headers} -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ -+install(TARGETS ${PROJECT_NAME}_compile_definitions EXPORT GKlibTargets) -+ -+install(EXPORT GKlibTargets FILE GKlibTargets.cmake NAMESPACE GKlib:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/GKlib) -+ -+ -+install( -+ FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/GKlibConfig.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/GKlibConfigVersion.cmake -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/GKlib) -\ No newline at end of file -diff --git a/GKlib.h b/GKlib.h -index 9278fe4..061e4cb 100644 ---- a/GKlib.h -+++ b/GKlib.h -@@ -1,6 +1,6 @@ - /* - * GKlib.h -- * -+ * - * George's library of most frequently used routines - * - * $Id: GKlib.h 14866 2013-08-03 16:40:04Z karypis $ -@@ -55,7 +55,7 @@ - - - --#if defined(__OPENMP__) -+#if defined(_OPENMP) - #include - #endif - -diff --git a/GKlibConfig.cmake.in b/GKlibConfig.cmake.in -new file mode 100644 -index 0000000..8c3f1c9 ---- /dev/null -+++ b/GKlibConfig.cmake.in -@@ -0,0 +1,16 @@ -+if(NOT GKlib_FOUND) -+set(GKlib_FOUND True) -+ -+@PACKAGE_INIT@ -+ -+set(GKlib_OpenMP_C_FOUND @OpenMP_C_FOUND@) -+if(GKlib_OpenMP_C_FOUND) -+ include(CMakeFindDependencyMacro) -+ find_dependency(OpenMP) -+endif() -+ -+include(${CMAKE_CURRENT_LIST_DIR}/GKlibTargets.cmake) -+ -+check_required_components(GKlib) -+ -+endif() -\ No newline at end of file -diff --git a/GKlibSystem.cmake b/GKlibSystem.cmake -deleted file mode 100644 -index 31a1cf1..0000000 ---- a/GKlibSystem.cmake -+++ /dev/null -@@ -1,152 +0,0 @@ --# Helper modules. --include(CheckFunctionExists) --include(CheckIncludeFile) -- --# Setup options. --option(GDB "enable use of GDB" OFF) --option(ASSERT "turn asserts on" OFF) --option(ASSERT2 "additional assertions" OFF) --option(DEBUG "add debugging support" OFF) --option(GPROF "add gprof support" OFF) --option(VALGRIND "add valgrind support" OFF) --option(OPENMP "enable OpenMP support" OFF) --option(PCRE "enable PCRE support" OFF) --option(GKREGEX "enable GKREGEX support" OFF) --option(GKRAND "enable GKRAND support" OFF) --option(NO_X86 "enable NO_X86 support" OFF) -- -- --# Add compiler flags. --if(MSVC) -- set(GKlib_COPTS "/Ox") -- set(GKlib_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") --elseif(MINGW) -- set(GKlib_COPTS "-DUSE_GKREGEX") --else() -- set(GKlib_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") --endif(MSVC) --if(CYGWIN) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DCYGWIN") --endif(CYGWIN) --if(CMAKE_COMPILER_IS_GNUCC) --# GCC opts. -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -std=c99 -fno-strict-aliasing") --if(VALGRIND) -- set(GKlib_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic") --else() --# -march=native is not a valid flag on PPC: --if(CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -mtune=native") --else() -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -march=native") --endif() --endif(VALGRIND) -- if(NOT MINGW) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC") -- endif(NOT MINGW) --# GCC warnings. -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") --elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") --# Sun insists on -xc99. -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99") --endif(CMAKE_COMPILER_IS_GNUCC) -- --# Intel compiler --if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -xHost -std=c99") --endif() -- --# Find OpenMP if it is requested. --if(OPENMP) -- include(FindOpenMP) -- if(OPENMP_FOUND) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") -- else() -- message(WARNING "OpenMP was requested but support was not found") -- endif(OPENMP_FOUND) --endif(OPENMP) -- --# Set the CPU type --if(NO_X86) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNO_X86=${NO_X86}") --endif(NO_X86) -- --# Add various definitions. --if(GDB) -- set(GKlib_COPTS "${GKlib_COPTS} -g") -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror") --else() -- set(GKlib_COPTS "-O3") --endif(GDB) -- -- --if(DEBUG) -- set(GKlib_COPTS "-g") -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DDEBUG") --endif(DEBUG) -- --if(GPROF) -- set(GKlib_COPTS "-pg") --endif(GPROF) -- --if(NOT ASSERT) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG") --endif(NOT ASSERT) -- --if(NOT ASSERT2) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG2") --endif(NOT ASSERT2) -- -- --# Add various options --if(PCRE) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__WITHPCRE__") --endif(PCRE) -- --if(GKREGEX) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKREGEX") --endif(GKREGEX) -- --if(GKRAND) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKRAND") --endif(GKRAND) -- -- --# Check for features. --check_include_file(execinfo.h HAVE_EXECINFO_H) --if(HAVE_EXECINFO_H) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_EXECINFO_H") --endif(HAVE_EXECINFO_H) -- --check_function_exists(getline HAVE_GETLINE) --if(HAVE_GETLINE) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_GETLINE") --endif(HAVE_GETLINE) -- -- --# Custom check for TLS. --if(MSVC) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=__declspec(thread)") -- -- # This if checks if that value is cached or not. -- if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") -- try_compile(HAVE_THREADLOCALSTORAGE -- ${CMAKE_BINARY_DIR} -- ${GKLIB_PATH}/conf/check_thread_storage.c) -- if(HAVE_THREADLOCALSTORAGE) -- message(STATUS "checking for thread-local storage - found") -- else() -- message(STATUS "checking for thread-local storage - not found") -- endif() -- endif() -- if(NOT HAVE_THREADLOCALSTORAGE) -- set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=") -- endif() --endif() -- --# Finally set the official C flags. --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GKlib_COPTIONS} ${GKlib_COPTS}") -- --# Find GKlib sources. --file(GLOB GKlib_sources ${GKLIB_PATH}/*.c) --file(GLOB GKlib_includes ${GKLIB_PATH}/*.h) -diff --git a/Makefile b/Makefile -deleted file mode 100644 -index 6ac97b9..0000000 ---- a/Makefile -+++ /dev/null -@@ -1,87 +0,0 @@ --# Configuration options. --cc = gcc --prefix = ~/local --openmp = not-set --gdb = not-set --assert = not-set --assert2 = not-set --debug = not-set --gprof = not-set --valgrind = not-set --pcre = not-set --gkregex = not-set --gkrand = not-set -- -- --# Basically proxies everything to the builddir cmake. --cputype = $(shell uname -m | sed "s/\\ /_/g") --systype = $(shell uname -s) -- --BUILDDIR = build/$(systype)-$(cputype) -- --# Process configuration options. --CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1 --ifneq ($(gdb), not-set) -- CONFIG_FLAGS += -DGDB=$(gdb) --endif --ifneq ($(assert), not-set) -- CONFIG_FLAGS += -DASSERT=$(assert) --endif --ifneq ($(assert2), not-set) -- CONFIG_FLAGS += -DASSERT2=$(assert2) --endif --ifneq ($(debug), not-set) -- CONFIG_FLAGS += -DDEBUG=$(debug) --endif --ifneq ($(gprof), not-set) -- CONFIG_FLAGS += -DGPROF=$(gprof) --endif --ifneq ($(valgrind), not-set) -- CONFIG_FLAGS += -DVALGRIND=$(valgrind) --endif --ifneq ($(openmp), not-set) -- CONFIG_FLAGS += -DOPENMP=$(openmp) --endif --ifneq ($(pcre), not-set) -- CONFIG_FLAGS += -DPCRE=$(pcre) --endif --ifneq ($(gkregex), not-set) -- CONFIG_FLAGS += -DGKREGEX=$(pcre) --endif --ifneq ($(gkrand), not-set) -- CONFIG_FLAGS += -DGKRAND=$(pcre) --endif --ifneq ($(prefix), not-set) -- CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix) --endif --ifneq ($(cc), not-set) -- CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc) --endif --ifneq ($(cputype), x86_64) -- CONFIG_FLAGS += -DNO_X86=$(cputype) --endif -- --define run-config --mkdir -p $(BUILDDIR) --cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS) --endef -- --all clean install: $(BUILDDIR) -- make -C $(BUILDDIR) $@ -- --uninstall: -- xargs rm < $(BUILDDIR)/install_manifest.txt -- --$(BUILDDIR): -- $(run-config) -- --config: distclean -- $(run-config) -- --distclean: -- rm -rf $(BUILDDIR) -- --remake: -- find . -name CMakeLists.txt -exec touch {} ';' -- --.PHONY: config distclean all clean install uninstall remake -diff --git a/README.md b/README.md -index f94eeea..93a7d76 100644 ---- a/README.md -+++ b/README.md -@@ -1,54 +1,6 @@ - # GKlib - A library of various helper routines and frameworks used by many of the lab's software - --## Build requirements -- - CMake 2.8, found at http://www.cmake.org/, as well as GNU make. - --Assuming that the above are available, two commands should suffice to --build the software: --``` --make config --make --``` -- --## Configuring the build --It is primarily configured by passing options to make config. For example: --``` --make config cc=icc --``` -- --would configure it to be built using icc. -- --Configuration options are: --``` --cc=[compiler] - The C compiler to use [default: gcc] --prefix=[PATH] - Set the installation prefix [default: ~/local] --openmp=set - To build a version with OpenMP support --``` -- -- --## Building and installing --To build and install, run the following --``` --make --make install --``` -- --By default, the library file, header file, and binaries will be installed in --``` --~/local/lib --~/local/include --~/local/bin --``` -- --## Other make commands -- make uninstall -- Removes all files installed by 'make install'. -- -- make clean -- Removes all object files but retains the configuration options. -- -- make distclean -- Performs clean and completely removes the build directory. - - -diff --git a/conf/check_thread_storage.c b/conf/check_thread_storage.c -deleted file mode 100644 -index e6e1e98..0000000 ---- a/conf/check_thread_storage.c -+++ /dev/null -@@ -1,5 +0,0 @@ --extern __thread int x; -- --int main(int argc, char **argv) { -- return 0; --} -diff --git a/gk_proto.h b/gk_proto.h -index 6fd6bd4..aa943a5 100644 ---- a/gk_proto.h -+++ b/gk_proto.h -@@ -292,7 +292,7 @@ uint32_t gk_randint32(void); - /*------------------------------------------------------------- - * OpenMP fake functions - *-------------------------------------------------------------*/ --#if !defined(__OPENMP__) -+#if !defined(_OPENMP) - void omp_set_num_threads(int num_threads); - int omp_get_num_threads(void); - int omp_get_max_threads(void); -@@ -303,7 +303,7 @@ void omp_set_dynamic(int num_threads); - int omp_get_dynamic(void); - void omp_set_nested(int nested); - int omp_get_nested(void); --#endif /* __OPENMP__ */ -+#endif /* _OPENMP */ - - - /*------------------------------------------------------------- -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 8584820..04ecac1 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -9,11 +9,15 @@ add_executable(grKx grKx.c) - add_executable(m2mnbrs m2mnbrs.c) - add_executable(cmpnbrs cmpnbrs.c) - add_executable(splatt2svd splatt2svd.c) --add_executable(gkuniq gkuniq.c) - --foreach(prog strings gksort fis gkrw gkgraph csrcnv grKx m2mnbrs cmpnbrs splatt2svd gkuniq) -+foreach(prog strings gksort fis gkrw gkgraph csrcnv grKx m2mnbrs cmpnbrs splatt2svd) - target_link_libraries(${prog} GKlib) - endforeach(prog) - -+if(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|arm*") -+ add_executable(gkuniq gkuniq.c) -+ target_link_libraries(gkuniq GKlib) -+endif() -+ - # Install a subset of them - install(TARGETS csrcnv RUNTIME DESTINATION bin) -diff --git a/timers.c b/timers.c -index bb8f296..b004e23 100644 ---- a/timers.c -+++ b/timers.c -@@ -35,7 +35,7 @@ double gk_WClockSeconds(void) - **************************************************************************/ - double gk_CPUSeconds(void) - { --//#ifdef __OPENMP__ -+//#ifdef _OPENMP - #ifdef __OPENMPXXXX__ - return omp_get_wtime(); - #else - diff --git a/extern/patch/GKlib/patch_install.diff b/extern/patch/GKlib/patch_install.diff deleted file mode 100644 index bd406a162..000000000 --- a/extern/patch/GKlib/patch_install.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 04ecac1..3fafee7 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -19,5 +19,5 @@ if(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|arm*") - target_link_libraries(gkuniq GKlib) - endif() - --# Install a subset of them --install(TARGETS csrcnv RUNTIME DESTINATION bin) -+# # Install a subset of them -+# install(TARGETS csrcnv RUNTIME DESTINATION bin) - diff --git a/extern/patch/METIS/patch_build.diff b/extern/patch/METIS/patch_build.diff deleted file mode 100644 index ac0404550..000000000 --- a/extern/patch/METIS/patch_build.diff +++ /dev/null @@ -1,416 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a15d19a..e1f1731 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,22 +1,26 @@ --cmake_minimum_required(VERSION 2.8) --project(METIS C) -+cmake_minimum_required(VERSION 3.13) - --set(SHARED FALSE CACHE BOOL "build a shared library") -+project(metis VERSION 0.0.1 LANGUAGES C) - --if(MSVC) -- set(METIS_INSTALL FALSE) --else() -- set(METIS_INSTALL TRUE) -+set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -+ -+if(NOT CMAKE_BUILD_TYPE) -+ set(CMAKE_BUILD_TYPE Release) - endif() - --# Configure libmetis library. --if(SHARED) -- set(METIS_LIBRARY_TYPE SHARED) --else() -- set(METIS_LIBRARY_TYPE STATIC) --endif(SHARED) -+# ----------------------------------------------------------------------------- -+include(GNUInstallDirs) -+ -+find_package(GKlib REQUIRED) -+ -+if(GPROF) -+ check_c_compiler_flag("-pg" HAVE_GPROF_SUPPORT) -+ if(NOT HAVE_GPROF_SUPPORT) -+ message(WARNING "GPROF support was requested, but is not available") -+ endif() -+endif() - --include(./conf/gkbuild.cmake) -+# ----------------------------------------------------------------------------- - - # METIS' custom options - #option(IDX64 "enable 64 bit ints" OFF) -@@ -34,19 +38,5 @@ include(./conf/gkbuild.cmake) - # - #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${METIS_COPTIONS}") - -- --# Add include directories. --# i.e., the -I equivalent --include_directories(build/xinclude) --include_directories(${GKLIB_PATH}/include) --include_directories(${CMAKE_INSTALL_PREFIX}/include) -- --# List of paths that the compiler will search for library files. --# i.e., the -L equivalent --link_directories(${GKLIB_PATH}/lib) --link_directories(${CMAKE_INSTALL_PREFIX}/lib) -- --# Recursively look for CMakeLists.txt in subdirs. --add_subdirectory("build/xinclude") --add_subdirectory("libmetis") --add_subdirectory("programs") -+add_subdirectory(libmetis) -+add_subdirectory(programs) -diff --git a/conf/check_thread_storage.c b/conf/check_thread_storage.c -deleted file mode 100644 -index e6e1e98..0000000 ---- a/conf/check_thread_storage.c -+++ /dev/null -@@ -1,5 +0,0 @@ --extern __thread int x; -- --int main(int argc, char **argv) { -- return 0; --} -diff --git a/conf/gkbuild.cmake b/conf/gkbuild.cmake -deleted file mode 100644 -index 591ece4..0000000 ---- a/conf/gkbuild.cmake -+++ /dev/null -@@ -1,148 +0,0 @@ --# Helper modules. --include(CheckFunctionExists) --include(CheckIncludeFile) -- --# Setup options. --option(GDB "enable use of GDB" OFF) --option(ASSERT "turn asserts on" OFF) --option(ASSERT2 "additional assertions" OFF) --option(DEBUG "add debugging support" OFF) --option(GPROF "add gprof support" OFF) --option(VALGRIND "add valgrind support" OFF) --option(OPENMP "enable OpenMP support" OFF) --option(PCRE "enable PCRE support" OFF) --option(GKREGEX "enable GKREGEX support" OFF) --option(GKRAND "enable GKRAND support" OFF) -- --# Add compiler flags. --if(MSVC) -- set(GK_COPTS "/Ox") -- set(GK_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") --elseif(MINGW) -- set(GK_COPTS "-DUSE_GKREGEX") --else() -- set(GK_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") --endif(MSVC) --if(CYGWIN) -- set(GK_COPTIONS "${GK_COPTIONS} -DCYGWIN") --endif(CYGWIN) --if(CMAKE_COMPILER_IS_GNUCC) --# GCC opts. -- set(GK_COPTIONS "${GK_COPTIONS} -std=c99 -fno-strict-aliasing") --if(VALGRIND) -- set(GK_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic") --else() --# -march=native is not a valid flag on PPC: --if(CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")) -- set(GK_COPTIONS "${GK_COPTIONS} -mtune=native") --else() -- set(GK_COPTIONS "${GK_COPTIONS} -march=native") --endif() --endif(VALGRIND) -- if(NOT MINGW) -- set(GK_COPTIONS "${GK_COPTIONS} -fPIC") -- endif(NOT MINGW) --# GCC warnings. -- set(GK_COPTIONS "${GK_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") --elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") --# Sun insists on -xc99. -- set(GK_COPTIONS "${GK_COPTIONS} -xc99") --endif(CMAKE_COMPILER_IS_GNUCC) -- --if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel") -- set(GK_COPTIONS "${GK_COPTIONS} -xHost") -- # set(GK_COPTIONS "${GK_COPTIONS} -fast") --endif() -- --# Add support for MacOS items --if(APPLE) -- set(GK_COPTIONS "${GK_COPTIONS} -DMACOS") --endif(APPLE) -- --# Find OpenMP if it is requested. --if(OPENMP) -- include(FindOpenMP) -- if(OPENMP_FOUND) -- set(GK_COPTIONS "${GK_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") -- else() -- message(WARNING "OpenMP was requested but support was not found") -- endif(OPENMP_FOUND) --endif(OPENMP) -- -- --# Add various definitions. --if(GDB) -- set(GK_COPTS "${GK_COPTS} -g") -- set(GK_COPTIONS "${GK_COPTIONS} -Werror") --else() -- set(GK_COPTS "-O3") --endif(GDB) -- -- --if(DEBUG) -- set(GK_COPTS "-Og") -- set(GK_COPTIONS "${GK_COPTIONS} -DDEBUG") --endif(DEBUG) -- --if(GPROF) -- set(GK_COPTS "-pg") --endif(GPROF) -- --if(NOT ASSERT) -- set(GK_COPTIONS "${GK_COPTIONS} -DNDEBUG") --endif(NOT ASSERT) -- --if(NOT ASSERT2) -- set(GK_COPTIONS "${GK_COPTIONS} -DNDEBUG2") --endif(NOT ASSERT2) -- -- --# Add various options --if(PCRE) -- set(GK_COPTIONS "${GK_COPTIONS} -D__WITHPCRE__") --endif(PCRE) -- --if(GKREGEX) -- set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKREGEX") --endif(GKREGEX) -- --if(GKRAND) -- set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKRAND") --endif(GKRAND) -- -- --# Check for features. --check_include_file(execinfo.h HAVE_EXECINFO_H) --if(HAVE_EXECINFO_H) -- set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_EXECINFO_H") --endif(HAVE_EXECINFO_H) -- --check_function_exists(getline HAVE_GETLINE) --if(HAVE_GETLINE) -- set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_GETLINE") --endif(HAVE_GETLINE) -- -- --# Custom check for TLS. --if(MSVC) -- set(GK_COPTIONS "${GK_COPTIONS} -D__thread=__declspec(thread)") -- -- # This if checks if that value is cached or not. -- if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") -- try_compile(HAVE_THREADLOCALSTORAGE -- ${CMAKE_BINARY_DIR} -- ${CMAKE_SOURCE_DIR}/conf/check_thread_storage.c) -- if(HAVE_THREADLOCALSTORAGE) -- message(STATUS "checking for thread-local storage - found") -- else() -- message(STATUS "checking for thread-local storage - not found") -- endif() -- endif() -- if(NOT HAVE_THREADLOCALSTORAGE) -- set(GK_COPTIONS "${GK_COPTIONS} -D__thread=") -- endif() --endif() -- --# Finally set the official C flags. --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GK_COPTIONS} ${GK_COPTS}") -- -diff --git a/conf/metisConfig.cmake.in b/conf/metisConfig.cmake.in -new file mode 100644 -index 0000000..3caad46 ---- /dev/null -+++ b/conf/metisConfig.cmake.in -@@ -0,0 +1,13 @@ -+if(NOT metis_FOUND) -+set(metis_FOUND True) -+ -+@PACKAGE_INIT@ -+ -+include(CMakeFindDependencyMacro) -+find_dependency(GKlib) -+ -+include(${CMAKE_CURRENT_LIST_DIR}/metisTargets.cmake) -+ -+check_required_components(metis) -+ -+endif() -\ No newline at end of file -diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -deleted file mode 100644 -index 9515a51..0000000 ---- a/include/CMakeLists.txt -+++ /dev/null -@@ -1,3 +0,0 @@ --if(METIS_INSTALL) -- install(FILES metis.h DESTINATION include) --endif() -diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt -index fc6cec6..0d0e7b4 100644 ---- a/libmetis/CMakeLists.txt -+++ b/libmetis/CMakeLists.txt -@@ -1,15 +1,52 @@ --# Add this directory for internal users. --include_directories(.) -- - # Find sources. --file(GLOB metis_sources *.c) -+file(GLOB metis_sources ${CMAKE_CURRENT_SOURCE_DIR}/*.c) -+file(GLOB metis_headers ${CMAKE_CURRENT_SOURCE_DIR}/*.h) -+ -+add_library(${PROJECT_NAME}) -+add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -+ -+target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) -+set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE True) -+ -+target_sources(${PROJECT_NAME} PRIVATE ${metis_sources} ${metis_headers} ${PROJECT_SOURCE_DIR}/include/metis.h) -+ -+target_include_directories(${PROJECT_NAME} PUBLIC $ $ -+ $) -+ -+target_link_libraries(${PROJECT_NAME} -+ PUBLIC GKlib::GKlib -+ PRIVATE GKlib::GKlib_compile_definitions) -+ -+target_compile_options(${PROJECT_NAME} PUBLIC $<$,$>:-pg>) -+ -+# ----------------------------------------------------------------------------- -+# Configure and Install -+include(CMakePackageConfigHelpers) -+ -+configure_package_config_file(${PROJECT_SOURCE_DIR}/conf/metisConfig.cmake.in cmake/metisConfig.cmake -+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/metis) -+ -+write_basic_package_version_file( -+ cmake/metisConfigVersion.cmake -+ VERSION ${PROJECT_VERSION} -+ COMPATIBILITY SameMajorVersion) -+ -+# --------------------------- -+install( -+ TARGETS ${PROJECT_NAME} -+ EXPORT metisTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+) -+ -+install( -+ FILES ${PROJECT_SOURCE_DIR}/include/metis.h -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - --# Build libmetis. --add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources}) -+install(EXPORT metisTargets FILE metisTargets.cmake NAMESPACE metis:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/metis) - --if(METIS_INSTALL) -- install(TARGETS metis -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION lib -- ARCHIVE DESTINATION lib) --endif() -+install( -+ FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/metisConfig.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/metisConfigVersion.cmake -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/metis) -\ No newline at end of file -diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt -index baf40ad..cab3078 100644 ---- a/programs/CMakeLists.txt -+++ b/programs/CMakeLists.txt -@@ -1,6 +1,3 @@ --# These programs use internal metis data structures. --include_directories(../libmetis) -- - # Build program. - add_executable(gpmetis gpmetis.c cmdline_gpmetis.c io.c stat.c) - add_executable(ndmetis ndmetis.c cmdline_ndmetis.c io.c smbfactor.c) -@@ -11,10 +8,8 @@ add_executable(cmpfillin cmpfillin.c io.c smbfactor.c) - - # Link with the required libraries - foreach(prog gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin) -- target_link_libraries(${prog} metis GKlib m) -+ target_link_libraries(${prog} PRIVATE metis::metis) - endforeach(prog) - --if(METIS_INSTALL) -- install(TARGETS gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin -- RUNTIME DESTINATION bin) --endif() -+install(TARGETS gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -diff --git a/programs/gpmetis.c b/programs/gpmetis.c -index 4b7e0b5..b57914f 100644 ---- a/programs/gpmetis.c -+++ b/programs/gpmetis.c -@@ -239,14 +239,5 @@ void GPReportResults(params_t *params, graph_t *graph, idx_t *part, idx_t objval - printf("\nMemory Information ----------------------------------------------------------\n"); - printf(" Max memory used:\t\t %7.3"PRREAL" MB\n", (real_t)(params->maxmemory/(1024.0*1024.0))); - --#ifndef MACOS -- { -- struct rusage usage; -- getrusage(RUSAGE_SELF, &usage); -- printf(" rusage.ru_maxrss:\t\t %7.3"PRREAL" MB\n", (real_t)(usage.ru_maxrss/(1024.0))); -- } -- printf(" proc/self/stat/VmPeak:\t %7.3"PRREAL" MB\n", (real_t)gk_GetProcVmPeak()/(1024.0*1024.0)); --#endif -- - printf("******************************************************************************\n"); - } -diff --git a/programs/mpmetis.c b/programs/mpmetis.c -index 04a6a1b..a604864 100644 ---- a/programs/mpmetis.c -+++ b/programs/mpmetis.c -@@ -188,15 +188,6 @@ void MPReportResults(params_t *params, mesh_t *mesh, idx_t *epart, idx_t *npart, - printf("\nMemory Information ----------------------------------------------------------\n"); - printf(" Max memory used:\t\t %7.3"PRREAL" MB\n", (real_t)(params->maxmemory/(1024.0*1024.0))); - --#ifndef MACOS -- { -- struct rusage usage; -- getrusage(RUSAGE_SELF, &usage); -- printf(" rusage.ru_maxrss:\t\t %7.3"PRREAL" MB\n", (real_t)(usage.ru_maxrss/(1024.0))); -- } -- printf(" proc/self/stat/VmPeak:\t %7.3"PRREAL" MB\n", (real_t)gk_GetProcVmPeak()/(1024.0*1024.0)); --#endif -- - printf("******************************************************************************\n"); - - } -diff --git a/programs/ndmetis.c b/programs/ndmetis.c -index 5991f0c..c6ed1b5 100644 ---- a/programs/ndmetis.c -+++ b/programs/ndmetis.c -@@ -172,15 +172,6 @@ void NDReportResults(params_t *params, graph_t *graph, idx_t *perm, - printf("\nMemory Information ----------------------------------------------------------\n"); - printf(" Max memory used:\t\t %7.3"PRREAL" MB\n", (real_t)(params->maxmemory/(1024.0*1024.0))); - --#ifndef MACOS -- { -- struct rusage usage; -- getrusage(RUSAGE_SELF, &usage); -- printf(" rusage.ru_maxrss:\t\t %7.3"PRREAL" MB\n", (real_t)(usage.ru_maxrss/(1024.0))); -- } -- printf(" proc/self/stat/VmPeak:\t %7.3"PRREAL" MB\n", (real_t)gk_GetProcVmPeak()/(1024.0*1024.0)); --#endif -- - printf("******************************************************************************\n"); - - } - diff --git a/extern/patch/METIS/patch_idx32.diff b/extern/patch/METIS/patch_idx32.diff deleted file mode 100644 index 65fba223d..000000000 --- a/extern/patch/METIS/patch_idx32.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/include/metis.h b/include/metis.h -index 7fef0e7..85291cb 100644 ---- a/include/metis.h -+++ b/include/metis.h -@@ -30,7 +30,7 @@ - GCC does provides these definitions in stdint.h, but it may require some - modifications on other architectures. - --------------------------------------------------------------------------*/ --//#define IDXTYPEWIDTH 32 -+#define IDXTYPEWIDTH 32 - - - /*-------------------------------------------------------------------------- - diff --git a/extern/patch/METIS/patch_idx64.diff b/extern/patch/METIS/patch_idx64.diff deleted file mode 100644 index 8c6b63ddf..000000000 --- a/extern/patch/METIS/patch_idx64.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/include/metis.h b/include/metis.h -index 7fef0e7..69e7241 100644 ---- a/include/metis.h -+++ b/include/metis.h -@@ -30,7 +30,7 @@ - GCC does provides these definitions in stdint.h, but it may require some - modifications on other architectures. - --------------------------------------------------------------------------*/ --//#define IDXTYPEWIDTH 32 -+#define IDXTYPEWIDTH 64 - - - /*-------------------------------------------------------------------------- - diff --git a/extern/patch/METIS/patch_install.diff b/extern/patch/METIS/patch_install.diff deleted file mode 100644 index 175b4fa52..000000000 --- a/extern/patch/METIS/patch_install.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt -index e22ec29..22d4bd5 100644 ---- a/programs/CMakeLists.txt -+++ b/programs/CMakeLists.txt -@@ -11,5 +11,5 @@ foreach(prog gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin) - target_link_libraries(${prog} PRIVATE metis::metis) - endforeach(prog) - --install(TARGETS gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+# install(TARGETS gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin -+# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - diff --git a/extern/patch/METIS/patch_real32.diff b/extern/patch/METIS/patch_real32.diff deleted file mode 100644 index fedaec30b..000000000 --- a/extern/patch/METIS/patch_real32.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/include/metis.h b/include/metis.h -index d5550ec..04ba74d 100644 ---- a/include/metis.h -+++ b/include/metis.h -@@ -40,7 +40,7 @@ - 32 : single precision floating point (float) - 64 : double precision floating point (double) - --------------------------------------------------------------------------*/ --//#define REALTYPEWIDTH 32 -+#define REALTYPEWIDTH 32 - - - - diff --git a/extern/patch/METIS/patch_real64.diff b/extern/patch/METIS/patch_real64.diff deleted file mode 100644 index e1671a0dd..000000000 --- a/extern/patch/METIS/patch_real64.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/include/metis.h b/include/metis.h -index d5550ec..04ba74d 100644 ---- a/include/metis.h -+++ b/include/metis.h -@@ -40,7 +40,7 @@ - 32 : single precision floating point (float) - 64 : double precision floating point (double) - --------------------------------------------------------------------------*/ --//#define REALTYPEWIDTH 32 -+#define REALTYPEWIDTH 64 - - - - diff --git a/extern/patch/ParMETIS/patch_build.diff b/extern/patch/ParMETIS/patch_build.diff deleted file mode 100644 index 9489077d0..000000000 --- a/extern/patch/ParMETIS/patch_build.diff +++ /dev/null @@ -1,307 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 146bc5f..89f3c13 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,43 +1,30 @@ --cmake_minimum_required(VERSION 2.8) --project(ParMETIS C) -+cmake_minimum_required(VERSION 3.13) -+project(parmetis VERSION 0.0.1 LANGUAGES C) - -+set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - --# Search for MPI. --# GK commented this out as it seems to be creating problems --# include(FindMPI) --# if(NOT MPI_FOUND) --# message(FATAL_ERROR "mpi is not found") --# endif() --# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}") -+if(NOT CMAKE_BUILD_TYPE) -+ set(CMAKE_BUILD_TYPE Release) -+endif() -+ -+# ----------------------------------------------------------------------------- -+include(GNUInstallDirs) -+ -+find_package(metis REQUIRED) - -+find_package(MPI COMPONENTS C REQUIRED) - --# Prepare libraries. --if(SHARED) -- set(ParMETIS_LIBRARY_TYPE SHARED) --else() -- set(ParMETIS_LIBRARY_TYPE STATIC) -+if(GPROF) -+ check_c_compiler_flag("-pg" HAVE_GPROF_SUPPORT) -+ if(NOT HAVE_GPROF_SUPPORT) -+ message(WARNING "GPROF support was requested, but is not available") -+ endif() - endif() - --include(./conf/gkbuild.cmake) -+# ----------------------------------------------------------------------------- -+ - --# List of paths that the compiler will search for header files. --# i.e., the -I equivalent --include_directories(include) --include_directories(${MPI_INCLUDE_PATH}) --include_directories(${GKLIB_PATH}/include) --include_directories(${METIS_PATH}/include) --include_directories(${CMAKE_INSTALL_PREFIX}/include) - --# List of paths that the compiler will search for library files. --# i.e., the -L equivalent --link_directories(${GKLIB_PATH}/lib) --link_directories(${METIS_PATH}/lib) --link_directories(${CMAKE_INSTALL_PREFIX}/lib) - --# List of directories that cmake will look for CMakeLists.txt --add_subdirectory(include) - add_subdirectory(libparmetis) - add_subdirectory(programs) -- --# This is for testing during development and is not being distributed --#add_subdirectory(test) -diff --git a/conf/check_thread_storage.c b/conf/check_thread_storage.c -deleted file mode 100644 -index e6e1e98..0000000 ---- a/conf/check_thread_storage.c -+++ /dev/null -@@ -1,5 +0,0 @@ --extern __thread int x; -- --int main(int argc, char **argv) { -- return 0; --} -diff --git a/conf/parmetisConfig.cmake.in b/conf/parmetisConfig.cmake.in -new file mode 100644 -index 0000000..3e948b1 ---- /dev/null -+++ b/conf/parmetisConfig.cmake.in -@@ -0,0 +1,14 @@ -+if(NOT parmetis_FOUND) -+set(parmetis_FOUND True) -+ -+@PACKAGE_INIT@ -+ -+include(CMakeFindDependencyMacro) -+find_dependency(metis) -+find_dependency(MPI COMPONENTS C) -+ -+include(${CMAKE_CURRENT_LIST_DIR}/parmetisTargets.cmake) -+ -+check_required_components(parmetis) -+ -+endif() -\ No newline at end of file -diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -deleted file mode 100644 -index 6a27074..0000000 ---- a/include/CMakeLists.txt -+++ /dev/null -@@ -1 +0,0 @@ --install(FILES parmetis.h DESTINATION include) -\ No newline at end of file -diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt -index b9d6d84..b8ddac5 100644 ---- a/libparmetis/CMakeLists.txt -+++ b/libparmetis/CMakeLists.txt -@@ -1,17 +1,52 @@ - # Include directories for library code. --include_directories(.) -- --# Find sources. --file(GLOB parmetis_sources *.c) -- --# Create libparmetis --add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources}) -- --if(SHARED) -- target_link_libraries(parmetis metis GKlib) --endif() -- --install(TARGETS parmetis -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION lib -- ARCHIVE DESTINATION lib) -+file(GLOB parmetis_sources ${CMAKE_CURRENT_SOURCE_DIR}/*.c) -+file(GLOB parmetis_headers ${CMAKE_CURRENT_SOURCE_DIR}/*.h) -+ -+add_library(${PROJECT_NAME}) -+add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -+ -+target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) -+set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE True) -+ -+target_sources(${PROJECT_NAME} PRIVATE ${parmetis_sources} ${parmetis_headers} ${PROJECT_SOURCE_DIR}/include/parmetis.h) -+ -+target_include_directories(${PROJECT_NAME} PUBLIC $ $ -+ $) -+ -+target_link_libraries(${PROJECT_NAME} -+ PUBLIC metis::metis GKlib::GKlib MPI::MPI_C -+ PRIVATE GKlib::GKlib_compile_definitions) -+ -+target_compile_options(${PROJECT_NAME} PUBLIC $<$,$>:-pg>) -+ -+# ----------------------------------------------------------------------------- -+# Configure and Install -+include(CMakePackageConfigHelpers) -+ -+configure_package_config_file(${PROJECT_SOURCE_DIR}/conf/parmetisConfig.cmake.in cmake/parmetisConfig.cmake -+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/parmetis) -+ -+write_basic_package_version_file( -+ cmake/parmetisConfigVersion.cmake -+ VERSION ${PROJECT_VERSION} -+ COMPATIBILITY SameMajorVersion) -+ -+# --------------------------- -+install( -+ TARGETS ${PROJECT_NAME} -+ EXPORT parmetisTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+) -+ -+install( -+ FILES ${PROJECT_SOURCE_DIR}/include/parmetis.h -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ -+install(EXPORT parmetisTargets FILE parmetisTargets.cmake NAMESPACE parmetis:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/parmetis) -+ -+install( -+ FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/parmetisConfig.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/parmetisConfigVersion.cmake -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/parmetis) -\ No newline at end of file -diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt -index 2f9341c..19285d7 100644 ---- a/programs/CMakeLists.txt -+++ b/programs/CMakeLists.txt -@@ -1,5 +1,3 @@ --include_directories(.) -- - # Create programs. - add_executable(pm_ptest ptest.c io.c adaptgraph.c) - add_executable(pm_mtest mtest.c io.c) -@@ -9,8 +7,8 @@ add_executable(pm_dglpart dglpart.c) - - # Link with the required libraries - foreach(prog pm_ptest pm_mtest pm_parmetis pm_pometis pm_dglpart) -- target_link_libraries(${prog} parmetis metis GKlib m) -+ target_link_libraries(${prog} PRIVATE parmetis::parmetis) - endforeach(prog) - - install(TARGETS pm_ptest pm_mtest pm_parmetis pm_pometis pm_dglpart -- RUNTIME DESTINATION bin) -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -diff --git a/programs/adaptgraph.c b/programs/adaptgraph.c -index 76ec425..92eeb03 100644 ---- a/programs/adaptgraph.c -+++ b/programs/adaptgraph.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - - /************************************************************************* -diff --git a/programs/dglpart.c b/programs/dglpart.c -index 8d964cd..0f616af 100644 ---- a/programs/dglpart.c -+++ b/programs/dglpart.c -@@ -8,7 +8,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - #define CHUNKSIZE (1<<15) - -diff --git a/programs/io.c b/programs/io.c -index 9250659..eba63ac 100644 ---- a/programs/io.c -+++ b/programs/io.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - #define MAXLINE 64*1024*1024 - - /************************************************************************* -diff --git a/programs/mtest.c b/programs/mtest.c -index f6f892e..dc86ca3 100644 ---- a/programs/mtest.c -+++ b/programs/mtest.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - - /************************************************************************* -diff --git a/programs/otest.c b/programs/otest.c -index aaee9c3..11cdc97 100644 ---- a/programs/otest.c -+++ b/programs/otest.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - - /*************************************************************************/ -diff --git a/programs/parmetis.c b/programs/parmetis.c -index e087eb5..aef7ddc 100644 ---- a/programs/parmetis.c -+++ b/programs/parmetis.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - /************************************************************************* - * Let the game begin -diff --git a/programs/pometis.c b/programs/pometis.c -index 2f18fbc..a306cfe 100644 ---- a/programs/pometis.c -+++ b/programs/pometis.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - /************************************************************************* - * Let the game begin -diff --git a/programs/ptest.c b/programs/ptest.c -index 7cfb00b..87083d0 100644 ---- a/programs/ptest.c -+++ b/programs/ptest.c -@@ -12,7 +12,7 @@ - * - */ - --#include -+#include "parmetisbin.h" - - #define NCON 5 - - diff --git a/extern/patch/ParMETIS/patch_install.diff b/extern/patch/ParMETIS/patch_install.diff deleted file mode 100644 index 643a67c95..000000000 --- a/extern/patch/ParMETIS/patch_install.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt -index 19285d7..e27a809 100644 ---- a/programs/CMakeLists.txt -+++ b/programs/CMakeLists.txt -@@ -10,5 +10,5 @@ foreach(prog pm_ptest pm_mtest pm_parmetis pm_pometis pm_dglpart) - target_link_libraries(${prog} PRIVATE parmetis::parmetis) - endforeach(prog) - --install(TARGETS pm_ptest pm_mtest pm_parmetis pm_pometis pm_dglpart -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+# install(TARGETS pm_ptest pm_mtest pm_parmetis pm_pometis pm_dglpart -+# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - diff --git a/extern/patch/ParMETIS/patch_spack.diff b/extern/patch/ParMETIS/patch_spack.diff deleted file mode 100644 index 3313269f3..000000000 --- a/extern/patch/ParMETIS/patch_spack.diff +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/libparmetis/xyzpart.c b/libparmetis/xyzpart.c -index 0f1d746..9cc18ac 100644 ---- a/libparmetis/xyzpart.c -+++ b/libparmetis/xyzpart.c -@@ -104,14 +104,14 @@ void IRBinCoordinates(ctrl_t *ctrl, graph_t *graph, idx_t ndims, real_t *xyz, - - for (i=0; i 0 */ ++ for (sum=0.0, j=ptr[i]; j 0 */ + } + if (sum > 0) { +- if (norm == 2) +- sum=1.0/sqrt(sum); +- else if (norm == 1) +- sum=1.0/sum; ++ if (norm == 2) ++ sum=1.0/sqrt(sum); ++ else if (norm == 1) ++ sum=1.0/sum; + for (j=ptr[i]; j OMPMINOPS) + { +- #pragma omp for private(j,sum) schedule(static) ++ #pragma omp for private(j,sum) schedule(static) + for (i=0; i 0) { +- if (norm == 2) +- sum=1.0/sqrt(sum); +- else if (norm == 1) +- sum=1.0/sum; ++ if (norm == 2) ++ sum=1.0/sqrt(sum); ++ else if (norm == 1) ++ sum=1.0/sum; + for (j=ptr[i]; jncon == 1) { + /* return right away if the balance is OK */ +- if (iabs(ntpwgts[0]*graph->tvwgt[0]-graph->pwgts[0]) < 3*graph->tvwgt[0]/graph->nvtxs) ++ if (rabs(ntpwgts[0]*graph->tvwgt[0]-graph->pwgts[0]) < 3*graph->tvwgt[0]/graph->nvtxs) + return; + + if (graph->nbnd > 0) +diff --git a/libmetis/parmetis.c b/libmetis/parmetis.c +index 631d811..418b606 100644 +--- a/libmetis/parmetis.c ++++ b/libmetis/parmetis.c +@@ -308,7 +308,7 @@ void FM_2WayNodeRefine1SidedP(ctrl_t *ctrl, graph_t *graph, + * Get into the FM loop + *******************************************************/ + mptr[0] = nmind = nbad = 0; +- mindiff = abs(pwgts[0]-pwgts[1]); ++ mindiff = iabs(pwgts[0]-pwgts[1]); + for (nswaps=0; nswaps