[gklib,metis,parmetis] Update sources for metis et al. to GitHub (#26020)

* Remove bogus arguments in the `vcpkg create` template.

* [gklib] Add new port in support of metis and parmetis.

New port checklist:
* Review the code :)
* Check the name against https://repology.org/ There are 2 packages, both of which seem to be the same thing
* Check the name against Bing/Google. It's the first entry.
* Check the source code for optional `find_package`s There are none.
* Check that the versioning scheme and license match what upstream says They have none.
* Check that the source code comes from the upstream project's authoritative source. We did.
* Check that the generated usage is accurate.
* Check that the reported license is accurate. We hope so.

* [metis] Update source to github.

Resolves https://github.com/microsoft/vcpkg/issues/25764

Competes with https://github.com/microsoft/vcpkg/pull/25953

* [parmetis] Update source to github.

* Add licenses.

* Fix GKlib case.

* Fix metis install.
This commit is contained in:
Billy O'Neal 2022-08-03 18:59:36 -07:00 committed by GitHub
parent 42886097a9
commit 63d08e949d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 463 additions and 309 deletions

View File

@ -0,0 +1,87 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cd1b4b..a6b629e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.22)
project(GKlib C)
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
@@ -22,10 +22,12 @@ if(UNIX)
target_link_libraries(GKlib m)
endif(UNIX)
-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})
+install(TARGETS GKlib EXPORT GKlibTargets
+ INCLUDES DESTINATION "include/GKlib"
+ )
+install(FILES ${GKlib_includes} DESTINATION "include/GKlib")
+install(FILES "win32/adapt.h" DESTINATION "include/GKlib/win32")
+install(EXPORT GKlibTargets FILE "GKlibTargets.cmake" DESTINATION "share/GKlib")
+file(WRITE "${CMAKE_INSTALL_PREFIX}/share/GKlib/GKlibConfig.cmake" [=[
+include("${CMAKE_CURRENT_LIST_DIR}/GKlibTargets.cmake")
+]=])
diff --git a/GKlibSystem.cmake b/GKlibSystem.cmake
index d83b208..8019067 100644
--- a/GKlibSystem.cmake
+++ b/GKlibSystem.cmake
@@ -16,7 +16,6 @@ option(GKRAND "enable GKRAND 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")
@@ -34,7 +33,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
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")
+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -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")
@@ -60,7 +59,7 @@ endif(OPENMP)
if(GDB)
set(GKlib_COPTS "${GKlib_COPTS} -g")
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror")
-else()
+elseif(0)
set(GKlib_COPTS "-O3")
endif(GDB)
diff --git a/gk_arch.h b/gk_arch.h
index 8c8ac50..122e087 100644
--- a/gk_arch.h
+++ b/gk_arch.h
@@ -31,9 +31,9 @@
#endif
-#ifdef __MSC__
- #include "ms_stdint.h"
- #include "ms_inttypes.h"
+#ifdef __MSC__
+ #include <stdint.h>
+ #include <inttypes.h>
#include "ms_stat.h"
#include "win32/adapt.h"
#else
@@ -60,9 +60,4 @@ typedef ptrdiff_t ssize_t;
#define PTRDIFF_MAX INT64_MAX
#endif
-/* MSC does not have INFINITY defined */
-#ifndef INFINITY
-#define INFINITY FLT_MAX
-#endif
-
#endif

View File

@ -0,0 +1,25 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KarypisLab/GKlib
REF b1cb3bd7f6bf4da641af901c8d455c0f858c816f
SHA512 e906c7af8b40ce1c4c4ea43cbfca3e3970e5595686333ac9ac80c6cbc558feb0e833f530f034161927030edac5272234c6ac9cad5287cb6edab0c0671ba3644c
PATCHES
build-fixes.patch
)
# Delete files that are workarounds for very old copies of msvc.
file(REMOVE "${SOURCE_PATH}/ms_inttypes.h" "${SOURCE_PATH}/ms_stdint.h")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME GKlib)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" [=[
gklib provides CMake targets:
find_package(GKlib CONFIG REQUIRED)
target_link_libraries(main PRIVATE GKlib)
]=])

17
ports/gklib/vcpkg.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "gklib",
"version-date": "2022-07-27",
"description": "General helper libraries for KarypisLab.",
"homepage": "https://github.com/KarypisLab/GKlib/",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,144 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a15d19a..7210a61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.22)
project(METIS C)
set(SHARED FALSE CACHE BOOL "build a shared library")
-if(MSVC)
+if(0)
set(METIS_INSTALL FALSE)
else()
set(METIS_INSTALL TRUE)
@@ -34,19 +34,13 @@ 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("include")
add_subdirectory("libmetis")
-add_subdirectory("programs")
+
+install(EXPORT metisTargets FILE "metisTargets.cmake" DESTINATION "share/metis")
+file(WRITE "${CMAKE_INSTALL_PREFIX}/share/metis/metisConfig.cmake" [=[
+include(CMakeFindDependencyMacro)
+find_dependency(GKlib CONFIG)
+include("${CMAKE_CURRENT_LIST_DIR}/metisTargets.cmake")
+]=])
diff --git a/conf/gkbuild.cmake b/conf/gkbuild.cmake
index 96435e5..ff43f05 100644
--- a/conf/gkbuild.cmake
+++ b/conf/gkbuild.cmake
@@ -16,7 +16,6 @@ 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")
@@ -38,7 +37,7 @@ endif(VALGRIND)
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")
+ set(GK_COPTIONS "${GK_COPTIONS} -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")
@@ -69,7 +68,7 @@ endif(OPENMP)
if(GDB)
set(GK_COPTS "${GK_COPTS} -g")
set(GK_COPTIONS "${GK_COPTIONS} -Werror")
-else()
+elseif(0)
set(GK_COPTS "-O3")
endif(GDB)
diff --git a/include/metis.h b/include/metis.h
index 7fef0e7..f8e5dcf 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
/*--------------------------------------------------------------------------
@@ -40,7 +40,7 @@
32 : single precission floating point (float)
64 : double precission floating point (double)
--------------------------------------------------------------------------*/
-//#define REALTYPEWIDTH 32
+#define REALTYPEWIDTH 32
@@ -72,10 +72,14 @@ typedef __int64 int64_t;
#define PRId64 "I64d"
#define SCNd32 "ld"
#define SCNd64 "I64d"
+#ifdef _WIN32
+#include <stdint.h>
+#else
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
+#endif // ^^^ !_WIN32
#else
#include <inttypes.h>
#endif
diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt
index fc6cec6..8aeb89a 100644
--- a/libmetis/CMakeLists.txt
+++ b/libmetis/CMakeLists.txt
@@ -6,10 +6,9 @@ file(GLOB metis_sources *.c)
# Build libmetis.
add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources})
+find_package(GKlib CONFIG REQUIRED)
+target_link_libraries(metis PUBLIC GKlib)
+target_include_directories(metis PRIVATE "../include")
-if(METIS_INSTALL)
- install(TARGETS metis
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib
- ARCHIVE DESTINATION lib)
-endif()
+install(TARGETS metis EXPORT metisTargets
+ INCLUDES DESTINATION include)
diff --git a/libmetis/metislib.h b/libmetis/metislib.h
index dc224f4..1efccda 100644
--- a/libmetis/metislib.h
+++ b/libmetis/metislib.h
@@ -31,7 +31,7 @@
#include "proto.h"
-#if defined(COMPILER_MSC)
+#if defined(COMPILER_MSC) && (_MSC_VER < 1900)
#if defined(rint)
#undef rint
#endif

View File

@ -1,8 +0,0 @@
--- a/CMakeLists.txt Wed Dec 21 18:24:22 2016
+++ b/CMakeLists.txt Wed Dec 21 18:24:26 2016
@@ -20,4 +20,4 @@
# Recursively look for CMakeLists.txt in subdirs.
add_subdirectory("include")
add_subdirectory("libmetis")
-add_subdirectory("programs")
+# add_subdirectory("programs")

View File

@ -1,15 +0,0 @@
--- a/CMakeLists.txt Sat Mar 30 17:24:45 2013
+++ b/CMakeLists.txt Wed Dec 21 18:23:43 2016
@@ -4,11 +4,7 @@
set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
set(SHARED FALSE CACHE BOOL "build a shared library")
-if(MSVC)
- set(METIS_INSTALL FALSE)
-else()
- set(METIS_INSTALL TRUE)
-endif()
+set(METIS_INSTALL TRUE)
# Configure libmetis library.
if(SHARED)

View File

@ -1,34 +0,0 @@
diff --git a/include/metis.h b/include/metis.h
index dc5406a..7732437 100644
--- a/include/metis.h
+++ b/include/metis.h
@@ -72,10 +72,14 @@ typedef __int64 int64_t;
#define PRId64 "I64d"
#define SCNd32 "ld"
#define SCNd64 "I64d"
+#ifdef _WIN32
+#include <stdint.h>
+#else
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
+#endif
#else
#include <inttypes.h>
#endif
diff --git a/GKlib/gk_arch.h b/GKlib/gk_arch.h
index 78b1431..7258763 100644
--- a/GKlib/gk_arch.h
+++ b/GKlib/gk_arch.h
@@ -32,8 +32,8 @@
#ifdef __MSC__
- #include "ms_stdint.h"
- #include "ms_inttypes.h"
+ #include <stdint.h>
+ #include <inttypes.h>
#include "ms_stat.h"
#else
#ifndef SUNOS

View File

@ -1,11 +0,0 @@
--- a/GKlib/gk_arch.h Wed Dec 21 18:34:18 2016
+++ b/GKlib/gk_arch.h Wed Dec 21 18:30:49 2016
@@ -58,7 +58,7 @@
#define PTRDIFF_MAX INT64_MAX
#endif
-#ifdef __MSC__
+#if defined(__MSC__) && (_MSC_VER < 1900)
/* MSC does not have rint() function */
#define rint(x) ((int)((x)+0.5))

View File

@ -1,14 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e94f050..b9613a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 2.8)
project(METIS)
-set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
+set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib")
+
set(SHARED FALSE CACHE BOOL "build a shared library")
set(METIS_INSTALL TRUE)

View File

@ -1,11 +0,0 @@
--- a/libmetis/metislib.h Sat Mar 30 17:24:45 2013
+++ b/libmetis/metislib.h Wed Dec 21 18:30:59 2016
@@ -31,7 +31,7 @@
#include <proto.h>
-#if defined(COMPILER_MSC)
+#if defined(COMPILER_MSC) && (_MSC_VER < 1900)
#if defined(rint)
#undef rint
#endif

View File

@ -1,10 +0,0 @@
--- a/libmetis/CMakeLists.txt Sat Mar 30 17:24:45 2013
+++ b/libmetis/CMakeLists.txt Wed Dec 21 17:41:37 2016
@@ -11,6 +11,6 @@
if(METIS_INSTALL)
install(TARGETS metis
LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib
+ RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
endif()

View File

@ -1,44 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9613a7..e43ffee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,3 +22,23 @@ include_directories(include)
add_subdirectory("include")
add_subdirectory("libmetis")
# add_subdirectory("programs")
+
+if(METIS_INSTALL)
+ set(PRJ_NAME metis)
+ set(PRJ_VER 5.1.0)
+ install(EXPORT metisTargets
+ FILE ${PRJ_NAME}Targets.cmake
+ DESTINATION lib/cmake/${PRJ_NAME})
+ include(CMakePackageConfigHelpers)
+ write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/${PRJ_NAME}ConfigVersion.cmake
+ VERSION ${PRJ_VER}
+ COMPATIBILITY SameMajorVersion)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PRJ_NAME}Config.cmake
+ "include(\${CMAKE_CURRENT_LIST_DIR}/${PRJ_NAME}Targets.cmake)")
+ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PRJ_NAME}ConfigVersion.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/${PRJ_NAME}Config.cmake
+ DESTINATION lib/cmake/${PRJ_NAME})
+endif()
+
diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt
index 7a5fc74..5a68cf0 100644
--- a/libmetis/CMakeLists.txt
+++ b/libmetis/CMakeLists.txt
@@ -9,8 +9,9 @@ if(UNIX)
endif()
if(METIS_INSTALL)
- install(TARGETS metis
+ install(TARGETS metis EXPORT metisTargets
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib)
+ ARCHIVE DESTINATION lib
+ INCLUDES DESTINATION include)
endif()

View File

@ -1,41 +1,22 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
set(OPTIONS -DSHARED=OFF)
set(METIS_VERSION 5.1.0)
vcpkg_download_distfile(ARCHIVE
URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-${METIS_VERSION}.tar.gz"
FILENAME "metis-${METIS_VERSION}.tar.gz"
SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${METIS_VERSION}
PATCHES
enable-install.patch
disable-programs.patch
fix-runtime-install-destination.patch
fix-metis-vs14-math.patch
fix-gklib-vs14-math.patch
fix-linux-build-error.patch
install-metisConfig.patch
fix-INT_MIN_define.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/metis)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/metis)
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
REPO KarypisLab/METIS
REF 94c03a6e2d1860128c2d0675cbbb86ad4f261256
SHA512 9f24329fa0f0856d0b5d10a489574d857bc4538d9639055fc895363cf70aa37342eaf7bc08819500ff6d5b98a4aa99f4241880622b540d4c484ca19e693d3480
PATCHES
build-fixes.patch
)
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" [=[
metis provides CMake targets:
find_package(metis CONFIG REQUIRED)
target_link_libraries(main PRIVATE metis)
]=])

View File

@ -1,7 +1,18 @@
{
"name": "metis",
"version-string": "5.1.0",
"port-version": 8,
"version-date": "2022-07-27",
"description": "Serial Graph Partitioning and Fill-reducing Matrix Ordering",
"homepage": "https://glaros.dtc.umn.edu/gkhome/metis/metis/overview"
"homepage": "https://github.com/KarypisLab/METIS",
"license": "Apache-2.0",
"dependencies": [
"gklib",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,98 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 146bc5f..8d6ae23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.22)
project(ParMETIS C)
@@ -24,20 +24,16 @@ include(./conf/gkbuild.cmake)
# 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)
+
+install(EXPORT parmetisTargets FILE "parmetisTargets.cmake" DESTINATION "share/parmetis")
+file(WRITE "${CMAKE_INSTALL_PREFIX}/share/parmetis/parmetisConfig.cmake" [=[
+include(CMakeFindDependencyMacro)
+find_dependency(GKlib CONFIG)
+find_dependency(metis CONFIG)
+include("${CMAKE_CURRENT_LIST_DIR}/parmetisTargets.cmake")
+]=])
diff --git a/conf/gkbuild.cmake b/conf/gkbuild.cmake
index afcafdd..3040b09 100644
--- a/conf/gkbuild.cmake
+++ b/conf/gkbuild.cmake
@@ -15,7 +15,6 @@ 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")
@@ -33,7 +32,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
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")
+ set(GK_COPTIONS "${GK_COPTIONS} -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")
@@ -64,7 +63,7 @@ endif(OPENMP)
if(GDB)
set(GK_COPTS "${GK_COPTS} -g")
set(GK_COPTIONS "${GK_COPTIONS} -Werror")
-else()
+elseif(0)
set(GK_COPTS "-O3")
endif(GDB)
@@ -135,4 +134,3 @@ endif()
# Finally set the official C flags.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GK_COPTIONS} ${GK_COPTS}")
-
diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt
index e8c3213..dcdf64e 100644
--- a/libparmetis/CMakeLists.txt
+++ b/libparmetis/CMakeLists.txt
@@ -4,10 +4,14 @@ include_directories(.)
# Find sources.
file(GLOB parmetis_sources *.c)
+find_package(GKlib CONFIG REQUIRED)
+find_package(metis CONFIG REQUIRED)
+find_package(MPI REQUIRED)
+
# Create libparmetis
add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
-
-install(TARGETS parmetis
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib
- ARCHIVE DESTINATION lib)
+target_link_libraries(parmetis PRIVATE GKlib metis ${MPI_C_LIBRARIES})
+target_include_directories(parmetis PUBLIC ${MPI_C_INCLUDE_DIRS})
+target_include_directories(parmetis PRIVATE "../include")
+install(FILES "../include/parmetis.h" DESTINATION "include")
+install(TARGETS parmetis EXPORT parmetisTargets INCLUDES DESTINATION include)

View File

@ -1,11 +0,0 @@
--- a/metis/GKlib/gk_arch.h Wed Dec 21 18:34:18 2016
+++ b/metis/GKlib/gk_arch.h Wed Dec 21 18:30:49 2016
@@ -58,7 +58,7 @@
#define PTRDIFF_MAX INT64_MAX
#endif
-#ifdef __MSC__
+#if defined(__MSC__) && (_MSC_VER < 1900)
/* MSC does not have rint() function */
#define rint(x) ((int)((x)+0.5))

View File

@ -1,15 +0,0 @@
--- a/libparmetis/CMakeLists.txt Sat Mar 30 17:24:50 2013
+++ b/libparmetis/CMakeLists.txt Wed Dec 21 19:40:28 2016
@@ -5,10 +5,10 @@
# Create libparmetis
add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
# Link with metis and MPI libraries.
-target_link_libraries(parmetis metis ${MPI_LIBRARIES})
+target_link_libraries(parmetis ${METIS_LIBRARY} ${MPI_LIBRARIES})
set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
install(TARGETS parmetis
LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib
+ RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)

View File

@ -1,11 +0,0 @@
--- a/metis/libmetis/metislib.h Sat Mar 30 17:24:45 2013
+++ b/metis/libmetis/metislib.h Wed Dec 21 18:30:59 2016
@@ -31,7 +31,7 @@
#include <proto.h>
-#if defined(COMPILER_MSC)
+#if defined(COMPILER_MSC) && (_MSC_VER < 1900)
#if defined(rint)
#undef rint
#endif

View File

@ -1,18 +0,0 @@
--- a/CMakeLists.txt 2013-03-30 17:24:50.000000000 +0100
+++ b/CMakeLists.txt 2021-04-20 10:41:49.946801222 +0200
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 2.8)
project(ParMETIS)
-set(GKLIB_PATH METIS/GKlib CACHE PATH "path to GKlib")
-set(METIS_PATH METIS CACHE PATH "path to METIS")
+set(GKLIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/metis/GKlib CACHE PATH "path to GKlib")
+set(METIS_PATH metis CACHE PATH "path to METIS")
# Symlink ./metis to wherever metis is. This allows files to be
# included from metis/libmetis/.
-execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${METIS_PATH} metis)
+#execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${METIS_PATH} metis)
# Search for MPI.
# GK commented this out as it seems to be creating problems

View File

@ -1,29 +0,0 @@
--- a/CMakeLists.txt Sat Mar 30 17:24:50 2013
+++ b/CMakeLists.txt Wed Dec 21 19:38:12 2016
@@ -16,6 +16,9 @@
# endif()
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}")
+find_package(MPI REQUIRED)
+find_library(METIS_LIBRARY NAMES metis)
+
# Prepare libraries.
if(SHARED)
set(ParMETIS_LIBRARY_TYPE SHARED)
@@ -30,13 +33,13 @@
include_directories(include)
include_directories(${MPI_INCLUDE_PATH})
include_directories(${GKLIB_PATH})
-include_directories(${METIS_PATH}/include)
+# include_directories(${METIS_PATH}/include)
# List of directories that cmake will look for CMakeLists.txt
-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
+# add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
add_subdirectory(include)
add_subdirectory(libparmetis)
-add_subdirectory(programs)
+# add_subdirectory(programs)
# This is for testing during development and is not being distributed
#add_subdirectory(test)

View File

@ -1,36 +1,27 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
set(ADDITIONAL_OPTIONS -DSHARED=OFF)
vcpkg_download_distfile(ARCHIVE
URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz"
FILENAME "parmetis-4.0.3.tar.gz"
SHA512 454a91921ca35c981df11c9846a11963ff8fd8407a25179453af33f8fe69493f6dd7f2a0b8feed9a7d3f121e45b715749dd7a94873eaac2bae4cad1e535ca132
)
vcpkg_extract_source_archive_ex(
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REPO KarypisLab/ParMETIS
REF 44fadbf58c71a74b39abb110a7691355d2a760ca
SHA512 d07e2ccb358948b728be3d282841ad42a8358908a4f1ab3342d4c3016e71a06c1b5966640a06e713f4c773365d7dba4f0c68795d615802f3af07194c0778f362
PATCHES
fix-metis-vs14-math.patch
fix-gklib-vs14-math.patch
fix-root-cmakelist.patch
fix-libparmetis-cmakelist.patch
use_stdint.patch
fix-root-cmakelist-2.patch
build-fixes.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${ADDITIONAL_OPTIONS}
-DSHARED=OFF
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/parmetis)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/parmetis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/parmetis/copyright)
vcpkg_cmake_config_fixup()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" [=[
parmetis provides CMake targets:
find_package(parmetis CONFIG REQUIRED)
target_link_libraries(main PRIVATE parmetis)
]=])

View File

@ -1,11 +1,19 @@
{
"name": "parmetis",
"version-string": "4.0.3",
"port-version": 5,
"version-date": "2022-07-27",
"description": "Parallel Graph Partitioning and Fill-reducing Matrix Ordering",
"homepage": "https://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview",
"license": null,
"dependencies": [
"metis",
"mpi"
"mpi",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -78,7 +78,7 @@ vcpkg_cmake_install()
# "name": "vcpkg-cmake-config",
# "host": true
#}
# vcpkg_cmake_config_fixup(CONFIG_PATH cmake TARGET_PATH share/@PORT@)
# vcpkg_cmake_config_fixup()
# Uncomment the line below if necessary to install the license file for the port
# as a file named `copyright` to the directory `${CURRENT_PACKAGES_DIR}/share/${PORT}`

View File

@ -2560,6 +2560,10 @@
"baseline": "1.4.0",
"port-version": 1
},
"gklib": {
"baseline": "2022-07-27",
"port-version": 0
},
"gl2ps": {
"baseline": "1.4.2",
"port-version": 1
@ -4561,8 +4565,8 @@
"port-version": 0
},
"metis": {
"baseline": "5.1.0",
"port-version": 8
"baseline": "2022-07-27",
"port-version": 0
},
"metrohash": {
"baseline": "1.1.3",
@ -5405,8 +5409,8 @@
"port-version": 2
},
"parmetis": {
"baseline": "4.0.3",
"port-version": 5
"baseline": "2022-07-27",
"port-version": 0
},
"parquet": {
"baseline": "0",

9
versions/g-/gklib.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "1f3a1ab0a9e1fe871e03b766ea7dbf8b10f54658",
"version-date": "2022-07-27",
"port-version": 0
}
]
}

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1a8b82dc534499155aca4057cb5ee998da7cdbc4",
"version-date": "2022-07-27",
"port-version": 0
},
{
"git-tree": "f3670208e9dc0b726c3c009e37f2398b7f2acca3",
"version-string": "5.1.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e16a0bdc9bfe506f67b8204e5f725faa6a026c4c",
"version-date": "2022-07-27",
"port-version": 0
},
{
"git-tree": "28d903df01ef4780a7b02c8a8437ec37be859aba",
"version-string": "4.0.3",