Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail to compile: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Catch::RandomNumberGenerator, void>::value' #80

Open
yurivict opened this issue Jul 16, 2023 · 3 comments

Comments

@yurivict
Copy link

In file included from test_locarna_lib.cc:2:
In file included from ./catch.hpp:74:
In file included from /usr/include/c++/v1/sstream:186:
In file included from /usr/include/c++/v1/istream:165:
In file included from /usr/include/c++/v1/ostream:168:
In file included from /usr/include/c++/v1/bitset:128:
In file included from /usr/include/c++/v1/string:551:
In file included from /usr/include/c++/v1/string_view:222:
In file included from /usr/include/c++/v1/algorithm:1851:
In file included from /usr/include/c++/v1/__algorithm/ranges_sample.h:13:
In file included from /usr/include/c++/v1/__algorithm/sample.h:18:
/usr/include/c++/v1/__random/uniform_int_distribution.h:235:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Catch::RandomNumberGenerator, void>::value': 
    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__algorithm/shuffle.h:154:35: note: in instantiation of function template specialization 'std::uniform_int_distribution<long>::operator()<Catch::RandomNumberGenerator>' requested here
            difference_type __i = __uid(__g, _Pp(0, __d));
                                  ^
/usr/include/c++/v1/__algorithm/shuffle.h:166:14: note: in instantiation of function template specialization 'std::__shuffle<std::_ClassicAlgPolicy, std::__wrap_iter<Catch::TestCase *>, std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here
  (void)std::__shuffle<_ClassicAlgPolicy>(
             ^
./catch.hpp:6470:18: note: in instantiation of function template specialization 'std::shuffle<std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here
            std::shuffle( vector.begin(), vector.end(), rng );
                 ^
./catch.hpp:6488:44: note: in instantiation of function template specialization 'Catch::RandomNumberGenerator::shuffle<std::vector<Catch::TestCase>>' requested here
                    RandomNumberGenerator::shuffle( sorted );
                                           ^
1 error generated.

Version: 2.0.0
clang-15
FreeBSD 13.2

@s-will
Copy link
Owner

s-will commented Jul 17, 2023

This looks like an issue due to the used testing framework Catch. Since I cannot reproduce your errors using clang-15 on Linux, I only updated Catch in branch devel and would ask you to check whether that resolves your issue.

@yurivict
Copy link
Author

The tag 478ffcf from the devel branch fails to compile:

Making all in man
gmake[3]: Entering directory '/usr/ports/biology/locarna/work/LocARNA-478ffcf/Doc/man'
gmake[3]: *** No rule to make target 'exparna_p.1', needed by 'all-am'.  Stop.
gmake[3]: Leaving directory '/usr/ports/biology/locarna/work/LocARNA-478ffcf/Doc/man'
gmake[2]: *** [Makefile:402: all-recursive] Error 1
gmake[2]: Leaving directory '/usr/ports/biology/locarna/work/LocARNA-478ffcf/Doc'
gmake[1]: *** [Makefile:671: all-recursive] Error 1

@yurivict
Copy link
Author

yurivict commented Jul 17, 2023

Removing the bundled catch and using the external catch-2.13.10 allows tests to compile.

IMO it's better to just use externally installed catch rather than bundle it and then worry to keep it updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants