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 compilation: Strange warning about whitespace after macro name #2606

Closed
kalj opened this issue May 16, 2016 · 4 comments
Closed

CUDA compilation: Strange warning about whitespace after macro name #2606

kalj opened this issue May 16, 2016 · 4 comments

Comments

@kalj
Copy link
Contributor

kalj commented May 16, 2016

This warning is obtained when compiling Deal.II with CUDA enabled.

<command-line>:0:8: warning: ISO C99 requires whitespace after the macro name

For some reason, the context of the warning, i.e. which file this is caused by, is missing. However, it appears after compilation of CUDA code so it is related to that.

@bangerth
Copy link
Member

It complains about something that is given via -D on the command line. What is the command line?

@kalj
Copy link
Contributor Author

kalj commented May 17, 2016

That is a good point! We set various macros using cmake so it might not necessarily be set explicitly on the command line. Still, this is valuable and I will look into it.

@kalj
Copy link
Contributor Author

kalj commented May 17, 2016

@Rombur: @bangerth is correct, compiling anything with nvcc or regular gcc and defining an invalid macro such as this:

g++ -DFOO.4=1 hello.cc

gives

<command-line>:0:4: warning: missing whitespace after the macro name

or if --std=c++11 is used,

<command-line>:0:4: warning: ISO C99 requires whitespace after the macro name

I will continuing investigating this.

@kalj
Copy link
Contributor Author

kalj commented May 17, 2016

Okay, I managed to track it down to some commands generated by CMake within FindCUDA. The problematic macro is obj_lac.debug_EXPORTS or the corresponding one for release. This is generated by CUDA_WRAP_SRCS from its first argument, which in this case happens to be obj_lac.debug , which is problematic due to the dot. If I understand it correctly, this name does not have to correspond to anything else, so we should be just fine just changing it. I have a fix prepared.

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

2 participants