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

NVCC unable to handle locale exception #1260

Closed
chapman39 opened this issue Jan 27, 2024 · 3 comments · Fixed by #1265
Closed

NVCC unable to handle locale exception #1260

chapman39 opened this issue Jan 27, 2024 · 3 comments · Fixed by #1265
Labels
bug Something isn't working compiler Related to various compilers and their quirks cuda Issues related to CUDA help wanted Extra attention is needed

Comments

@chapman39
Copy link
Contributor

I've been attempting to build Axom on Lassen with clang14 and cuda support and get this locale error again seen here: https://github.com/LLNL/axom/pull/1171/files#diff-9cbc3def786cf3e15b52e3f729f1f8dec777b707e27af0dfa285d152d2b13ca8

/usr/WS2/meemee/spack/spack/var/spack/stage/spack-stage-axom-develop-et6ljgi5ofzmhxrcjtafatxc6g2syy7g/spack-src/src/axom/core/utilities/System.cpp(96): error: no instance of constr
            uctor "std::locale::locale" matches the argument list
     329                argument types are: (const std::string)

Unfortunately the solution provided in the previous PR was not sufficient for NVCC. I'm not sure why yet, but I wanted to track it here.

One solution provided by @white238 is to compile this file as a CXX file, but maybe this can be handled in a different way. Solution diff below:

diff --git a/src/axom/core/CMakeLists.txt b/src/axom/core/CMakeLists.txt
index 2090d7e2f..211683be8 100644
--- a/src/axom/core/CMakeLists.txt
+++ b/src/axom/core/CMakeLists.txt
@@ -122,6 +122,9 @@ axom_add_library(NAME        core
                  FOLDER      axom/core
                  )
 
+# Set file back to C++ due to nvcc compiler error
+set_source_files_properties(utilities/System.cpp PROPERTIES LANGUAGE CXX)
+
 # Basic includes that should be inherited to all Axom targets
 target_include_directories(core PUBLIC 
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
@chapman39 chapman39 added bug Something isn't working help wanted Extra attention is needed cuda Issues related to CUDA compiler Related to various compilers and their quirks labels Jan 27, 2024
@kennyweiss
Copy link
Member

Thanks @chapman39 -- locales are the gift that keep giving!

Assuming the proposed solution passes all CI, it looks good to me.

Is there a way to check the LANGUAGE that CMake thinks this file has before the change? Is it CUDA?

@chapman39
Copy link
Contributor Author

@kennyweiss yes its CUDA

@chapman39
Copy link
Contributor Author

Sounds good! I'll create a pr for it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Related to various compilers and their quirks cuda Issues related to CUDA help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants