summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2023-12-21 21:47:03 +0100
committerAlfredo Tupone <tupone@gentoo.org>2023-12-21 21:47:23 +0100
commitd660827b5e0f8a347c5eb59bce5ca11eae1b04ed (patch)
treef4623627c26ec9dc3d942f17c1e07907a864dcb9 /dev-cpp
parentsys-process/systemd-cron: stabilize 2.2.0 for amd64 (diff)
downloadgentoo-d660827b5e0f8a347c5eb59bce5ca11eae1b04ed.tar.gz
gentoo-d660827b5e0f8a347c5eb59bce5ca11eae1b04ed.tar.bz2
gentoo-d660827b5e0f8a347c5eb59bce5ca11eae1b04ed.zip
dev-cpp/xsimd: add 12.1.1
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'dev-cpp')
-rw-r--r--dev-cpp/xsimd/Manifest1
-rw-r--r--dev-cpp/xsimd/files/xsimd-12.1.1-no-march.patch71
-rw-r--r--dev-cpp/xsimd/xsimd-12.1.1.ebuild58
3 files changed, 130 insertions, 0 deletions
diff --git a/dev-cpp/xsimd/Manifest b/dev-cpp/xsimd/Manifest
index 11ae1449e178..70aa1f59c986 100644
--- a/dev-cpp/xsimd/Manifest
+++ b/dev-cpp/xsimd/Manifest
@@ -1 +1,2 @@
DIST xsimd-11.1.0.tar.gz 219350 BLAKE2B 2bbbc4f7dbe489a407fe798b146c008aba44664efc943c2e1507d5c6e7da2a03ed91abf0d872e5abf9bd94be3e76bef276ec5b47d4e356b42a7b4c680bd6f3d9 SHA512 3a6141dfa4d95a977f4222880dfd06197613d153a78a84653022423279eec037ea9def08ae225aba7231c0b2c434ab7c907c965f8367fb0db9b96113980b51f3
+DIST xsimd-12.1.1.tar.gz 253141 BLAKE2B 29efbb045d8ade8737d702a73f3d0a912111dd4fbc84485c0e54c8b06d73edbb4b85f4b51e24da9bed0dea010b0cce9d99b57e20e8b94d3daf90d46031548eb9 SHA512 8e45a8e9b28358d5f20f713ea19a8c366edc62790c27984149f283dfe808d78a549c8ec465e8b3677d7e30b2cb80093908de364bbb9dc80683f5fdfb843131e1
diff --git a/dev-cpp/xsimd/files/xsimd-12.1.1-no-march.patch b/dev-cpp/xsimd/files/xsimd-12.1.1-no-march.patch
new file mode 100644
index 000000000000..c830d584bc54
--- /dev/null
+++ b/dev-cpp/xsimd/files/xsimd-12.1.1-no-march.patch
@@ -0,0 +1,71 @@
+We both want to respect the user's CFLAGS, but also, not all of our arches support
+-march or -mtune.
+--- a/benchmark/CMakeLists.txt
++++ b/benchmark/CMakeLists.txt
+@@ -30,10 +30,6 @@ include(CheckCXXCompilerFlag)
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
+
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+- if(NOT CMAKE_CXX_FLAGS MATCHES "-march" AND NOT CMAKE_CXX_FLAGS MATCHES "-arch" AND NOT CMAKE_OSX_ARCHITECTURES)
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
+- endif()
+-
+ if(NOT MSVC)
+ CHECK_CXX_COMPILER_FLAG("-std=c++11" HAS_CPP11_FLAG)
+ if (ENABLE_XTL_COMPLEX)
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -26,15 +26,6 @@ else()
+ message(STATUS "Tests build type is ${CMAKE_BUILD_TYPE}")
+ endif()
+
+-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+- if (NOT CMAKE_CXX_FLAGS MATCHES "-march" AND NOT CMAKE_CXX_FLAGS MATCHES "-arch" AND NOT CMAKE_OSX_ARCHITECTURES)
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native")
+- endif()
+- if(NOT CMAKE_CXX_COMPILER_ID MATCHES Clang) # We are using clang-cl
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+- endif()
+-endif()
+-
+ add_executable(mandelbrot mandelbrot.cpp ${XSIMD_HEADERS})
+ set_property(TARGET mandelbrot PROPERTY CXX_STANDARD 14)
+ if(ENABLE_XTL_COMPLEX)
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -41,10 +41,6 @@ OPTION(XSIMD_ENABLE_WERROR "Turn on -Werror" OFF)
+
+ OPTION(CROSS_COMPILE_ARM "cross compile for ARM targets" OFF)
+
+-# Note: to compile on ARM (or cross compile), you may need to add the following:
+-# -DTARGET_ARCH="armv8-a -mfpu=neon -mfloat-abi=softfp -target arm-linux-gnueabi"
+-set(TARGET_ARCH "native" CACHE STRING "Target architecture arguments")
+-
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ if (NOT WIN32 AND NOT ANDROID)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-parameter -Wextra -Wreorder")
+@@ -79,10 +75,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
+ include_directories(/usr/${ARM_ARCH_DIRECTORY}/include/c++/${ARM_GCC_VER}/${ARM_ARCH_DIRECTORY}/)
+ include_directories(/usr/${ARM_ARCH_DIRECTORY}/include/c++/${ARM_GCC_VER}/)
+ include_directories(/usr/${ARM_ARCH_DIRECTORY}/include/)
+- if(NOT CMAKE_CXX_FLAGS MATCHES "-march")
+- message(STATUS "SETTING ARCH TO ${TARGET_ARCH}")
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${TARGET_ARCH}")
+- endif()
+ if(ARM_ARCH_DIRECTORY MATCHES "arm-linux-gnueabi")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=softfp -target arm-linux-gnueabi")
+ else ()
+@@ -91,13 +83,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
+ message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+ message(STATUS "CMAKE_CXX_LINK_EXECUTABLE: ${CMAKE_CXX_LINK_EXECUTABLE}")
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${TARGET_ARCH} -mtune=${TARGET_ARCH}")
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64")
+ # Nothing specific
+ elseif(NOT WIN32 AND NOT EMSCRIPTEN)
+- if(NOT CMAKE_CXX_FLAGS MATCHES "-march" AND NOT CMAKE_CXX_FLAGS MATCHES "-arch" AND NOT CMAKE_OSX_ARCHITECTURES)
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${TARGET_ARCH}")
+- endif()
+ endif()
+ endif()
+
diff --git a/dev-cpp/xsimd/xsimd-12.1.1.ebuild b/dev-cpp/xsimd/xsimd-12.1.1.ebuild
new file mode 100644
index 000000000000..36841823861d
--- /dev/null
+++ b/dev-cpp/xsimd/xsimd-12.1.1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C++ wrappers for SIMD intrinsics"
+HOMEPAGE="https://github.com/xtensor-stack/xsimd"
+SRC_URI="https://github.com/xtensor-stack/${PN}/archive/refs/tags/${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="doc test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ doc? (
+ app-doc/doxygen
+ dev-python/breathe
+ dev-python/sphinx
+ dev-python/sphinx-rtd-theme
+ )
+ test? ( dev-cpp/doctest )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-11.1.0-c++17.patch
+ "${FILESDIR}"/${P}-no-march.patch
+)
+
+src_prepare() {
+ sed -i \
+ -e '/fPIC/d' \
+ test/CMakeLists.txt \
+ || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTS=$(usex test)
+ )
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ use doc && emake -C docs html
+}
+
+src_install() {
+ cmake_src_install
+ if use doc; then
+ dodoc -r docs/build/html
+ fi
+}