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

Random generator is incompatible with LLVM 15 #29

Closed
aeiouaeiouaeiouaeiouaeiouaeiou opened this issue Jan 26, 2023 · 2 comments
Closed

Comments

@aeiouaeiouaeiouaeiouaeiouaeiou
make[2]: Entering directory `/opt/local/var/macports/build/_Users_user_macports-ports_audio_audiowmark/audiowmark/work/audiowmark-0.6.1/src'
  CXX      audiowmark.o
  CXX      random.o
  CXX      audiostream.o
  CXX      sfinputstream.o
In file included from random.cc:18:
In file included from ./random.hh:26:
In file included from /opt/local/libexec/llvm-15/bin/../include/c++/v1/random:1682:
In file included from /opt/local/libexec/llvm-15/bin/../include/c++/v1/__random/bernoulli_distribution.h:14:
/opt/local/libexec/llvm-15/bin/../include/c++/v1/__random/uniform_real_distribution.h:119:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Random, void>::value':
    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/libexec/llvm-15/bin/../include/c++/v1/__random/uniform_real_distribution.h:84:17: note: in instantiation of function template specialization 'std::uniform_real_distribution<>::operator()<Random>' requested here
        {return (*this)(__g, __p_);}
                ^
./random.hh:73:24: note: in instantiation of function template specialization 'std::uniform_real_distribution<>::operator()<Random>' requested here
    return double_dist (*this);
                       ^
In file included from audiowmark.cc:21:
In file included from /opt/local/libexec/llvm-15/bin/../include/c++/v1/random:1682:
In file included from /opt/local/libexec/llvm-15/bin/../include/c++/v1/__random/bernoulli_distribution.h:14:
/opt/local/libexec/llvm-15/bin/../include/c++/v1/__random/uniform_real_distribution.h:119:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Random, void>::value':
    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/libexec/llvm-15/bin/../include/c++/v1/__random/uniform_real_distribution.h:84:17: note: in instantiation of function template specialization 'std::uniform_real_distribution<>::operator()<Random>' requested here
        {return (*this)(__g, __p_);}
                ^
./random.hh:73:24: note: in instantiation of function template specialization 'std::uniform_real_distribution<>::operator()<Random>' requested here
    return double_dist (*this);
                       ^
1 error generated.
1 error generated.
make[2]: *** [audiowmark.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [random.o] Error 1
swesterfeld added a commit that referenced this issue Jan 28, 2023
A uniform random bit generator G needs to have a typedef for G::result_type.
See issue #29.

Signed-off-by: Stefan Westerfeld <[email protected]>
@swesterfeld
Copy link
Owner

I was able to reproduce the same error message using debain/unstable in docker and clang++-15 with libc++-15. Should be fixed by this commit: 99ffa6b

@swesterfeld
Copy link
Owner

I'll close the issue since I think everything should work with my changes, let me know if that is not the case.

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