diff --git a/ports/ensmallen/dependencies.patch b/ports/ensmallen/dependencies.patch index a6d92a15fa..acd097bde5 100644 --- a/ports/ensmallen/dependencies.patch +++ b/ports/ensmallen/dependencies.patch @@ -1,19 +1,36 @@ diff --git a/CMake/ensmallen-config.cmake.in b/CMake/ensmallen-config.cmake.in -index 3a9a93c..a067e08 100644 +index 3a9a93c..7bed7fd 100644 --- a/CMake/ensmallen-config.cmake.in +++ b/CMake/ensmallen-config.cmake.in -@@ -1,4 +1,6 @@ +@@ -1,4 +1,9 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) ++if(@USE_OPENMP@) ++find_dependency(OpenMP) ++endif() +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 +index 551c538..0b20af1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -57,8 +57,8 @@ if(USE_OPENMP) +@@ -47,21 +47,13 @@ endif() + + # Find OpenMP and link it. + if(USE_OPENMP) +- if(NOT TARGET OpenMP::OpenMP_CXX) +- find_package(Threads REQUIRED) +- add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE) +- set_property(TARGET OpenMP::OpenMP_CXX +- PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS}) +- # Only works if the same flag is passed to the linker; use CMake 3.9+ otherwise (Intel, AppleClang). +- set_property(TARGET OpenMP::OpenMP_CXX +- PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads) +- endif() ++ find_package(OpenMP REQUIRED) + target_link_libraries(ensmallen INTERFACE OpenMP::OpenMP_CXX) endif() # Find Armadillo and link it. diff --git a/ports/ensmallen/portfile.cmake b/ports/ensmallen/portfile.cmake index d02e97c519..b7f18ed299 100644 --- a/ports/ensmallen/portfile.cmake +++ b/ports/ensmallen/portfile.cmake @@ -1,24 +1,27 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} +set(VCPKG_BUILD_TYPE release) # header-only + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mlpack/ensmallen REF "${VERSION}" - SHA512 1e86fc28a58694057262a8d036af8080be084c889f7b659b77a08fd4e0957d0f03d8866e47b682a1868b5ac2198cca85c591a334b284096659a123196de95a66 + SHA512 1e86fc28a58694057262a8d036af8080be084c889f7b659b77a08fd4e0957d0f03d8866e47b682a1868b5ac2198cca85c591a334b284096659a123196de95a66 HEAD_REF master PATCHES dependencies.patch ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + openmp USE_OPENMP +) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DBUILD_TESTS=OFF + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_cmake_install() - vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ensmallen) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") -file(INSTALL "${SOURCE_PATH}/COPYRIGHT.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYRIGHT.txt") diff --git a/ports/ensmallen/vcpkg.json b/ports/ensmallen/vcpkg.json index e0090d1027..579b0ca16f 100644 --- a/ports/ensmallen/vcpkg.json +++ b/ports/ensmallen/vcpkg.json @@ -1,13 +1,12 @@ { "name": "ensmallen", "version-semver": "2.21.1", + "port-version": 1, "description": "A header-only C++ library for mathematical optimization", "homepage": "http://ensmallen.org/", "license": "BSD-3-Clause", "dependencies": [ "armadillo", - "blas", - "lapack", { "name": "vcpkg-cmake", "host": true @@ -16,5 +15,16 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "default-features": [ + { + "name": "openmp", + "platform": "!osx" + } + ], + "features": { + "openmp": { + "description": "Enable OpenMP support" + } + } } diff --git a/scripts/ci.feature.baseline.txt b/scripts/ci.feature.baseline.txt index 0cd8f74aa0..cdf94a078d 100644 --- a/scripts/ci.feature.baseline.txt +++ b/scripts/ci.feature.baseline.txt @@ -107,6 +107,7 @@ discord-rpc:x64-uwp=fail dmlc(uwp) = fail eastl:arm-uwp=fail ebml:arm-uwp=fail +ensmallen[openmp](osx) = feature-fails # No openmp on default osx toolchain epsilon(uwp)=fail faiss:arm64-windows=fail fastrtps:arm-uwp=fail diff --git a/versions/baseline.json b/versions/baseline.json index 4c17b99792..a3bc07b0c1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2690,7 +2690,7 @@ }, "ensmallen": { "baseline": "2.21.1", - "port-version": 0 + "port-version": 1 }, "entityx": { "baseline": "1.3.0", diff --git a/versions/e-/ensmallen.json b/versions/e-/ensmallen.json index 0ca23c6a7f..c496d36d2b 100644 --- a/versions/e-/ensmallen.json +++ b/versions/e-/ensmallen.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "48e2f67f2f3818bd40c39e15744009e8a035c63b", + "version-semver": "2.21.1", + "port-version": 1 + }, { "git-tree": "b3a65c226ad563c46413db6e1cde9d39f4684bf9", "version-semver": "2.21.1",