I’m having an issue with character set incompatibility and don’t know how to fix it.
I compiled the .cu file on the Windows platform, where the fmtlib functions were used in the host function and the utf-8 character set was specified. The character set is specified to msvc via the -Xcompiler “/utf-8” option.
Here is the compile command:
D:\Code\Mycode\code_demo_test\cuda\vcpkg_installed\x64-windows\include\fmt\base.h(458): error: static assertion failed with "Unicode support requires compiling with /utf-8"
It is known that if the .cpp file using the same fmtlib functions was compiled directly with msvc, the problem does not occur after using the “/utf-8” option.
I tried the latest fmtlib. There is a cuda test, but i can’t compile it neither. It looks weird. Not sure the problem is something to do with NVCC or fmtlib.
The latest fmtlib introduced stricter Unicode checking. When the .cpp files are in utf-8 format, we need to explicitly pass the “/utf-8” option in msvc to enable the character set. So I guess that the format of intermediate files generated by nvcc or the wrong passing of “/utf-8” option may cause this problem.