From fb9474ee913ab9a162f322253b3819b09ae025fd Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Tue, 15 Oct 2024 20:39:46 +0200 Subject: [PATCH 1/2] deps: update noa to 837e1ff981f8df45d9e2977a50f5da61d8affed4 Signed-off-by: Tony Gorez --- DEPENDENCIES | 2 +- vendor/noa/cmake/noa/compiler/options.cmake | 24 +++++++++++++- vendor/noa/cmake/noa/library.cmake | 36 +++++++++++++++++---- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index b32f0e29..d52cb1e7 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,5 +1,5 @@ vendorpull https://github.com/sourcemeta/vendorpull 70342aaf458e6cb80baeb5b718901075fc42ede6 -noa https://github.com/sourcemeta/noa 517e88aef5981b88ac6bb8caff15d17dffcb4320 +noa https://github.com/sourcemeta/noa 837e1ff981f8df45d9e2977a50f5da61d8affed4 jsontoolkit https://github.com/sourcemeta/jsontoolkit 9abbaee71e9e00e95632858d29c7ebe5c2a723b0 bearssl https://www.bearssl.org/git/BearSSL 8ef7680081c61b486622f2d983c0d3d21e83caad zlib https://github.com/madler/zlib 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf diff --git a/vendor/noa/cmake/noa/compiler/options.cmake b/vendor/noa/cmake/noa/compiler/options.cmake index b1fc6e53..dde90f21 100644 --- a/vendor/noa/cmake/noa/compiler/options.cmake +++ b/vendor/noa/cmake/noa/compiler/options.cmake @@ -42,6 +42,10 @@ function(noa_add_default_options visibility target) -Winvalid-offsetof -funroll-loops -fstrict-aliasing + -ftree-vectorize + + # To improve how much GCC/Clang will vectorize + -fno-math-errno # Assume that signed arithmetic overflow of addition, subtraction and # multiplication wraps around using twos-complement representation @@ -78,10 +82,28 @@ function(noa_add_default_options visibility target) -fslp-vectorize) elseif(NOA_COMPILER_GCC) target_compile_options("${target}" ${visibility} + -fno-trapping-math # Newer versions of GCC (i.e. 14) seem to print a lot of false-positives here -Wno-dangling-reference - + # GCC seems to print a lot of false-positives here + -Wno-free-nonheap-object # Disables runtime type information -fno-rtti) endif() endfunction() + +# For studying failed vectorization results +# - On Clang , seems to only take effect on release shared builds +# - On GCC, seems to only take effect on release shared builds +function(noa_add_vectorization_diagnostics target) + if(NOA_COMPILER_LLVM) + # See https://llvm.org/docs/Vectorizers.html#id6 + target_compile_options("${target}" PRIVATE + -Rpass-analysis=loop-vectorize + -Rpass-missed=loop-vectorize) + elseif(NOA_COMPILER_GCC) + target_compile_options("${target}" PRIVATE + -fopt-info-vec-missed + -fopt-info-loop-missed) + endif() +endfunction() diff --git a/vendor/noa/cmake/noa/library.cmake b/vendor/noa/cmake/noa/library.cmake index 05d57748..9868714d 100644 --- a/vendor/noa/cmake/noa/library.cmake +++ b/vendor/noa/cmake/noa/library.cmake @@ -1,6 +1,6 @@ function(noa_library) cmake_parse_arguments(NOA_LIBRARY "" - "NAMESPACE;PROJECT;NAME;FOLDER" "PRIVATE_HEADERS;SOURCES" ${ARGN}) + "NAMESPACE;PROJECT;NAME;FOLDER;VARIANT" "PRIVATE_HEADERS;SOURCES" ${ARGN}) if(NOT NOA_LIBRARY_PROJECT) message(FATAL_ERROR "You must pass the project name using the PROJECT option") @@ -18,7 +18,11 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() - set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") + if(NOT NOA_LIBRARY_VARIANT) + set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") + else() + set(PUBLIC_HEADER "../${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") + endif() if(NOA_LIBRARY_SOURCES) set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") @@ -38,6 +42,11 @@ function(noa_library) set(ALIAS_NAME "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}") endif() + if(NOA_LIBRARY_VARIANT) + set(TARGET_NAME "${TARGET_NAME}_${NOA_LIBRARY_VARIANT}") + set(ALIAS_NAME "${ALIAS_NAME}::${NOA_LIBRARY_VARIANT}") + endif() + if(NOA_LIBRARY_SOURCES) add_library(${TARGET_NAME} ${PUBLIC_HEADER} ${ABSOLUTE_PRIVATE_HEADERS} ${NOA_LIBRARY_SOURCES}) @@ -50,23 +59,34 @@ function(noa_library) add_library(${ALIAS_NAME} ALIAS ${TARGET_NAME}) + if(NOT NOA_LIBRARY_VARIANT) + set(include_dir "${CMAKE_CURRENT_SOURCE_DIR}/include") + else() + set(include_dir "${CMAKE_CURRENT_SOURCE_DIR}/../include") + endif() if(NOA_LIBRARY_SOURCES) target_include_directories(${TARGET_NAME} PUBLIC - "$" + "$" "$") else() target_include_directories(${TARGET_NAME} INTERFACE - "$" + "$" "$") endif() if(NOA_LIBRARY_SOURCES) + if(NOA_LIBRARY_VARIANT) + set(export_name "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}::${NOA_LIBRARY_VARIANT}") + else() + set(export_name "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}") + endif() + set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME} PUBLIC_HEADER "${PUBLIC_HEADER}" PRIVATE_HEADER "${ABSOLUTE_PRIVATE_HEADERS}" - EXPORT_NAME "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}" + EXPORT_NAME "${export_name}" FOLDER "${NOA_LIBRARY_FOLDER}") else() set_target_properties(${TARGET_NAME} @@ -93,7 +113,7 @@ function(noa_library) endfunction() function(noa_library_install) - cmake_parse_arguments(NOA_LIBRARY "" "NAMESPACE;PROJECT;NAME" "" ${ARGN}) + cmake_parse_arguments(NOA_LIBRARY "" "NAMESPACE;PROJECT;NAME;VARIANT" "" ${ARGN}) if(NOT NOA_LIBRARY_PROJECT) message(FATAL_ERROR "You must pass the project name using the PROJECT option") @@ -114,6 +134,10 @@ function(noa_library_install) set(NAMESPACE_PREFIX "") endif() + if(NOA_LIBRARY_VARIANT) + set(TARGET_NAME "${TARGET_NAME}_${NOA_LIBRARY_VARIANT}") + endif() + include(GNUInstallDirs) install(TARGETS ${TARGET_NAME} EXPORT ${TARGET_NAME} From d3fb1818f56d47ee0cb85c7fda6ff2e6954d6efe Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Tue, 15 Oct 2024 20:40:32 +0200 Subject: [PATCH 2/2] ci: use pipx instead of pip for clangformat install Signed-off-by: Tony Gorez --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8896dc71..8f95226f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: CXX: ${{ matrix.platform.cxx }} steps: - name: Install ClangFormat - run: pip install clang-format==19.1.0 + run: pipx install clang-format==19.1.0 - name: Install dependencies (GNU/Linux) if: runner.os == 'linux'