[xtensor] Fix xsimd version mismatch (#33067)

* [xtensor] Fix xsimd version mismatch

* Apply suggestion
This commit is contained in:
Cheney Wang 2023-08-30 03:30:17 +08:00 коммит произвёл GitHub
Родитель bf2dbc58a8
Коммит 2cf957350d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 39 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c93655..f02dc48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,7 +69,12 @@ if(XTENSOR_USE_XSIMD)
message(STATUS "Found xsimd v${xsimd_VERSION}")
endif()
else()
- find_package(xsimd ${xsimd_REQUIRED_VERSION} REQUIRED)
+ find_package(xsimd CONFIG REQUIRED)
+ if(${xsimd_VERSION} GREATER_EQUAL ${xsimd_REQUIRED_VERSION})
+ set(xsimd_REQUIRED_VERSION ${xsimd_VERSION})
+ else()
+ message(ERROR "Mismatch xsimd versions. Found '${xsimd_VERSION}' but requires: '${xsimd_REQUIRED_VERSION}'")
+ endif()
message(STATUS "Found xsimd: ${xsimd_INCLUDE_DIRS}/xsimd")
endif()
endif()
diff --git a/xtensorConfig.cmake.in b/xtensorConfig.cmake.in
index ec72abb..7825612 100644
--- a/xtensorConfig.cmake.in
+++ b/xtensorConfig.cmake.in
@@ -25,7 +25,7 @@ if(NOT TARGET @PROJECT_NAME@)
endif()
if(XTENSOR_USE_XSIMD)
- find_dependency(xsimd @xsimd_REQUIRED_VERSION@)
+ find_dependency(xsimd @xsimd_REQUIRED_VERSION@ CONFIG)
target_link_libraries(@PROJECT_NAME@ INTERFACE xsimd)
target_compile_definitions(@PROJECT_NAME@ INTERFACE XTENSOR_USE_XSIMD)
endif()

Просмотреть файл

@ -8,6 +8,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix-find-tbb-and-install-destination.patch
fix-find-xsimd.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

Просмотреть файл

@ -1,6 +1,7 @@
{
"name": "xtensor",
"version": "0.24.6",
"port-version": 1,
"description": "C++ tensors with broadcasting and lazy computing",
"homepage": "https://github.com/xtensor-stack/xtensor",
"license": "BSD-3-Clause",

Просмотреть файл

@ -8966,7 +8966,7 @@
},
"xtensor": {
"baseline": "0.24.6",
"port-version": 0
"port-version": 1
},
"xtensor-blas": {
"baseline": "0.20.0",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3243d2557778b77adbd7b2dbc83ade2456e8fe5c",
"version": "0.24.6",
"port-version": 1
},
{
"git-tree": "aeb0efc2bdf326191f5dff18bb2506690902b162",
"version": "0.24.6",