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

Compilation errors with single-source branch and clang #2276

Closed
StewMH opened this issue May 23, 2024 · 3 comments
Closed

Compilation errors with single-source branch and clang #2276

StewMH opened this issue May 23, 2024 · 3 comments
Labels

Comments

@StewMH
Copy link
Contributor

StewMH commented May 23, 2024

Compiling with clang and the single source file included gives me these errors:

In file included from <source>:4:
/app/raw.githubusercontent.com/alpaka-group/alpaka/single-header/include/alpaka/alpaka.hpp:26621:67: error: template template argument has different template parameters than its corresponding template template parameter
 26621 |             using EnabledAccTags = alpaka::meta::Filter<AccTags, alpaka::AccIsEnabled>;
       |                                                                          ^
/app/raw.githubusercontent.com/alpaka-group/alpaka/single-header/include/alpaka/alpaka.hpp:26610:6: note: too many template parameters in template template argument
 26610 |             template<typename TTag, typename = void>
       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/app/raw.githubusercontent.com/alpaka-group/alpaka/single-header/include/alpaka/alpaka.hpp:26596:32: note: previous template template parameter is here
 26596 |                     template<typename TList, template<typename> class TPred>
       |                                              ^~~~~~~~~~~~~~~~~~
1 error generated.
Compiler returned: 1

https://godbolt.org/z/9ffdPPKzj

I could not find a clang version that it worked for.

@StewMH
Copy link
Contributor Author

StewMH commented May 23, 2024

I think this is the offending commit:
eae316f
Just confusing myself now, ignore this. Haven't figured out where it fails.

@SimeonEhrig
Copy link
Member

The reason is, that we use a C++17 feature, which is disable by default until Clang 18. Clang 19 will enable it by default. Please set the compiler flag -frelaxed-template-template-args.

For more details, see here:

# C++17 relaxed template template argument matching is disabled by default until Clang 19
# https://github.com/llvm/llvm-project/commit/b86e0992bfa6
# https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#150
# for example, is required to create alpaka::EnabledAccTags
# the feature is implemented since Clang 4
alpaka_set_compiler_options(HOST_DEVICE target alpaka "$<$<AND:$<CXX_COMPILER_ID:Clang,AppleClang,IntelLLVM>>:SHELL:-frelaxed-template-template-args>")

@psychocoderHPC
Copy link
Member

We added -frelaxed-template-template-args to alpaka with #2267

The provided godbolt example works fine when adding -frelaxed-template-template-args, therefor I will close this issue.

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

No branches or pull requests

3 participants