diff --git a/.github/workflows/ci_coverage.yml b/.github/workflows/ci_coverage.yml index eeef7123..00ebc085 100644 --- a/.github/workflows/ci_coverage.yml +++ b/.github/workflows/ci_coverage.yml @@ -68,8 +68,7 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="-Werror -Wno-interference-size" \ - -DCHOPPER_NATIVE_BUILD=OFF + -DCMAKE_CXX_FLAGS="-Werror -Wno-interference-size" make -j2 gtest_build - name: Build tests diff --git a/.github/workflows/ci_linux.yml b/.github/workflows/ci_linux.yml index 8093bccf..c56df287 100644 --- a/.github/workflows/ci_linux.yml +++ b/.github/workflows/ci_linux.yml @@ -35,21 +35,27 @@ jobs: compiler: "clang-17" build: unit build_type: Release + cxx_flags: "-stdlib=libc++" - name: "gcc13" compiler: "gcc-13" build_type: Release - cxx_flags: -Wno-interference-size + cxx_flags: "-Wno-interference-size" - name: "gcc12" compiler: "gcc-12" build_type: Release - cxx_flags: -Wno-interference-size + cxx_flags: "-Wno-interference-size" - name: "gcc11" compiler: "gcc-11" build_type: Release - cxx_flags: -Wno-interference-size + cxx_flags: "-Wno-interference-size" + + - name: "IntelLLVM" + compiler: "intel" + build_type: Release + cxx_flags: "-fp-model=strict" steps: - name: Checkout @@ -64,11 +70,8 @@ jobs: compiler: ${{ matrix.compiler }} ccache_size: 125M - - name: Install OpenMP - if: contains(matrix.name, 'clang') - run: install libomp-17-dev - - name: Install CMake + if: contains(matrix.compiler, 'intel') == false uses: seqan/actions/setup-cmake@main with: cmake: 3.18.6 @@ -78,8 +81,7 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_flags }}" \ - -DCHOPPER_NATIVE_BUILD=OFF + -DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_flags }}" make -j2 gtest_build - name: Build tests diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index 576872f1..92c0097a 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -31,17 +31,25 @@ jobs: fail-fast: true matrix: include: + - name: "clang17" + compiler: "clang-17" + build_type: Release + cxx_flags: "-stdlib=libc++" # For verbosity. This is already the default. + - name: "gcc13" compiler: "gcc-13" build_type: Release + cxx_flags: "-Wno-interference-size" - name: "gcc12" compiler: "gcc-12" build_type: Release + cxx_flags: "-Wno-interference-size" - name: "gcc11" compiler: "gcc-11" build_type: Release + cxx_flags: "-Wno-interference-size" steps: - name: Checkout @@ -66,8 +74,7 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="-Werror -Wno-interference-size" \ - -DCHOPPER_NATIVE_BUILD=OFF + -DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_flags }}" make -j3 gtest_build - name: Build tests diff --git a/.github/workflows/ci_misc.yml b/.github/workflows/ci_misc.yml index d8552789..a3d7787b 100644 --- a/.github/workflows/ci_misc.yml +++ b/.github/workflows/ci_misc.yml @@ -29,17 +29,25 @@ jobs: fail-fast: false matrix: include: + - name: "Header clang17" + compiler: "clang-17" + build_type: Release + cxx_flags: "-stdlib=libc++" + - name: "Header gcc13" compiler: "gcc-13" build_type: Release + cxx_flags: "-Wno-interference-size" - name: "Header gcc12" compiler: "gcc-12" build_type: Release + cxx_flags: "-Wno-interference-size" - name: "Header gcc11" compiler: "gcc-11" build_type: Release + cxx_flags: "-Wno-interference-size" steps: - name: Checkout @@ -64,9 +72,8 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="-Werror -Wno-interference-size" \ - -DCHOPPER_HEADER_TEST_ONLY=ON \ - -DCHOPPER_NATIVE_BUILD=OFF + -DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_flags }}" \ + -DCHOPPER_HEADER_TEST_ONLY=ON - name: Build tests env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 9551d42b..20f12bf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required (VERSION 3.18) # Define the application name and version. project (chopper - LANGUAGES CXX C + LANGUAGES CXX VERSION 1.0.0 ) @@ -28,40 +28,11 @@ if (NOT CMAKE_BUILD_TYPE) ) endif () -# Check CXX and C compiler versions. -string (REGEX MATCH "^[0-9]+" CHOPPER_CXX_MAJOR_VERSION "${CMAKE_CXX_COMPILER_VERSION}") -string (REGEX MATCH "^[0-9]+" CHOPPER_C_MAJOR_VERSION "${CMAKE_C_COMPILER_VERSION}") -if (NOT "${CHOPPER_CXX_MAJOR_VERSION}" STREQUAL "${CHOPPER_C_MAJOR_VERSION}") - message (FATAL_ERROR "CXX and C compiler major versions differ (${CHOPPER_CXX_MAJOR_VERSION} and\ - ${CHOPPER_C_MAJOR_VERSION})! This will likely result in linker errors. Please set both\ - -DCMAKE_CXX_COMPILER and -DCMAKE_C_COMPILER to use the same major version, and/or set the\ - environment variables CXX and CC accordingly." - ) -endif () - set (CHOPPER_SUBMODULES_DIR "${CMAKE_CURRENT_LIST_DIR}/lib" CACHE STRING "Directory containing submodules." ) -# Flag checks -include (CheckCXXCompilerFlag) - -check_cxx_compiler_flag ("-fopenmp" CHOPPER_HAS_OPENMP) -if (CHOPPER_HAS_OPENMP) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") -endif () - -check_cxx_compiler_flag ("-fopenmp-simd" CHOPPER_HAS_OPENMP_SIMD) -if (CHOPPER_HAS_OPENMP_SIMD) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd -DSIMDE_ENABLE_OPENMP") -endif () - -check_cxx_compiler_flag ("-fopenmp-simd" CHOPPER_SUPPRESS_GCC4_ABI) -if (CHOPPER_SUPPRESS_GCC4_ABI) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") -endif () - # Specify the directories where to store the built archives, libraries and executables set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") diff --git a/lib/hibf b/lib/hibf index f1b03ab8..b068f7ed 160000 --- a/lib/hibf +++ b/lib/hibf @@ -1 +1 @@ -Subproject commit f1b03ab8dc13ad20ac4274c639593581b79d6a2e +Subproject commit b068f7ed2fe6716453ced9059321a4e1fa2c5a35 diff --git a/lib/seqan3 b/lib/seqan3 index 14bb1caa..57b9924a 160000 --- a/lib/seqan3 +++ b/lib/seqan3 @@ -1 +1 @@ -Subproject commit 14bb1caa05f42c128a9bc7a40fd947adaf64cfe9 +Subproject commit 57b9924a93b74a44319f8f9e93fa4292559c91aa diff --git a/lib/sharg-parser b/lib/sharg-parser index 9e8b79d9..3e96d373 160000 --- a/lib/sharg-parser +++ b/lib/sharg-parser @@ -1 +1 @@ -Subproject commit 9e8b79d9b1702d5a8bb850b49c649f12212b3f97 +Subproject commit 3e96d37387125bd876ace3fdd11a20039ed0d21c diff --git a/src/layout/hibf_statistics.cpp b/src/layout/hibf_statistics.cpp index 4db8140a..a0bb8071 100644 --- a/src/layout/hibf_statistics.cpp +++ b/src/layout/hibf_statistics.cpp @@ -24,6 +24,7 @@ #endif // CHOPPER_WORKAROUND_GCC_BOGUS_MEMCPY #include #include +#include #include #include #include diff --git a/test/api/layout/execute_layout_test.cpp b/test/api/layout/execute_layout_test.cpp index 9d8acd46..4d156b4a 100644 --- a/test/api/layout/execute_layout_test.cpp +++ b/test/api/layout/execute_layout_test.cpp @@ -321,6 +321,104 @@ TEST(execute_test, many_ubs) "#LOWER_LEVEL_IBF_26 fullest_technical_bin_idx:0\n" "#LOWER_LEVEL_IBF_27 fullest_technical_bin_idx:0\n" "#USER_BIN_IDX\tTECHNICAL_BIN_INDICES\tNUMBER_OF_TECHNICAL_BINS\n" +#ifdef _LIBCPP_VERSION // seqan::hibf::sketch::toolbox::sort_by_cardinalities is not stable + "5\t0;0\t1;14\n" + "4\t0;14\t1;10\n" + "3\t0;24\t1;10\n" + "2\t0;34\t1;10\n" + "1\t0;44\t1;10\n" + "0\t0;54\t1;10\n" + "11\t1;0\t1;14\n" + "10\t1;14\t1;10\n" + "9\t1;24\t1;10\n" + "8\t1;34\t1;10\n" + "7\t1;44\t1;10\n" + "6\t1;54\t1;10\n" + "17\t2;0\t1;14\n" + "16\t2;14\t1;10\n" + "15\t2;24\t1;10\n" + "14\t2;34\t1;10\n" + "13\t2;44\t1;10\n" + "12\t2;54\t1;10\n" + "21\t3;0\t1;26\n" + "20\t3;26\t1;26\n" + "19\t3;52\t1;6\n" + "18\t3;58\t1;6\n" + "24\t4;0\t1;22\n" + "23\t4;22\t1;21\n" + "22\t4;43\t1;21\n" + "27\t5;0\t1;22\n" + "26\t5;22\t1;21\n" + "25\t5;43\t1;21\n" + "30\t6;0\t1;22\n" + "29\t6;22\t1;21\n" + "28\t6;43\t1;21\n" + "33\t7;0\t1;22\n" + "32\t7;22\t1;21\n" + "31\t7;43\t1;21\n" + "38\t8;0\t1;22\n" + "35\t8;22\t1;21\n" + "34\t8;43\t1;21\n" + "37\t9;0\t1;22\n" + "36\t9;22\t1;21\n" + "39\t9;43\t1;21\n" + "55\t10\t1\n" + "54\t11\t1\n" + "53\t12\t1\n" + "52\t13\t1\n" + "51\t14\t1\n" + "50\t15\t1\n" + "49\t16\t1\n" + "57\t17\t1\n" + "47\t18\t1\n" + "46\t19\t1\n" + "45\t20\t1\n" + "44\t21\t1\n" + "43\t22\t1\n" + "42\t23\t1\n" + "41\t24\t1\n" + "40\t25\t1\n" + "59\t26;0\t1;32\n" + "58\t26;32\t1;32\n" + "48\t27;0\t1;32\n" + "56\t27;32\t1;32\n" + "60\t28\t1\n" + "61\t29\t1\n" + "62\t30\t1\n" + "63\t31\t1\n" + "64\t32\t1\n" + "65\t33\t1\n" + "66\t34\t1\n" + "67\t35\t1\n" + "68\t36\t1\n" + "69\t37\t1\n" + "70\t38\t1\n" + "71\t39\t1\n" + "72\t40\t1\n" + "73\t41\t1\n" + "74\t42\t1\n" + "75\t43\t1\n" + "76\t44\t1\n" + "79\t45\t1\n" + "78\t46\t1\n" + "77\t47\t1\n" + "80\t48\t1\n" + "81\t49\t1\n" + "82\t50\t1\n" + "83\t51\t1\n" + "84\t52\t1\n" + "85\t53\t1\n" + "86\t54\t1\n" + "87\t55\t1\n" + "88\t56\t1\n" + "89\t57\t1\n" + "90\t58\t1\n" + "91\t59\t1\n" + "92\t60\t1\n" + "93\t61\t1\n" + "94\t62\t1\n" + "95\t63\t1\n"}; +#else "15\t0;0\t1;14\n" "16\t0;14\t1;10\n" "17\t0;24\t1;10\n" @@ -417,6 +515,7 @@ TEST(execute_test, many_ubs) "81\t61\t1\n" "80\t62\t1\n" "95\t63\t1\n"}; +#endif std::string const actual_file{string_from_file(layout_file)}; EXPECT_EQ(actual_file, expected_file) << actual_file << std::endl; diff --git a/test/api/layout/execute_with_estimation_test.cpp b/test/api/layout/execute_with_estimation_test.cpp index 2efd7c92..8be3fd73 100644 --- a/test/api/layout/execute_with_estimation_test.cpp +++ b/test/api/layout/execute_with_estimation_test.cpp @@ -281,6 +281,104 @@ TEST(execute_estimation_test, many_ubs) "#LOWER_LEVEL_IBF_14 fullest_technical_bin_idx:0\n" "#LOWER_LEVEL_IBF_15 fullest_technical_bin_idx:0\n" "#USER_BIN_IDX\tTECHNICAL_BIN_INDICES\tNUMBER_OF_TECHNICAL_BINS\n" +#ifdef _LIBCPP_VERSION // seqan::hibf::sketch::toolbox::sort_by_cardinalities is not stable + "0\t0\t1\n" + "1\t1\t1\n" + "2\t2\t1\n" + "3\t3\t1\n" + "4\t4\t1\n" + "5\t5\t1\n" + "6\t6\t1\n" + "7\t7\t1\n" + "8\t8\t1\n" + "9\t9\t1\n" + "10\t10\t1\n" + "11\t11\t1\n" + "12\t12\t1\n" + "13\t13\t1\n" + "16\t14;0\t1;22\n" + "15\t14;22\t1;21\n" + "14\t14;43\t1;21\n" + "19\t15;0\t1;22\n" + "18\t15;22\t1;21\n" + "17\t15;43\t1;21\n" + "20\t16\t1\n" + "21\t17\t1\n" + "22\t18\t1\n" + "23\t19\t1\n" + "24\t20\t1\n" + "25\t21\t1\n" + "26\t22\t1\n" + "27\t23\t1\n" + "28\t24\t1\n" + "29\t25\t1\n" + "30\t26\t1\n" + "31\t27\t1\n" + "32\t28\t1\n" + "33\t29\t1\n" + "34\t30\t1\n" + "35\t31\t1\n" + "38\t32\t1\n" + "39\t33\t1\n" + "36\t34\t1\n" + "37\t35\t1\n" + "55\t36\t1\n" + "54\t37\t1\n" + "53\t38\t1\n" + "52\t39\t1\n" + "51\t40\t1\n" + "50\t41\t1\n" + "49\t42\t1\n" + "57\t43\t1\n" + "47\t44\t1\n" + "46\t45\t1\n" + "45\t46\t1\n" + "44\t47\t1\n" + "43\t48\t1\n" + "42\t49\t1\n" + "41\t50\t1\n" + "40\t51\t1\n" + "58\t52\t1\n" + "59\t53\t1\n" + "56\t54\t1\n" + "48\t55\t1\n" + "60\t56\t2\n" + "61\t58\t2\n" + "62\t60\t2\n" + "63\t62\t2\n" + "64\t64\t2\n" + "65\t66\t2\n" + "66\t68\t2\n" + "67\t70\t2\n" + "68\t72\t2\n" + "69\t74\t2\n" + "70\t76\t2\n" + "71\t78\t2\n" + "72\t80\t2\n" + "73\t82\t2\n" + "74\t84\t2\n" + "75\t86\t2\n" + "76\t88\t2\n" + "79\t90\t2\n" + "78\t92\t2\n" + "77\t94\t2\n" + "80\t96\t2\n" + "81\t98\t2\n" + "82\t100\t2\n" + "83\t102\t2\n" + "84\t104\t2\n" + "85\t106\t2\n" + "86\t108\t2\n" + "87\t110\t2\n" + "88\t112\t2\n" + "89\t114\t2\n" + "90\t116\t2\n" + "91\t118\t2\n" + "92\t120\t2\n" + "93\t122\t2\n" + "94\t124\t2\n" + "95\t126\t2\n"}; +#else "0\t0\t1\n" "19\t1\t1\n" "18\t2\t1\n" @@ -377,6 +475,7 @@ TEST(execute_estimation_test, many_ubs) "81\t122\t2\n" "80\t124\t2\n" "95\t126\t2\n"}; +#endif std::string const actual_file{string_from_file(layout_file)}; EXPECT_EQ(actual_file, expected_file); } @@ -521,8 +620,10 @@ TEST(execute_estimation_test, with_rearrangement) std::string const written_file{string_from_file(stats_file)}; - EXPECT_EQ(written_file, - R"expected_cout(## ### Parameters ### + std::string const expected = []() + { + std::string result = + R"expected_cout(## ### Parameters ### ## number of user bins = 196 ## number of hash functions = 2 ## maximum false positive rate = 0.05 @@ -538,11 +639,28 @@ TEST(execute_estimation_test, with_rearrangement) ## (l*m)_tmax : Computed by l_tmax * m_tmax ## size : The expected total size of an tmax-HIBF # tmax c_tmax l_tmax m_tmax (l*m)_tmax size -64 1.00 2.22 1.00 2.22 117.1KiB +)expected_cout"; + +#ifdef _LIBCPP_VERSION // seqan::hibf::sketch::toolbox::sort_by_cardinalities is not stable + result += + R"expected_cout(64 1.00 2.08 1.00 2.08 117.1KiB +128 1.22 1.75 1.10 1.93 128.7KiB +256 1.33 1.52 1.18 1.81 138.7KiB +# Best t_max (regarding expected query runtime): 256 +)expected_cout"; +#else + result += + R"expected_cout(64 1.00 2.22 1.00 2.22 117.1KiB 128 1.22 1.95 1.15 2.23 134.3KiB 256 1.33 1.52 1.18 1.81 138.7KiB # Best t_max (regarding expected query runtime): 256 -)expected_cout"); +)expected_cout"; +#endif + + return result; + }(); + + EXPECT_EQ(written_file, expected); std::string const layout_string{string_from_file(layout_file)}; EXPECT_NE(layout_string.find("\"tmax\": 256,"), std::string::npos); diff --git a/test/header/CMakeLists.txt b/test/header/CMakeLists.txt index 67b77ab2..93eaacd6 100644 --- a/test/header/CMakeLists.txt +++ b/test/header/CMakeLists.txt @@ -12,6 +12,7 @@ include (seqan3_test_component) add_library ("chopper_header_test_lib" INTERFACE) target_link_libraries ("chopper_header_test_lib" INTERFACE "chopper_shared" gtest gtest_main) +target_compile_options ("chopper_header_test_lib" INTERFACE "-Wno-unused-function") target_include_directories ("chopper_header_test_lib" INTERFACE "${SEQAN3_TEST_CLONE_DIR}/googletest/include/") # SeqAn3 script adds an include for , which we do not use in Chopper target_include_directories ("chopper_header_test_lib" INTERFACE ./dummy_include) @@ -26,7 +27,7 @@ file (GLOB_RECURSE header_files file (WRITE "${PROJECT_BINARY_DIR}/${target}.cpp" "") add_executable (${target} ${PROJECT_BINARY_DIR}/${target}.cpp) -target_link_libraries (${target} chopper_header_test_lib) +target_link_libraries (${target} chopper_shared chopper_header_test_lib) add_test (NAME "header/${target}" COMMAND ${target}) foreach (header ${header_files}) @@ -68,7 +69,7 @@ foreach (header ${header_files}) ) add_dependencies (${header_target} "chopper_shared" gtest gtest_main) else () - target_link_libraries (${header_target} chopper_header_test_lib) + target_link_libraries (${header_target} chopper_shared chopper_header_test_lib) endif () target_sources (${target} PRIVATE $)