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

Including spdlog 1.8.0 from .cu files (NVCC compilation) fails #1662

Closed
harrism opened this issue Sep 2, 2020 · 1 comment
Closed

Including spdlog 1.8.0 from .cu files (NVCC compilation) fails #1662

harrism opened this issue Sep 2, 2020 · 1 comment

Comments

@harrism
Copy link

harrism commented Sep 2, 2020

Building CUDA source files (.cu) using NVCC fails in 1.8.0 (works in 1.7.0) with errors like this:

_deps/spdlog-src/include/spdlog/fmt/bundled/format.h (3677): error: a literal operator template must have a template parameter list equivalent to "<char ...>"

This is fixed in the master branch of fmt lib:
fmtlib/fmt#1818

@gabime gabime closed this as completed Mar 12, 2021
bachittle pushed a commit to bachittle/spdlog that referenced this issue Dec 22, 2022
@Alkaid-Benetnash
Copy link

I am still having the same error with nvcc 12.1 and spdlog v1.14.1

The following patch solved this problem on my end, basically the same as the solution in the upstream fmt repo.

diff --git a/include/spdlog/fmt/bundled/core.h b/include/spdlog/fmt/bundled/core.h
index b51c1406..27b8c3f6 100644
--- a/include/spdlog/fmt/bundled/core.h
+++ b/include/spdlog/fmt/bundled/core.h
@@ -241,7 +241,7 @@
 #  if defined(__cpp_nontype_template_args) &&                  \
       ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \
        __cpp_nontype_template_args >= 201911L) &&              \
-      !defined(__NVCOMPILER) && !defined(__LCC__)
+      !defined(__NVCOMPILER) && !defined(__LCC__) && !defined(__NVCC__)
 #    define FMT_USE_NONTYPE_TEMPLATE_ARGS 1
 #  else
 #    define FMT_USE_NONTYPE_TEMPLATE_ARGS 0

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

3 participants