Update suitesparse (#4515)

* [metis] Small minor portfile improvements

* [suitesparse] Update to version 5.1.2
This commit is contained in:
Arkady Shapkin 2018-10-23 21:03:42 +03:00 committed by Robert Schumacher
parent b0e3843b0d
commit 2884e55e6c
4 changed files with 132 additions and 150 deletions

View File

@ -1,3 +1,3 @@
Source: metis Source: metis
Version: 5.1.0-1 Version: 5.1.0-2
Description: Serial Graph Partitioning and Fill-reducing Matrix Ordering Description: Serial Graph Partitioning and Fill-reducing Matrix Ordering

View File

@ -1,47 +1,50 @@
# Common Ambient Variables: # Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> # VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc) # TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc) # PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} # CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
# #
include(vcpkg_common_functions) include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/metis-5.1.0)
vcpkg_download_distfile(ARCHIVE set(METIS_VERSION 5.1.0)
URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz"
FILENAME "metis-5.1.0.tar.gz" vcpkg_download_distfile(ARCHIVE
SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25 URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-${METIS_VERSION}.tar.gz"
) FILENAME "metis-${METIS_VERSION}.tar.gz"
vcpkg_extract_source_archive(${ARCHIVE}) SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH} vcpkg_extract_source_archive_ex(
PATCHES OUT_SOURCE_PATH SOURCE_PATH
${CMAKE_CURRENT_LIST_DIR}/enable-install.patch ARCHIVE ${ARCHIVE}
${CMAKE_CURRENT_LIST_DIR}/disable-programs.patch REF ${METIS_VERSION}
${CMAKE_CURRENT_LIST_DIR}/fix-runtime-install-destination.patch PATCHES
${CMAKE_CURRENT_LIST_DIR}/fix-metis-vs14-math.patch enable-install.patch
${CMAKE_CURRENT_LIST_DIR}/fix-gklib-vs14-math.patch disable-programs.patch
) fix-runtime-install-destination.patch
fix-metis-vs14-math.patch
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) fix-gklib-vs14-math.patch
set(OPTIONS -DSHARED=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON) )
else()
set(OPTIONS -DSHARED=OFF) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
endif() set(OPTIONS -DSHARED=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON)
else()
vcpkg_configure_cmake( set(OPTIONS -DSHARED=OFF)
SOURCE_PATH ${SOURCE_PATH} endif()
OPTIONS
${OPTIONS} vcpkg_configure_cmake(
) SOURCE_PATH ${SOURCE_PATH}
OPTIONS
vcpkg_install_cmake() ${OPTIONS}
vcpkg_copy_pdbs() )
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_install_cmake()
vcpkg_copy_pdbs()
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/metis) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/metis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/metis/copyright)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/metis)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/metis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/metis/copyright)

View File

@ -1,8 +1,8 @@
Source: suitesparse Source: suitesparse
Version: 4.5.5-4 Version: 5.1.2
Build-Depends: clapack Build-Depends: clapack
Description: algebra library Description: algebra library
Feature: metis Feature: metis
Build-Depends: metis Build-Depends: metis
Description: Use metis in SuiteSparse Description: Use metis in SuiteSparse

View File

@ -1,92 +1,71 @@
# Common Ambient Variables: include(vcpkg_common_functions)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} message(STATUS "Warning: Dynamic building not supported yet. Building static.")
# PORT = current port name (zlib, etc) set(VCPKG_LIBRARY_LINKAGE static)
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) endif()
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) set(SUITESPARSE_VER SuiteSparse-5.1.2) #if you change the version, becarefull of changing the SHA512 checksum accordingly
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> set(SUITESPARSEWIN_VER 1.4.0)
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) set(SUITESPARSEWIN_PATH ${CURRENT_BUILDTREES_DIR}/src/suitesparse-metis-for-windows-${SUITESPARSEWIN_VER})
# set(SUITESPARSE_PATH ${SUITESPARSEWIN_PATH}/Suitesparse)
include(vcpkg_common_functions) #download suitesparse libary
vcpkg_download_distfile(SUITESPARSE
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/${SUITESPARSE_VER}.tar.gz"
message(STATUS "Warning: Dynamic building not supported yet. Building static.") FILENAME "${SUITESPARSE_VER}.tar.gz"
set(VCPKG_LIBRARY_LINKAGE static) SHA512 38c7f9847cf161390f73de39ed3d9fd07f7bcec2d6d4e6f141af6a015826215843db9f2e16ca255eeb233c593ffc19ffa04816aa5b6ba200b55b9472ac33ba85
endif() )
set(SUITESPARSE_VER SuiteSparse-4.5.5) #if you change the version, becarefull of changing the SHA512 checksum accordingly #download suitesparse-metis-for-windows scripts, suitesparse does not have CMake build system, jlblancoc has made one for it
set(SUITESPARSEWIN_PATH ${CURRENT_BUILDTREES_DIR}/src/suitesparse-metis-for-windows-1.3.1) vcpkg_download_distfile(SUITESPARSEWIN
set(SUITESPARSE_PATH ${SUITESPARSEWIN_PATH}/Suitesparse) URLS "https://github.com/jlblancoc/suitesparse-metis-for-windows/archive/v${SUITESPARSEWIN_VER}.zip"
FILENAME "suitesparse-metis-for-windows-${SUITESPARSEWIN_VER}.zip"
#download suitesparse libary SHA512 2859d534200ab9b76fca1530eae5de2f9328aa867c727dbc83a96c6f16e1f87e70123fb2decbb84531d75dac58b6f0ce7323e48c57aeede324fd9a1f77ba74c6
vcpkg_download_distfile(SUITESPARSE )
URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/${SUITESPARSE_VER}.tar.gz"
FILENAME "${SUITESPARSE_VER}.tar.gz" #extract suitesparse-metis-for-windows first and merge with suitesparse library
SHA512 4337c683027efca6c0800815587409db14db7d70df673451e307eb3ece5538815d06d90f3a831fa45071372f70b6f37eaa68fe951f69dbb52a5bfd84d2dc4913 vcpkg_extract_source_archive(${SUITESPARSEWIN})
) vcpkg_extract_source_archive(${SUITESPARSE} ${SUITESPARSEWIN_PATH})
#download suitesparse-metis-for-windows scripts, suitesparse does not have CMake build system, jlblancoc has made one for it vcpkg_apply_patches(
vcpkg_download_distfile(SUITESPARSEWIN SOURCE_PATH ${SUITESPARSEWIN_PATH}
URLS "https://github.com/jlblancoc/suitesparse-metis-for-windows/archive/v1.3.1.zip" PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-suitesparse.patch"
FILENAME "suitesparse-metis-for-windows-1.3.1.zip" PATCHES "${CMAKE_CURRENT_LIST_DIR}/remove-debug-postfix.patch"
SHA512 f8b9377420432f1c0a05bf884fe9e72f1f4eaf7e05663c66a383b5d8ddbd4fbfaa7d433727b4dc3e66b41dbb96b1327d380b68a51a424276465512666e63393d )
)
set(USE_VCPKG_METIS OFF)
#extract suitesparse-metis-for-windows first and merge with suitesparse library if("metis" IN_LIST FEATURES)
vcpkg_extract_source_archive(${SUITESPARSEWIN}) set(USE_VCPKG_METIS ON)
vcpkg_extract_source_archive(${SUITESPARSE} ${SUITESPARSEWIN_PATH}) endif()
vcpkg_apply_patches( vcpkg_configure_cmake(
SOURCE_PATH ${SUITESPARSEWIN_PATH} SOURCE_PATH ${SUITESPARSEWIN_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-suitesparse.patch" PREFER_NINJA
PATCHES "${CMAKE_CURRENT_LIST_DIR}/remove-debug-postfix.patch" OPTIONS
) -DBUILD_METIS=OFF #Disable the option to build metis from source
-DUSE_VCPKG_METIS=${USE_VCPKG_METIS} #Force using vcpckg metis library
set(USE_VCPKG_METIS OFF) -DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}
if("metis" IN_LIST FEATURES) -DLIB_POSTFIX=
set(USE_VCPKG_METIS ON) -DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON
endif() -DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/lib/openblas.lib
-DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/lib/lapack.lib
vcpkg_configure_cmake( OPTIONS_DEBUG
SOURCE_PATH ${SUITESPARSEWIN_PATH} -DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug
PREFER_NINJA OPTIONS_RELEASE
OPTIONS -DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}
-DBUILD_METIS=OFF #Disable the option to build metis from source )
-DUSE_VCPKG_METIS=${USE_VCPKG_METIS} #Force using vcpckg metis library
-DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR} vcpkg_install_cmake()
-DLIB_POSTFIX=
-DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake")
-DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/lib/openblas.lib
-DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/lib/lapack.lib #clean folders
OPTIONS_DEBUG file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug
OPTIONS_RELEASE # Handle copyright of suitesparse and suitesparse-metis-for-windows
-DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} file(COPY ${SUITESPARSE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
) file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright)
vcpkg_install_cmake() file(COPY ${SUITESPARSEWIN_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright_suitesparse-metis-for-windows)
vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")
file(RENAME ${CURRENT_PACKAGES_DIR}/UseSuiteSparse.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/UseSuiteSparse.cmake)
file(RENAME ${CURRENT_PACKAGES_DIR}/SuiteSparseConfig.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/UseSuiteSparse.cmake)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/SuiteSparseConfig.cmake)
# Update paths in SuiteSparseConfig.cmake
file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake _contents)
string(REPLACE "set(SuiteSparse_LIB_POSTFIX \"64\")" "set(SuiteSparse_LIB_POSTFIX \"\")" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake "${_contents}")
#clean folders
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright of suitesparse and suitesparse-metis-for-windows
file(COPY ${SUITESPARSE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright)
file(COPY ${SUITESPARSEWIN_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright_suitesparse-metis-for-windows)