From 1b0252ca70ca2244a711535462c7f981eb439e83 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 Aug 2022 22:02:53 +0200 Subject: [PATCH] [isal] Update port to 2.30.0 (#26198) * CI test isal, not spdk-isal * Update to 2.30.0 * The nmake build uses only nasm The autotools build chooses the tool by feature level. It even requires yasm for mingw. * Relax platform restriction * Fix mingw builds * Fixup pkgconfig * Rewrite CMake config, move to unofficial namespace * Update versions --- ports/isal/fix-nmake.patch | 13 ---- ports/isal/isalConfig.cmake | 82 ++++--------------------- ports/isal/osx-asm-sysroot.patch | 32 ++++++++++ ports/isal/portfile.cmake | 50 ++++++++++----- ports/isal/unofficial-isal-config.cmake | 18 ++++++ ports/isal/usage | 6 +- ports/isal/vcpkg.json | 5 +- scripts/ci.baseline.txt | 4 +- versions/baseline.json | 4 +- versions/i-/isal.json | 5 ++ 10 files changed, 111 insertions(+), 108 deletions(-) delete mode 100644 ports/isal/fix-nmake.patch create mode 100644 ports/isal/osx-asm-sysroot.patch create mode 100644 ports/isal/unofficial-isal-config.cmake diff --git a/ports/isal/fix-nmake.patch b/ports/isal/fix-nmake.patch deleted file mode 100644 index ba10a66e7a..0000000000 --- a/ports/isal/fix-nmake.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Makefile.nmake b/Makefile.nmake -index 56ae888..7260785 100644 ---- a/Makefile.nmake -+++ b/Makefile.nmake -@@ -143,7 +143,7 @@ objs = \ - - INCLUDES = -I./ -Ierasure_code/ -Iraid/ -Icrc/ -Iigzip/ -Iinclude/ -Imem/ - LINKFLAGS = /nologo --CFLAGS = -O2 -D NDEBUG /nologo -D_USE_MATH_DEFINES -Qstd=c99 $(INCLUDES) $(D) -+CFLAGS = /nologo -D_USE_MATH_DEFINES -Qstd=c99 $(INCLUDES) $(D) - AFLAGS = -f win64 $(INCLUDES) $(D) - CC = icl - AS = yasm diff --git a/ports/isal/isalConfig.cmake b/ports/isal/isalConfig.cmake index 465bbea88f..78b47f223d 100644 --- a/ports/isal/isalConfig.cmake +++ b/ports/isal/isalConfig.cmake @@ -1,73 +1,15 @@ +message(WARNING "'find_package(isal CONFIG)' is deprecated. Please use 'find_package(unofficial-isal CONFIG)' instead.") -function(set_library_target) - cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAMESPACE;LIB_NAME;DEBUG_STATIC;RELEASE_STATIC;DEBUG_DYNAMIC;RELEASE_DYNAMIC;INCLUDE_DIR;TYPE" "") - - if (arg_DEBUG_DYNAMIC) - set(ISAL_PROPERTIES IMPORTED_LOCATION_DEBUG "${arg_DEBUG_DYNAMIC}" IMPORTED_IMPLIB_DEBUG "${arg_DEBUG_STATIC}") - else() - set(ISAL_PROPERTIES IMPORTED_LOCATION_DEBUG "${arg_DEBUG_STATIC}") - endif() - - if (arg_RELEASE_DYNAMIC) - set(ISAL_PROPERTIES IMPORTED_LOCATION_RELEASE "${arg_RELEASE_DYNAMIC}" IMPORTED_IMPLIB_DEBUG "${arg_RELEASE_STATIC}") - else() - set(ISAL_PROPERTIES IMPORTED_LOCATION_RELEASE "${arg_RELEASE_STATIC}") - endif() - - add_library(${arg_NAMESPACE}::${arg_LIB_NAME} ${arg_TYPE} IMPORTED) - set_target_properties(${arg_NAMESPACE}::${arg_LIB_NAME} PROPERTIES - IMPORTED_CONFIGURATIONS "RELEASE;DEBUG" - ${ISAL_PROPERTIES} - INTERFACE_INCLUDE_DIRECTORIES "${arg_INCLUDE_DIR}" - ) - - set(${NAMESPACE}_${LIB_NAME}_FOUND 1) -endfunction() - -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) - -if (WIN32) - if ("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") - set_library_target( - NAMESPACE "ISAL" - LIB_NAME "isa-l" - DEBUG_STATIC "${_IMPORT_PREFIX}/debug/lib/isa-l_static.lib" - RELEASE_STATIC "${_IMPORT_PREFIX}/lib/isa-l_static.lib" - INCLUDE_DIR "${_IMPORT_PREFIX}/include/isal" - TYPE STATIC - ) - else() - set_library_target( - NAMESPACE "ISAL" - LIB_NAME "isal" - DEBUG_DYNAMIC "${_IMPORT_PREFIX}/debug/bin/isa-l.dll" - RELEASE_DYNAMIC "${_IMPORT_PREFIX}/bin/isa-l.dll" - DEBUG_STATIC "${_IMPORT_PREFIX}/debug/lib/isa-l.lib" - RELEASE_STATIC "${_IMPORT_PREFIX}/lib/isa-l.lib" - INCLUDE_DIR "${_IMPORT_PREFIX}/include/isal" - TYPE SHARED - ) - endif() +include(CMakeFindDependencyMacro) +find_dependency(unofficial-isal) +if(NOT TARGET unofficial::isal::isal) + set(isal_FOUND FALSE) +elseif(TARGET ISAL::isa-l OR TARGET ISAL::isal) + # done +elseif ("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + add_library(ISAL::isa-l INTERFACE IMPORTED) + set_target_properties(ISAL::isa-l PROPERTIES INTERFACE_LINK_LIBRARIES unofficial::isal::isal) else() - if ("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") - set_library_target( - NAMESPACE "ISAL" - LIB_NAME "isa-l" - DEBUG_STATIC "${_IMPORT_PREFIX}/debug/lib/libisal.a" - RELEASE_STATIC "${_IMPORT_PREFIX}/lib/libisal.a" - INCLUDE_DIR "${_IMPORT_PREFIX}/include" - TYPE STATIC - ) - else() - set_library_target( - NAMESPACE "ISAL" - LIB_NAME "isal" - DEBUG_DYNAMIC "${_IMPORT_PREFIX}/debug/lib/libisal.so" - RELEASE_DYNAMIC "${_IMPORT_PREFIX}/lib/libisal.so" - INCLUDE_DIR "${_IMPORT_PREFIX}/include" - TYPE SHARED - ) - endif() + add_library(ISAL::isal INTERFACE IMPORTED) + set_target_properties(ISAL::isal PROPERTIES INTERFACE_LINK_LIBRARIES unofficial::isal::isal) endif() diff --git a/ports/isal/osx-asm-sysroot.patch b/ports/isal/osx-asm-sysroot.patch new file mode 100644 index 0000000000..ece55e80cd --- /dev/null +++ b/ports/isal/osx-asm-sysroot.patch @@ -0,0 +1,32 @@ +diff --git a/tools/nasm-filter.sh b/tools/nasm-filter.sh +index 5ec9ba3..fcc4971 100755 +--- a/tools/nasm-filter.sh ++++ b/tools/nasm-filter.sh +@@ -15,6 +15,11 @@ while [ -n "$*" ]; do + shift + shift + ;; ++ -isysroot ) ++ # Unsupported options with arg ++ shift ++ shift ++ ;; + --prefix* ) + # Supported options without arg + options="$options $1" +diff --git a/tools/yasm-filter.sh b/tools/yasm-filter.sh +index c33952a..b99bfc3 100755 +--- a/tools/yasm-filter.sh ++++ b/tools/yasm-filter.sh +@@ -10,6 +10,11 @@ while [ -n "$*" ]; do + shift + shift + ;; ++ -isysroot ) ++ # Unsupported options with arg ++ shift ++ shift ++ ;; + -I* | -i* | --prefix* ) + # Supported options without arg + options="$options $1" diff --git a/ports/isal/portfile.cmake b/ports/isal/portfile.cmake index 1b786f6c93..9a9a1ef347 100644 --- a/ports/isal/portfile.cmake +++ b/ports/isal/portfile.cmake @@ -4,22 +4,21 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO 01org/isa-l - REF v2.25.0 - SHA512 aa556c8ba26b4637493b3de50a23636668bcfd71249029c52fe6983d0bcf120d1b91f39aaa259cb58e59448d401366f3bfaaee24609db7e6a1cd3fdf1a953efe + REPO intel/isa-l + REF v2.30.0 + SHA512 d3ecfb7326097534b06a74b584100336509525ae7cadc6112d0c27e3d8704f3810e18f583d3cc33fa266bfec96db023607622b22ddbf17988ec4bf1bb3b3b9b2 HEAD_REF master - PATCHES fix-nmake.patch + PATCHES + osx-asm-sysroot.patch ) -vcpkg_find_acquire_program(YASM) -get_filename_component(YASM_PATH ${YASM} DIRECTORY) -vcpkg_add_to_path("${YASM_PATH}") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + vcpkg_find_acquire_program(NASM) + get_filename_component(NASM_PATH "${NASM}" DIRECTORY) + vcpkg_add_to_path("${NASM_PATH}") +endif() -vcpkg_find_acquire_program(NASM) -get_filename_component(NASM_PATH ${NASM} DIRECTORY) -vcpkg_add_to_path("${NASM_PATH}") - -if (VCPKG_TARGET_IS_WINDOWS) +if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(NMAKE_TARGET dll) else() @@ -30,7 +29,8 @@ if (VCPKG_TARGET_IS_WINDOWS) SOURCE_PATH "${SOURCE_PATH}" PROJECT_NAME Makefile.nmake TARGET ${NMAKE_TARGET} - OPTIONS CC=cl + OPTIONS + CFLAGS_REL= ) if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") @@ -56,16 +56,36 @@ if (VCPKG_TARGET_IS_WINDOWS) file(GLOB ISAL_HDRS "${SOURCE_PATH}/include/*") file(INSTALL ${ISAL_HDRS} DESTINATION "${CURRENT_PACKAGES_DIR}/include/isal") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/isa-l.def" DESTINATION "${CURRENT_PACKAGES_DIR}/include/isal") + else() + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_PATH "${NASM}" DIRECTORY) + vcpkg_add_to_path("${YASM_PATH}") + endif() + + vcpkg_list(SET options) + if(VCPKG_TARGET_IS_MINGW) + # There is only a .def file used by nmake, no declspec(...) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + # isal forces yasm for mingw, but stumbles over feature level detection + vcpkg_list(APPEND options AS=) + endif() + vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + # No rpl_malloc provided, and probably not depending on ‘malloc (0)’ returning a valid pointer + ac_cv_func_malloc_0_nonnull=yes ) - vcpkg_install_make() + vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") endif() -configure_file("${CMAKE_CURRENT_LIST_DIR}/isalConfig.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/isalConfig.cmake" @ONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-isal-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-isal/unofficial-isal-config.cmake" @ONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/isalConfig.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/isalConfig.cmake" @ONLY) # legacy file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/isal/unofficial-isal-config.cmake b/ports/isal/unofficial-isal-config.cmake new file mode 100644 index 0000000000..6d38fe8215 --- /dev/null +++ b/ports/isal/unofficial-isal-config.cmake @@ -0,0 +1,18 @@ +if(NOT TARGET unofficial::isal::isal) + add_library(unofficial::isal::isal UNKNOWN IMPORTED) + get_filename_component(z_vcpkg_isal_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component(z_vcpkg_isal_prefix "${z_vcpkg_isal_prefix}" PATH) + get_filename_component(z_vcpkg_isal_prefix "${z_vcpkg_isal_prefix}" PATH) + find_library(Z_VCPKG_ISAL_LIBRARY_RELEASE NAMES isal isa-l_static isa-l PATHS "${z_vcpkg_isal_prefix}/lib" NO_DEFAULT_PATH REQUIRED) + set_target_properties(unofficial::isal::isal PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${z_vcpkg_isal_prefix}/include" + IMPORTED_CONFIGURATIONS RELEASE + IMPORTED_LOCATION_RELEASE "${Z_VCPKG_ISAL_LIBRARY_RELEASE}" + ) + if("@VCPKG_BUILD_TYPE@" STREQUAL "") + find_library(Z_VCPKG_ISAL_LIBRARY_DEBUG NAMES isal isa-l_static isa-l PATHS "${z_vcpkg_isal_prefix}/debug/lib" NO_DEFAULT_PATH REQUIRED) + set_property(TARGET unofficial::isal::isal APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(unofficial::isal::isal PROPERTIES IMPORTED_LOCATION_DEBUG "${Z_VCPKG_ISAL_LIBRARY_DEBUG}") + endif() + unset(z_vcpkg_isal_prefix) +endif() diff --git a/ports/isal/usage b/ports/isal/usage index befe62e9f0..1bcbccccd2 100644 --- a/ports/isal/usage +++ b/ports/isal/usage @@ -1,4 +1,4 @@ -The package isal is compatible with built-in CMake targets: +The package isal provides CMake targets: - find_package(isal CONFIG REQUIRED) - target_link_libraries(main PRIVATE $,ISAL::isa-l,ISAL::isal>) + find_package(unofficial-isal CONFIG REQUIRED) + target_link_libraries(main unofficial::isal::isal) diff --git a/ports/isal/vcpkg.json b/ports/isal/vcpkg.json index 24e322b5f6..8052408e44 100644 --- a/ports/isal/vcpkg.json +++ b/ports/isal/vcpkg.json @@ -1,9 +1,8 @@ { "name": "isal", - "version": "2.25.0", - "port-version": 3, + "version": "2.30.0", "description": "Intel(R) Intelligent Storage Acceleration Library", "homepage": "https://github.com/intel/isa-l", "license": "BSD-3-Clause", - "supports": "!(x86 | arm | uwp | osx)" + "supports": "!uwp & (x64 | (arm64 & linux))" } diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 35c7103040..dfbf59cf95 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -383,8 +383,6 @@ intel-mkl:x86-windows=fail irrlicht:arm64-windows=fail irrlicht:arm-uwp=fail irrlicht:x64-uwp=fail -# Conflict with spdk-isal -isal:x64-linux=skip jemalloc:arm64-windows=fail jemalloc:arm-uwp=fail jemalloc:x64-osx=fail @@ -1076,6 +1074,8 @@ spdk-ipsec:x64-windows=fail spdk-ipsec:x64-windows-static=fail spdk-ipsec:x64-windows-static-md=fail spdk-ipsec:x86-windows=fail +# Conflict with isal, and "internal" dep of spdk:x64-linux=fail +spdk-isal:x64-linux=skip spirv-tools:arm-uwp=fail spirv-tools:x64-uwp=fail stormlib:arm-uwp=fail diff --git a/versions/baseline.json b/versions/baseline.json index 80346e0d37..1e456d238a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3061,8 +3061,8 @@ "port-version": 0 }, "isal": { - "baseline": "2.25.0", - "port-version": 3 + "baseline": "2.30.0", + "port-version": 0 }, "ismrmrd": { "baseline": "1.5.0", diff --git a/versions/i-/isal.json b/versions/i-/isal.json index f6337b0b97..978fd2dc33 100644 --- a/versions/i-/isal.json +++ b/versions/i-/isal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "182dacba1a91116c56c83ede14decd8879b86cf7", + "version": "2.30.0", + "port-version": 0 + }, { "git-tree": "7fa8499c557c19920d80318d9a1999922cd28663", "version": "2.25.0",