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

#include "lapacke.h" causes weird cinchlog compile error #167

Open
mattbement opened this issue Dec 28, 2018 · 5 comments
Open

#include "lapacke.h" causes weird cinchlog compile error #167

mattbement opened this issue Dec 28, 2018 · 5 comments

Comments

@mattbement
Copy link

When I #include "lapacke.h" in my task.h file, I get the following compile error with gcc 7.3.0:
In file included from /home/bement/ristra/flecsale-mm/flecsi/flecsi/data/sparse_accessor.h:20:0, from /home/bement/ristra/flecsale-mm/specializations/flecsi-sp/utils/types.h:5, from /home/bement/ristra/flecsale-mm/apps/dsd/2d/../types.h:21, from /home/bement/ristra/flecsale-mm/apps/dsd/2d/inputs.h:13, from /home/bement/ristra/flecsale-mm/apps/dsd/2d/driver.cc:11: /home/bement/ristra/flecsale-mm/cinch/logging/cinchlog.h:1373:24: error: expected unqualified-id before ‘if’ #define clog(severity) if(true) {} else std::cerr ^ /home/bement/ristra/flecsale-mm/cinch/logging/cinchlog.h:1373:36: error: expected unqualified-id before ‘else’ #define clog(severity) if(true) {} else std::cerr

@cmsquared
Copy link
Member

What hash of cinch are you using? That macro definition and the line number don't match the current head, and the contents of that line were changed about 8 months ago. I don't know the reason for the error, but it might be worth trying to update to the latest hash to see if you can compile, and if so, update flecsale-mm.

@mattbement
Copy link
Author

It looks like there are at least 3 versions of cinch in flecsale: The one directly in the flecsale-mm checkout, as well as ones in flecsi and ristra. The ones in flecsale-mm and flecsi are 912d041, but the one in ristra is 19b181a. Not sure if this is by design or if it even matters.

@cmsquared
Copy link
Member

For the most part, it shouldn't matter. Except when it does :). A lot of our projects are like this, but I've still never seen your error message. The top-level one is the one that matters.

@charest
Copy link
Contributor

charest commented Jan 4, 2019

This offending line seems to be

#define clog(severity) if(true) {} else std::cerr

But I cannot see how this macro is failing, unless there is a name collision. How is lapacke.h included in driver? Can you post/email a snippet?

@cmsquared
Copy link
Member

One thing to note is that lapacke.h defines a lot of things within extern "c" block, using the __cplusplus compiler macro. I'm not saying this is the cause, but there is an explicit check that adds another } to close the extern block, based on this macro. Make sure you are using g++ and not gcc somehow...

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