mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[armadillo,ensmallen] Update (#28599)
* [armadillo] Update to 11.4.3 * Fixup pkgconfig * Add vcpkg cmake wrapper * Update versions * [ensmallen] Update and fix * Add vcpkg version requirement
This commit is contained in:
parent
fbc96bcdf8
commit
0a277597a1
@ -1,60 +0,0 @@
|
||||
diff --git a/cmake_aux/Modules/ARMA_FindARPACK.cmake b/cmake_aux/Modules/ARMA_FindARPACK.cmake
|
||||
index 1a709ad..3029c25 100644
|
||||
--- a/cmake_aux/Modules/ARMA_FindARPACK.cmake
|
||||
+++ b/cmake_aux/Modules/ARMA_FindARPACK.cmake
|
||||
@@ -4,6 +4,10 @@
|
||||
# ARPACK_FOUND - system has ARPACK
|
||||
# ARPACK_LIBRARY - Link this to use ARPACK
|
||||
|
||||
+if(CMAKE_DISABLE_FIND_PACKAGE_ARPACK)
|
||||
+ set(ARPACK_FOUND NO)
|
||||
+ return()
|
||||
+endif()
|
||||
|
||||
find_library(ARPACK_LIBRARY
|
||||
NAMES arpack
|
||||
diff --git a/cmake_aux/Modules/ARMA_FindATLAS.cmake b/cmake_aux/Modules/ARMA_FindATLAS.cmake
|
||||
index 6ad1eee..6dd372e 100644
|
||||
--- a/cmake_aux/Modules/ARMA_FindATLAS.cmake
|
||||
+++ b/cmake_aux/Modules/ARMA_FindATLAS.cmake
|
||||
@@ -1,3 +1,8 @@
|
||||
+if(CMAKE_DISABLE_FIND_PACKAGE_ATLAS)
|
||||
+ set(ATLAS_FOUND NO)
|
||||
+ return()
|
||||
+endif()
|
||||
+
|
||||
set(ATLAS_NAMES)
|
||||
set(ATLAS_NAMES ${ATLAS_NAMES} tatlas)
|
||||
set(ATLAS_NAMES ${ATLAS_NAMES} satlas)
|
||||
diff --git a/cmake_aux/Modules/ARMA_FindMKL.cmake b/cmake_aux/Modules/ARMA_FindMKL.cmake
|
||||
index 38f6675..4702ab4 100644
|
||||
--- a/cmake_aux/Modules/ARMA_FindMKL.cmake
|
||||
+++ b/cmake_aux/Modules/ARMA_FindMKL.cmake
|
||||
@@ -6,6 +6,11 @@
|
||||
## the link below explains why we're linking only with mkl_rt
|
||||
## https://software.intel.com/en-us/articles/a-new-linking-model-single-dynamic-library-mkl_rt-since-intel-mkl-103
|
||||
|
||||
+if(CMAKE_DISABLE_FIND_PACKAGE_MKL)
|
||||
+ set(MKL_FOUND NO)
|
||||
+ return()
|
||||
+endif()
|
||||
+
|
||||
set(MKL_NAMES ${MKL_NAMES} mkl_rt)
|
||||
#set(MKL_NAMES ${MKL_NAMES} mkl_lapack)
|
||||
#set(MKL_NAMES ${MKL_NAMES} mkl_intel_thread)
|
||||
diff --git a/cmake_aux/Modules/ARMA_FindSuperLU5.cmake b/cmake_aux/Modules/ARMA_FindSuperLU5.cmake
|
||||
index 88dcb9c..16a26b8 100644
|
||||
--- a/cmake_aux/Modules/ARMA_FindSuperLU5.cmake
|
||||
+++ b/cmake_aux/Modules/ARMA_FindSuperLU5.cmake
|
||||
@@ -5,6 +5,11 @@
|
||||
# SuperLU_LIBRARY - Link this to use SuperLU
|
||||
# SuperLU_INCLUDE_DIR - directory of SuperLU headers
|
||||
|
||||
+if(CMAKE_DISABLE_FIND_PACKAGE_SuperLU)
|
||||
+ set(SuperLU_FOUND OFF)
|
||||
+ return()
|
||||
+endif()
|
||||
+
|
||||
find_path(SuperLU_INCLUDE_DIR slu_ddefs.h
|
||||
PATHS ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/include /usr/local/include /opt/local/include
|
||||
PATH_SUFFIXES superlu SuperLU ""
|
13
ports/armadillo/cmake-config.patch
Normal file
13
ports/armadillo/cmake-config.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in b/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in
|
||||
index bfe74ac..9caf2c8 100644
|
||||
--- a/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in
|
||||
+++ b/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in
|
||||
@@ -9,7 +9,7 @@ set(ARMADILLO_INCLUDE_DIRS "@ARMADILLO_INCLUDE_DIRS@")
|
||||
set(ARMADILLO_LIBRARY_DIRS "@ARMADILLO_LIB_DIR@")
|
||||
|
||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||
-include("@ARMADILLO_CMAKE_DIR@/ArmadilloLibraryDepends.cmake")
|
||||
+include("${CMAKE_CURRENT_LIST_DIR}/ArmadilloLibraryDepends.cmake")
|
||||
|
||||
# These are IMPORTED targets created by ArmadilloLibraryDepends.cmake
|
||||
set(ARMADILLO_LIBRARIES armadillo)
|
45
ports/armadillo/dependencies.patch
Normal file
45
ports/armadillo/dependencies.patch
Normal file
@ -0,0 +1,45 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index da1ff3a..5a7ede9 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -265,7 +265,6 @@ message(STATUS "*** Looking for external libraries")
|
||||
## Find LAPACK and BLAS libraries, or their optimised versions
|
||||
##
|
||||
|
||||
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/")
|
||||
|
||||
if(APPLE)
|
||||
message(STATUS "Detected macOS")
|
||||
@@ -336,11 +335,16 @@ else()
|
||||
set(FlexiBLAS_FOUND false)
|
||||
endif()
|
||||
|
||||
+ if(0)
|
||||
include(ARMA_FindMKL)
|
||||
include(ARMA_FindOpenBLAS)
|
||||
include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version
|
||||
include(ARMA_FindBLAS)
|
||||
include(ARMA_FindLAPACK)
|
||||
+ else()
|
||||
+ find_package(BLAS REQUIRED)
|
||||
+ find_package(LAPACK REQUIRED)
|
||||
+ endif()
|
||||
|
||||
message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" )
|
||||
message(STATUS " MKL_FOUND = ${MKL_FOUND}" )
|
||||
@@ -503,7 +507,6 @@ if(DETECT_HDF5)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-include(ARMA_FindARPACK)
|
||||
message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}")
|
||||
|
||||
if(ARPACK_FOUND)
|
||||
@@ -511,7 +514,6 @@ if(ARPACK_FOUND)
|
||||
set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY})
|
||||
endif()
|
||||
|
||||
-include(ARMA_FindSuperLU5)
|
||||
message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}")
|
||||
|
||||
if(SuperLU_FOUND)
|
@ -1,13 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c60cd53..855391a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -664,7 +664,7 @@ install(EXPORT ArmadilloLibraryDepends DESTINATION
|
||||
# and install it
|
||||
set(ARMADILLO_INCLUDE_DIRS "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
set(ARMADILLO_LIB_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
-set(ARMADILLO_CMAKE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/Armadillo/CMake")
|
||||
+set(ARMADILLO_CMAKE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/Armadillo")
|
||||
|
||||
|
||||
message(STATUS "Generating '${PROJECT_BINARY_DIR}/InstallFiles/ArmadilloConfig.cmake'")
|
9
ports/armadillo/pkgconfig.patch
Normal file
9
ports/armadillo/pkgconfig.patch
Normal file
@ -0,0 +1,9 @@
|
||||
diff --git a/misc/armadillo.pc.in b/misc/armadillo.pc.in
|
||||
index 27d35bb..1f079a5 100644
|
||||
--- a/misc/armadillo.pc.in
|
||||
+++ b/misc/armadillo.pc.in
|
||||
@@ -7,3 +7,4 @@ URL: http://arma.sourceforge.net
|
||||
Version: @ARMA_VERSION_MAJOR@.@ARMA_VERSION_MINOR@.@ARMA_VERSION_PATCH@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -larmadillo
|
||||
+Requires.private: @REQUIRES_PRIVATE@
|
@ -1,54 +1,52 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
||||
vcpkg_from_sourceforge(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO arma
|
||||
FILENAME "armadillo-11.2.3.tar.xz"
|
||||
SHA512 db3457adbc799c68c928aaf22714598b4b9df91ec83aff33bf2d0096b755bd316d4bae12ac973bf1821759a71f3a58a7dd8dc64cbcb1f53ea2646d8bb0bc9a3b
|
||||
FILENAME "armadillo-${VERSION}.tar.xz"
|
||||
SHA512 3ca620e686487dd3392b30c184be6f7f89eb13a63668f54b3d39cd6d29c7e024423819e948aea01247935ca3bf7b0b0d5f0004dc60395195beb7d14feef484b1
|
||||
PATCHES
|
||||
remove_custom_modules.patch
|
||||
fix-CMakePath.patch
|
||||
add-disable-find-package.patch
|
||||
cmake-config.patch
|
||||
dependencies.patch
|
||||
pkgconfig.patch
|
||||
)
|
||||
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindBLAS.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindLAPACK.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindOpenBLAS.cmake")
|
||||
set(REQUIRES_PRIVATE "")
|
||||
foreach(module IN ITEMS lapack blas)
|
||||
if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/${module}.pc")
|
||||
string(APPEND REQUIRES_PRIVATE " ${module}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
OPTIONS
|
||||
-DDETECT_HDF5=false
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_SuperLU=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ATLAS=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_MKL=ON
|
||||
-DALLOW_FLEXIBLAS_LINUX=OFF
|
||||
-DDETECT_HDF5=OFF
|
||||
"-DREQUIRES_PRIVATE=${REQUIRES_PRIVATE}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME Armadillo CONFIG_PATH share/Armadillo/CMake)
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH share/Armadillo/CMake)
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
"${CURRENT_PACKAGES_DIR}/share/Armadillo/CMake"
|
||||
)
|
||||
|
||||
file(GLOB SHARE_CONTENT "${CURRENT_PACKAGES_DIR}/share/Armadillo")
|
||||
list(LENGTH SHARE_CONTENT SHARE_LEN)
|
||||
if(SHARE_LEN EQUAL 0)
|
||||
file(GLOB SHARE_ARMADILLO_FILES "${CURRENT_PACKAGES_DIR}/share/Armadillo/*")
|
||||
if(SHARE_ARMADILLO_FILES STREQUAL "")
|
||||
# On case sensitive file system there is an extra empty directory created that should be removed
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/Armadillo")
|
||||
endif()
|
||||
|
||||
set(filename "${CURRENT_PACKAGES_DIR}/include/armadillo_bits/config.hpp")
|
||||
if(EXISTS "${filename}")
|
||||
file(READ "${filename}" contents)
|
||||
string(REGEX REPLACE "\n#define ARMA_AUX_LIBS [^\n]*\n" "\n" contents "${contents}")
|
||||
file(WRITE "${filename}" "${contents}")
|
||||
endif()
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/armadillo_bits/config.hpp" "#define ARMA_AUX_LIBS " "#define ARMA_AUX_LIBS //")
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
@ -1,22 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e5dcf54..c60cd53 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -335,13 +335,12 @@ else()
|
||||
else()
|
||||
set(FlexiBLAS_FOUND false)
|
||||
endif()
|
||||
-
|
||||
+
|
||||
+ find_package(BLAS)
|
||||
+ find_package(LAPACK)
|
||||
include(ARMA_FindMKL)
|
||||
- include(ARMA_FindOpenBLAS)
|
||||
include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version
|
||||
- include(ARMA_FindBLAS)
|
||||
- include(ARMA_FindLAPACK)
|
||||
-
|
||||
+
|
||||
message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" )
|
||||
message(STATUS " MKL_FOUND = ${MKL_FOUND}" )
|
||||
message(STATUS " OpenBLAS_FOUND = ${OpenBLAS_FOUND}" )
|
@ -1,4 +1,10 @@
|
||||
The package armadillo provides CMake targets:
|
||||
armadillo provides CMake targets:
|
||||
|
||||
find_package(Armadillo CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE armadillo)
|
||||
|
||||
armadillo is compatible with built-in CMake targets:
|
||||
|
||||
find_package(Armadillo REQUIRED)
|
||||
target_include_directories(main PRIVATE ${ARMADILLO_INCLUDE_DIRS})
|
||||
target_link_libraries(main PRIVATE ${ARMADILLO_LIBRARIES})
|
||||
|
15
ports/armadillo/vcpkg-cmake-wrapper.cmake
Normal file
15
ports/armadillo/vcpkg-cmake-wrapper.cmake
Normal file
@ -0,0 +1,15 @@
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
if("CONFIG" IN_LIST ARGS OR "NO_MODULE" IN_LIST ARGS OR NOT "${ARGS};" MATCHES "^Armadillo;")
|
||||
_find_package(${ARGS})
|
||||
else()
|
||||
list(REMOVE_AT ARGS 0)
|
||||
list(REMOVE_ITEM ARGS "MODULE")
|
||||
_find_package(ARMADILLO ${ARGS} NAMES Armadillo)
|
||||
if(ARMADILLO_FOUND)
|
||||
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION}")
|
||||
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../../include/armadillo_bits/arma_version.hpp" ARMADILLO_VERSION_NAME REGEX "#define ARMA_VERSION_NAME ")
|
||||
string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${ARMADILLO_VERSION_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
cmake_policy(POP)
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "armadillo",
|
||||
"version": "11.2.3",
|
||||
"version": "11.4.3",
|
||||
"description": "Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use",
|
||||
"homepage": "http://arma.sourceforge.net",
|
||||
"license": "Apache-2.0",
|
||||
|
26
ports/ensmallen/dependencies.patch
Normal file
26
ports/ensmallen/dependencies.patch
Normal file
@ -0,0 +1,26 @@
|
||||
diff --git a/CMake/ensmallen-config.cmake.in b/CMake/ensmallen-config.cmake.in
|
||||
index 3a9a93c..a067e08 100644
|
||||
--- a/CMake/ensmallen-config.cmake.in
|
||||
+++ b/CMake/ensmallen-config.cmake.in
|
||||
@@ -1,4 +1,6 @@
|
||||
@PACKAGE_INIT@
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+find_dependency(Armadillo CONFIG)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake)
|
||||
check_required_components(ensmallen)
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 205fe1b..7fcd207 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -57,8 +57,8 @@ if(USE_OPENMP)
|
||||
endif()
|
||||
|
||||
# Find Armadillo and link it.
|
||||
-find_package(Armadillo 9.800.0 REQUIRED)
|
||||
-target_link_libraries(ensmallen INTERFACE Armadillo::Armadillo)
|
||||
+find_package(Armadillo CONFIG REQUIRED)
|
||||
+target_link_libraries(ensmallen INTERFACE armadillo)
|
||||
|
||||
# Set helper variables for creating the version, config and target files.
|
||||
include(CMakePackageConfigHelpers)
|
@ -1,9 +1,12 @@
|
||||
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO mlpack/ensmallen
|
||||
REF bf42276c5a44eed31e5bacec95d166d01d65f9a4 #v2.18.1
|
||||
SHA512 09f96b2f0e0bd34245c34ee727e633bbb3957c2ab8076cfac66f976ba4e327096e2e76fadcc729dfffe73b56348bcc14fa61e3bb59a7ca0e17221f8f4cd0d59c
|
||||
REF "${VERSION}"
|
||||
SHA512 3c101385d75aa13d21406fd98d4220b5ebd88655ff42039d6d4b22e3a2f21f7dc59dc935c67b8178cbfd104c4c50e611bc787f254973c3410a349648b5ed0342
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
dependencies.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
|
@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "ensmallen",
|
||||
"version-semver": "2.18.1",
|
||||
"version-semver": "2.19.0",
|
||||
"description": "A header-only C++ library for mathematical optimization",
|
||||
"homepage": "https://github.com/mlpack/ensmallen",
|
||||
"homepage": "http://ensmallen.org/",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"armadillo",
|
||||
"blas",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "325a64512ffbc2d8bfb94ff44c5a86c55252dc58",
|
||||
"version": "11.4.3",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "b4bc853e4132b3e2f8c13fa5cfc21030daa6d10a",
|
||||
"version": "11.2.3",
|
||||
|
@ -185,7 +185,7 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"armadillo": {
|
||||
"baseline": "11.2.3",
|
||||
"baseline": "11.4.3",
|
||||
"port-version": 0
|
||||
},
|
||||
"arrayfire": {
|
||||
@ -2181,7 +2181,7 @@
|
||||
"port-version": 1
|
||||
},
|
||||
"ensmallen": {
|
||||
"baseline": "2.18.1",
|
||||
"baseline": "2.19.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"entityx": {
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "00de3f8f709bd51bba23d6aa8f01636a1e99f298",
|
||||
"version-semver": "2.19.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "ed0e9e790165bbba1a04b3a8fb6b89c67e1b64f8",
|
||||
"version-semver": "2.18.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user