Skip to content

Commit

Permalink
Add patches to IDG-1.2.0 and DP3-6.0 for xsimd error on neoverse v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Kok committed Mar 11, 2024
1 parent c3cf0dd commit 1c19ed1
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions easybuild/easyconfigs/d/DP3/DP3-6.0-foss-2023b.eb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ sources = [
}
},
]
patches = ['DP3-6.0_fix-for-xsimd-error-on-neoverse-v1.patch']
checksums = [None]

builddependencies = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- DP3.orig/external/aocommon/CMake/FetchXTensor.cmake 2024-03-11 11:20:32.024804259 +0100
+++ DP3/external/aocommon/CMake/FetchXTensor.cmake 2024-03-11 11:21:32.851493709 +0100
@@ -6,7 +6,7 @@
set(xtl_GIT_TAG b3d0091a77af52f1b479b5b768260be4873aa8a7)
endif()
if (NOT xsimd_GIT_TAG)
- set(xsimd_GIT_TAG 2f5eddf8912c7e2527f0c50895c7560b964d29af)
+ set(xsimd_GIT_TAG 1d8536b393171b899031f01b7c2d63858b05665c)
endif()
if (NOT xtensor_GIT_TAG)
set(xtensor_GIT_TAG 0.24.2)
@@ -65,3 +65,4 @@
endif()

endforeach()
+
1 change: 1 addition & 0 deletions easybuild/easyconfigs/i/IDG/IDG-1.2.0-foss-2023b.eb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sources = [
}
},
]
patches = ['IDG-1.2.0_fix-for-xsimd-error-on-neoverse-v1.patch']
checksums = [None]

builddependencies = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
--- IDG.orig/external/aocommon/CMake/FetchXTensor.cmake 2024-03-11 11:27:53.254059321 +0100
+++ IDG/external/aocommon/CMake/FetchXTensor.cmake 2024-03-11 11:28:41.974412520 +0100
@@ -1,35 +1,68 @@
-#Allow overriding XTensor versions
-if (NOT XTL_GIT_TAG)
- set(XTL_GIT_TAG 0.7.4)
+#Allow overriding XTensor versions, e.g., for testing a new version in DP3.
+#For avoiding ODR violations, repositories that use aocommon should not override
+#these versions in their master branch. That way, the XTensor versions will
+#be equal in all repositories.
+if (NOT xtl_GIT_TAG)
+ set(xtl_GIT_TAG b3d0091a77af52f1b479b5b768260be4873aa8a7)
endif()
-if (NOT XSIMD_GIT_TAG)
- set(XSIMD_GIT_TAG 8.1.0)
+if (NOT xsimd_GIT_TAG)
+ set(xsimd_GIT_TAG 1d8536b393171b899031f01b7c2d63858b05665c)
endif()
-if (NOT XTENSOR_GIT_TAG)
- set(XTENSOR_GIT_TAG 0.24.2)
+if (NOT xtensor_GIT_TAG)
+ set(xtensor_GIT_TAG 0.24.2)
+endif()
+if (NOT xtensor-blas_GIT_TAG)
+ set(xtensor-blas_GIT_TAG 0.20.0)
+endif()
+if (NOT xtensor-fftw_GIT_TAG)
+ set(xtensor-fftw_GIT_TAG e6be85a376624da10629b6525c81759e02020308)
+endif()
+
+# By default, only load the basic 'xtensor' and 'xtl' modules.
+if (NOT XTENSOR_LIBRARIES)
+ set(XTENSOR_LIBRARIES xtl xtensor) # Load xtl first, since xtensor uses it.
endif()

include(FetchContent)

-FetchContent_Declare(
- xtl
- GIT_REPOSITORY https://github.com/xtensor-stack/xtl.git
- GIT_SHALLOW TRUE
- GIT_TAG ${XTL_GIT_TAG})
-FetchContent_Declare(
- xsimd
- GIT_REPOSITORY https://github.com/xtensor-stack/xsimd.git
- GIT_SHALLOW TRUE
- GIT_TAG ${XSMID_GIT_TAG})
-FetchContent_Declare(
- xtensor
- GIT_REPOSITORY https://github.com/xtensor-stack/xtensor.git
- GIT_SHALLOW TRUE
- GIT_TAG ${XTENSOR_GIT_TAG})
-
-# Ensure XTensor headers are included as system headers.
-foreach(LIB xtl;xsimd;xtensor)
- FetchContent_MakeAvailable(${LIB})
- get_target_property(IID ${LIB} INTERFACE_INCLUDE_DIRECTORIES)
- set_target_properties(${LIB} PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${IID}")
-endforeach()
\ No newline at end of file
+foreach(LIB ${XTENSOR_LIBRARIES})
+ set(XT_GIT_TAG "${${LIB}_GIT_TAG}")
+ if (NOT XT_GIT_TAG)
+ message(FATAL_ERROR "Unknown git tag for XTensor library '${LIB}'")
+ endif()
+
+ # Checking out a specific git commit hash does not (always) work when
+ # GIT_SHALLOW is TRUE. See the documentation for GIT_TAG in
+ # https://cmake.org/cmake/help/latest/module/ExternalProject.html
+ # -> If the GIT_TAG is a commit hash, use a non-shallow clone.
+ string(LENGTH "${XT_GIT_TAG}" XT_TAG_LENGTH)
+ set(XT_SHALLOW TRUE)
+ if(XT_TAG_LENGTH EQUAL 40 AND XT_GIT_TAG MATCHES "^[0-9a-f]+$")
+ set(XT_SHALLOW FALSE)
+ endif()
+
+ FetchContent_Declare(
+ ${LIB}
+ GIT_REPOSITORY https://github.com/xtensor-stack/${LIB}.git
+ GIT_SHALLOW ${XT_SHALLOW}
+ GIT_TAG ${XT_GIT_TAG})
+
+ if ("${LIB}" STREQUAL "xtensor-fftw")
+ # Unlike the other libraries, xtensor-fftw does not define a CMake target.
+ # Its CMakeLists.txt also loads FFTW using custom options.
+ # -> Do not build this library, and define an INTERFACE target manually.
+ FetchContent_GetProperties(${LIB})
+ if(NOT ${${LIB}_POPULATED})
+ FetchContent_Populate(${LIB})
+ endif()
+ add_library(${LIB} INTERFACE)
+ target_include_directories(${LIB} SYSTEM INTERFACE "${${LIB}_SOURCE_DIR}/include")
+ else()
+ FetchContent_MakeAvailable(${LIB})
+ # Ensure XTensor headers are included as system headers.
+ get_target_property(IID ${LIB} INTERFACE_INCLUDE_DIRECTORIES)
+ set_target_properties(${LIB} PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${IID}")
+ endif()
+
+endforeach()
+

0 comments on commit 1c19ed1

Please sign in to comment.