seqan / seqan3

The modern C++ library for sequence analysis. Contains version 3 of the library and API docs.
https://www.seqan.de
Other
406 stars 82 forks source link

[FIX] CPP23 #3240

Closed eseiler closed 7 months ago

eseiler commented 7 months ago

I don't know why the nightlies only fail now, even though these changes have been in GCC for a few months :)

https://cdash.seqan.de/index.php?project=SeqAn3

Commit 1

Things like std::apply require tuple-like.

It also kinda means that CPP23 breaks most of our custom tuple stuff; at least when you want to use it like a std::tuple. In the future, std::get is supposed to get a CPO.

#include <vector>

#include <seqan3/alphabet/nucleotide/dna5.hpp>
#include <seqan3/alphabet/quality/phred42.hpp>
#include <seqan3/io/record.hpp>
#include <seqan3/utility/tuple/pod_tuple.hpp>
#include <seqan3/utility/type_list/type_list.hpp>

// Would work, but not allowed.
// namespace std
// {
//     template <typename... T>
//     inline constexpr bool __is_tuple_like_v<seqan3::pod_tuple<T...>> = true;
// }

int main()
{
    using seq_t = std::vector<seqan3::dna5>;
    using id_t = std::string;
    using qual_t = std::vector<seqan3::phred42>;
    using type_list_t = seqan3::type_list<seq_t, id_t, qual_t>;
    using fields_t = seqan3::fields<seqan3::field::seq, seqan3::field::id, seqan3::field::qual>;
    using record_t = seqan3::record<type_list_t, fields_t> &;

    static_assert(std::__tuple_like<record_t>); // Fails
    static_assert(std::__tuple_like<seqan3::pod_tuple<int, float, int>>); // Fails
}

Commit 2

/usr/bin/ld: read_mapper_step2.cpp.o: warning: relocation against `_ZN6seqan36detail21optimum_search_schemeILh0ELh2EEE' in read-only section `.text._ZN6seqan36detail23search_scheme_algorithmINS_13configurationIJNS_10search_cfg15max_error_totalENS3_12hit_all_bestENS3_15output_query_idENS3_19output_reference_idENS3_31output_reference_begin_positionENS3_6detail11result_typeINS_13search_resultImNS0_10empty_typeEmmEEEEEEENS_11bi_fm_indexINS_4dna5ELNS_11text_layoutE1EN4sdsl6csa_wtINSJ_5wt_pcINSJ_14balanced_shapeENSJ_10int_vectorILh1EEENSJ_14rank_support_vILh1ELh1EEENSJ_19select_support_scanILh1ELh1EEENSR_ILh0ELh1EEENSJ_9byte_treeILb0EEEEELj16ELj10000000ENSJ_20sa_order_sa_samplingILh0EEENSJ_12isa_samplingILh0EEENSJ_19plain_byte_alphabetEEEEEJNS0_16policy_max_errorENS0_28policy_search_result_builderISF_EEEE14search_algo_biILb0ESt6vectorISH_SaISH_EERKZNS17_clISt5tupleIJmRS1B_EESt8functionIFvSD_EEEEvOT_OT0_EUlRKS1J_E_EEvRS1L_NS0_12search_paramEOT1_[_ZN6seqan36detail23search_scheme_algorithmINS_13configurationIJNS_10search_cfg15max_error_totalENS3_12hit_all_bestENS3_15output_query_idENS3_19output_reference_idENS3_31output_reference_begin_positionENS3_6detail11result_typeINS_13search_resultImNS0_10empty_typeEmmEEEEEEENS_11bi_fm_indexINS_4dna5ELNS_11text_layoutE1EN4sdsl6csa_wtINSJ_5wt_pcINSJ_14balanced_shapeENSJ_10int_vectorILh1EEENSJ_14rank_support_vILh1ELh1EEENSJ_19select_support_scanILh1ELh1EEENSR_ILh0ELh1EEENSJ_9byte_treeILb0EEEEELj16ELj10000000ENSJ_20sa_order_sa_samplingILh0EEENSJ_12isa_samplingILh0EEENSJ_19plain_byte_alphabetEEEEEJNS0_16policy_max_errorENS0_28policy_search_result_builderISF_EEEE14search_algo_biILb0ESt6vectorISH_SaISH_EERKZNS17_clISt5tupleIJmRS1B_EESt8functionIFvSD_EEEEvOT_OT0_EUlRKS1J_E_EEvRS1L_NS0_12search_paramEOT1_]'
/usr/bin/ld: read_mapper_step2.cpp.o: in function `void seqan3::detail::search_scheme_algorithm<seqan3::configuration<seqan3::search_cfg::max_error_total, seqan3::search_cfg::hit_all_best, seqan3::search_cfg::output_query_id, seqan3::search_cfg::output_reference_id, seqan3::search_cfg::output_reference_begin_position, seqan3::search_cfg::detail::result_type<seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long> > >, seqan3::bi_fm_index<seqan3::dna5, (seqan3::text_layout)1, sdsl::csa_wt<sdsl::wt_pc<sdsl::balanced_shape, sdsl::int_vector<(unsigned char)1>, sdsl::rank_support_v<(unsigned char)1, (unsigned char)1>, sdsl::select_support_scan<(unsigned char)1, (unsigned char)1>, sdsl::select_support_scan<(unsigned char)0, (unsigned char)1>, sdsl::byte_tree<false> >, 16u, 10000000u, sdsl::sa_order_sa_sampling<(unsigned char)0>, sdsl::isa_sampling<(unsigned char)0>, sdsl::plain_byte_alphabet> >, seqan3::detail::policy_max_error, seqan3::detail::policy_search_result_builder<seqan3::configuration<seqan3::search_cfg::max_error_total, seqan3::search_cfg::hit_all_best, seqan3::search_cfg::output_query_id, seqan3::search_cfg::output_reference_id, seqan3::search_cfg::output_reference_begin_position, seqan3::search_cfg::detail::result_type<seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long> > > > >::search_algo_bi<false, std::vector<seqan3::dna5, std::allocator<seqan3::dna5> >, seqan3::detail::search_scheme_algorithm<seqan3::configuration<seqan3::search_cfg::max_error_total, seqan3::search_cfg::hit_all_best, seqan3::search_cfg::output_query_id, seqan3::search_cfg::output_reference_id, seqan3::search_cfg::output_reference_begin_position, seqan3::search_cfg::detail::result_type<seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long> > >, seqan3::bi_fm_index<seqan3::dna5, (seqan3::text_layout)1, sdsl::csa_wt<sdsl::wt_pc<sdsl::balanced_shape, sdsl::int_vector<(unsigned char)1>, sdsl::rank_support_v<(unsigned char)1, (unsigned char)1>, sdsl::select_support_scan<(unsigned char)1, (unsigned char)1>, sdsl::select_support_scan<(unsigned char)0, (unsigned char)1>, sdsl::byte_tree<false> >, 16u, 10000000u, sdsl::sa_order_sa_sampling<(unsigned char)0>, sdsl::isa_sampling<(unsigned char)0>, sdsl::plain_byte_alphabet> >, seqan3::detail::policy_max_error, seqan3::detail::policy_search_result_builder<seqan3::configuration<seqan3::search_cfg::max_error_total, seqan3::search_cfg::hit_all_best, seqan3::search_cfg::output_query_id, seqan3::search_cfg::output_reference_id, seqan3::search_cfg::output_reference_begin_position, seqan3::search_cfg::detail::result_type<seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long> > > > >::operator()<std::tuple<unsigned long, std::vector<seqan3::dna5, std::allocator<seqan3::dna5> >&>, std::function<void (seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long>)> >(std::tuple<unsigned long, std::vector<seqan3::dna5, std::allocator<seqan3::dna5> >&>&&, std::function<void (seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long>)>&&)::{lambda(auto:1 const&)#1} const&>(std::function<void (seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long>)>&, seqan3::detail::search_param, seqan3::detail::search_scheme_algorithm<seqan3::configuration<seqan3::search_cfg::max_error_total, seqan3::search_cfg::hit_all_best, seqan3::search_cfg::output_query_id, seqan3::search_cfg::output_reference_id, seqan3::search_cfg::output_reference_begin_position, seqan3::search_cfg::detail::result_type<seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long> > >, seqan3::bi_fm_index<seqan3::dna5, (seqan3::text_layout)1, sdsl::csa_wt<sdsl::wt_pc<sdsl::balanced_shape, sdsl::int_vector<(unsigned char)1>, sdsl::rank_support_v<(unsigned char)1, (unsigned char)1>, sdsl::select_support_scan<(unsigned char)1, (unsigned char)1>, sdsl::select_support_scan<(unsigned char)0, (unsigned char)1>, sdsl::byte_tree<false> >, 16u, 10000000u, sdsl::sa_order_sa_sampling<(unsigned char)0>, sdsl::isa_sampling<(unsigned char)0>, sdsl::plain_byte_alphabet> >, seqan3::detail::policy_max_error, seqan3::detail::policy_search_result_builder<seqan3::configuration<seqan3::search_cfg::max_error_total, seqan3::search_cfg::hit_all_best, seqan3::search_cfg::output_query_id, seqan3::search_cfg::output_reference_id, seqan3::search_cfg::output_reference_begin_position, seqan3::search_cfg::detail::result_type<seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long> > > > >::operator()<std::tuple<unsigned long, std::vector<seqan3::dna5, std::allocator<seqan3::dna5> >&>, std::function<void (seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long>)> >(std::tuple<unsigned long, std::vector<seqan3::dna5, std::allocator<seqan3::dna5> >&>&&, std::function<void (seqan3::search_result<unsigned long, seqan3::detail::empty_type, unsigned long, unsigned long>)>&&)::{lambda(auto:1 const&)#1} const&)':
seqan3/search/detail/search_scheme_algorithm.hpp:839: undefined reference to `seqan3::detail::optimum_search_scheme<(unsigned char)0, (unsigned char)0>'
/usr/bin/ld: seqan3/search/detail/search_scheme_algorithm.hpp:842: undefined reference to `seqan3::detail::optimum_search_scheme<(unsigned char)0, (unsigned char)1>'
/usr/bin/ld: seqan3/search/detail/search_scheme_algorithm.hpp:845: undefined reference to `seqan3::detail::optimum_search_scheme<(unsigned char)0, (unsigned char)2>'
/usr/bin/ld: seqan3/search/detail/search_scheme_algorithm.hpp:848: undefined reference to `seqan3::detail::optimum_search_scheme<(unsigned char)0, (unsigned char)3>'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
gmake[3]: *** [CMakeFiles/read_mapper_step2_snippet.dir/build.make:100: tutorial/11_read_mapper/read_mapper_step2_snippet] Error 1

Adding a WORKAROUND macro is a bit verbose, but I don't want the linker error to mask other potential issues.

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
seqan3 ✅ Ready (Inspect) Visit Preview Feb 27, 2024 0:01am
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.17%. Comparing base (0146855) to head (4311ad5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3240 +/- ## ======================================= Coverage 98.17% 98.17% ======================================= Files 269 269 Lines 11854 11856 +2 ======================================= + Hits 11638 11640 +2 Misses 216 216 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.