Add port for parmetis

This commit is contained in:
Albert Ziegenhagel 2017-01-11 12:04:38 +01:00
parent b966acc5c2
commit 7197fbb538
6 changed files with 116 additions and 0 deletions

4
ports/parmetis/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: parmetis
Version: 4.0.3
Description: Parallel Graph Partitioning and Fill-reducing Matrix Ordering
Build-Depends: metis, msmpi

View File

@ -0,0 +1,11 @@
--- 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

@ -0,0 +1,15 @@
--- 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

@ -0,0 +1,11 @@
--- 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

@ -0,0 +1,29 @@
--- 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

@ -0,0 +1,46 @@
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/parmetis-4.0.3)
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(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/fix-metis-vs14-math.patch
${CMAKE_CURRENT_LIST_DIR}/fix-gklib-vs14-math.patch
${CMAKE_CURRENT_LIST_DIR}/fix-root-cmakelist.patch
${CMAKE_CURRENT_LIST_DIR}/fix-libparmetis-cmakelist.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(ADDITIONAL_OPTIONS -DSHARED=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON)
else()
set(ADDITIONAL_OPTIONS -DSHARED=OFF)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${ADDITIONAL_OPTIONS}
)
vcpkg_install_cmake()
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)