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

CUDA, C++14, and GCC 6+ #1080

Closed
henryiii opened this issue Mar 15, 2019 · 9 comments
Closed

CUDA, C++14, and GCC 6+ #1080

henryiii opened this issue Mar 15, 2019 · 9 comments

Comments

@henryiii
Copy link
Contributor

henryiii commented Mar 15, 2019

Including the fmt header seems to kill nvcc compiling device code; I believe even if fmt is not used. This only starts happening if C++14 is turned on for host and device code (requires CUDA 9 or better).

Any ideas? I expect another check for CUDA needs to be added to the 1-2 that are already there.

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(772): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_64" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(772): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_64" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(772): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_64" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(772): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_64" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(900): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_32" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1178): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(772): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_64" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(772): error: identifier "fmt::v5::internal::basic_data<void> ::ZERO_OR_POWERS_OF_10_64" is undefined in device code

/home/schreihf/git/fitting/goofit/extern/fmt/include/fmt/format.h(1158): error: identifier "Typeinfo for  ::fmt::v5::format_error" is undefined in device code

Error: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!"

fmt 5.3. Adding as subdirectory in CMake. I have not been able to reproduce this yet in a small example.

@vitaut
Copy link
Contributor

vitaut commented Mar 16, 2019

Not sure. The definition of ZERO_OR_POWERS_OF_10_32 doesn't depend on whether the code is compiled with C++14 or not, it's just a simple static member variable:

const uint32_t basic_data<T>::ZERO_OR_POWERS_OF_10_32[] = {0,

@henryiii
Copy link
Contributor Author

I’m going to keep investigating. I will report here with what I find. So far, GCC 4.8 + C++11 works, and GCC 6 + C++14 fails. A simple example seems to work fine, so it’s seems to be a change in behavior somewhere else

@vitaut
Copy link
Contributor

vitaut commented Mar 31, 2019

@henryiii, have you figured out what the problem is?

@henryiii
Copy link
Contributor Author

I've got two users who have seen this issue; one verified that if you rebuild everything with C++11 even with GCC 6, it works. So it's the change from 11 to 14 that triggers the issue. That's all I have so far, I've been traveling most of this month and will still be out till the 8th of April.

@vitaut
Copy link
Contributor

vitaut commented Apr 20, 2019

Closing since I don't think it's a bug in the library, but a PR to workaround the issue would be welcome.

@vitaut vitaut closed this as completed Apr 20, 2019
@henryiii
Copy link
Contributor Author

OK, I’ll let you know if I find out anything.

@yves-dolce
Copy link

yves-dolce commented May 31, 2019

Using the latest bit from the master branch, my project (not using CUDA) broke with Microsoft C++ compiler Version 19.21.27702.2 for x64.

/JMC /permissive- /Yu"pch.h" /GS /Zc:rvalueCast /W4 /Zc:wchar_t /I"......\fmt\include" /ZI /Gm- /Od /sdl /Fd"x64\Debug\vc142.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MTd /std:c++17 /FC /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\......pch" /diagnostics:caret 
error LNK2001: unresolved external symbol "public: static unsigned int const * const fmt::v5::internal::basic_data<void>::ZERO_OR_POWERS_OF_10_32" (?ZERO_OR_POWERS_OF_10_32@?$basic_data@X@internal@v5@fmt@@2QBIB)

error LNK2001: unresolved external symbol "public: static unsigned __int64 const * const fmt::v5::internal::basic_data<void>::ZERO_OR_POWERS_OF_10_64" (?ZERO_OR_POWERS_OF_10_64@?$basic_data@X@internal@v5@fmt@@2QB_KB)

error LNK2001: unresolved external symbol "public: static unsigned __int64 const * const fmt::v5::internal::basic_data<void>::ZERO_OR_POWERS_OF_10_64" (?ZERO_OR_POWERS_OF_10_64@?$basic_data@X@internal@v5@fmt@@2QB_KB)

error LNK2001: unresolved external symbol "public: static char const * const fmt::v5::internal::basic_data<void>::DIGITS" (?DIGITS@?$basic_data@X@internal@v5@fmt@@2QBDB)

error LNK2001: unresolved external symbol "public: static char const * const fmt::v5::internal::basic_data<void>::DIGITS" (?DIGITS@?$basic_data@X@internal@v5@fmt@@2QBDB)

error LNK2001: unresolved external symbol "public: static char const * const fmt::v5::internal::basic_data<void>::HEX_DIGITS" (?HEX_DIGITS@?$basic_data@X@internal@v5@fmt@@2QBDB)

error LNK2001: unresolved external symbol "public: static char const * const fmt::v5::internal::basic_data<void>::HEX_DIGITS" (?HEX_DIGITS@?$basic_data@X@internal@v5@fmt@@2QBDB)

error LNK2001: unresolved external symbol "public: static unsigned __int64 const * const fmt::v5::internal::basic_data<void>::POWERS_OF_10_64" (?POWERS_OF_10_64@?$basic_data@X@internal@v5@fmt@@2QB_KB)

error LNK2001: unresolved external symbol "public: static unsigned __int64 const * const fmt::v5::internal::basic_data<void>::POW10_SIGNIFICANDS" (?POW10_SIGNIFICANDS@?$basic_data@X@internal@v5@fmt@@2QB_KB)

error LNK2001: unresolved external symbol "public: static short const * const fmt::v5::internal::basic_data<void>::POW10_EXPONENTS" (?POW10_EXPONENTS@?$basic_data@X@internal@v5@fmt@@2QBFB)

@yves-dolce
Copy link

yves-dolce commented May 31, 2019

Removing the template parameter in the definition seems to fix all of them but I don't know enough about the library and its testing to confirm this does not have an unwanted side-effect.

For example:

template <>
const uint32_t basic_data<>::ZERO_OR_POWERS_OF_10_32[] = {0,
                                                           FMT_POWERS_OF_10(1)};

@vitaut
Copy link
Contributor

vitaut commented Jun 2, 2019

format_data is defined here:

template struct FMT_API internal::basic_data<void>;

@yves-dolce, how do you link with {fmt}?

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