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

Piro: Compile error with Clang 6 on Linux. #3157

Closed
lxmota opened this issue Jul 20, 2018 · 7 comments
Closed

Piro: Compile error with Clang 6 on Linux. #3157

lxmota opened this issue Jul 20, 2018 · 7 comments
Assignees
Labels
impacting: configure or build The issue is primarily related to configuring or building pkg: Piro type: bug The primary issue is a bug in Trilinos code or tests

Comments

@lxmota
Copy link
Contributor

lxmota commented Jul 20, 2018

Piro: Using Clang 6.0.0 on Linux fails to compile with the following error:

In file included from /home/amota/LCM/Trilinos/packages/piro/src/Piro_NOXSolver.
cpp:43:
/home/amota/LCM/Trilinos/packages/piro/src/Piro_NOXSolver_Def.hpp:139:44: error: use 'template' keyword to treat 'get' as a dependent template name
int iteration = optimizationParams.get("Optimizer Iteration Number");
^
template
1 error generated.

@trilinos/piro

Expectations

Piro should compile without error.

Current Behavior

Piro fails to compile.

Motivation and Context

Piro failing to compile prevents Trilinos to compile and install, leading to failure of Albany nightly tests for Clang 6.0.0 under Linux.

Definition of Done

Possible Solution

Steps to Reproduce

Try to compile Trilinos using Clang 6.0.0

Your Environment

  • Relevant repo SHA1s:
  • Relevant configure flags or configure script:
  • Operating system and version:
  • Compiler and TPL versions:

Related Issues

  • Blocks
  • Is blocked by
  • Follows
  • Precedes
  • Related to
  • Part of
  • Composed of

Additional Information

Albany nightly tests with Clang 6.0.0 started failing on Monday July 16.
For reference on why Albany tests fail: @ikalash @jewatkins

@lxmota lxmota added type: bug The primary issue is a bug in Trilinos code or tests pkg: Piro impacting: configure or build The issue is primarily related to configuring or building labels Jul 20, 2018
@lxmota lxmota changed the title Piro: Compile error with Clang 6 in Linux. Piro: Compile error with Clang 6 on Linux. Jul 20, 2018
@mperego mperego self-assigned this Jul 20, 2018
@mperego
Copy link
Contributor

mperego commented Jul 20, 2018

@lxmota There is something weird in your error message.
Line /home/amota/LCM/Trilinos/packages/piro/src/Piro_NOXSolver_Def.hpp:139 is
int iteration = optimizationParams.get<int>("Optimizer Iteration Number");
whereas in your error message you have
int iteration = optimizationParams.get("Optimizer Iteration Number");
Are you building an up-to-date version of Trilinos?

@lxmota
Copy link
Contributor Author

lxmota commented Jul 21, 2018 via email

@lxmota
Copy link
Contributor Author

lxmota commented Jul 22, 2018

Ok, I double checked the last nightly Albany build with Clang. Its from Friday July 20th at midnight. The error is:

In file included from /home/lcm/LCM/Trilinos/packages/piro/src/Piro_NOXSolver.cpp:43:
/home/lcm/LCM/Trilinos/packages/piro/src/Piro_NOXSolver_Def.hpp:139:44: error: use 'template' keyword to treat 'get' as a dependent template name
        int iteration = optimizationParams.get<int>("Optimizer Iteration Number");
                                           ^
                                           template
1 error generated.

I'm not sure how the <int> template parameter got omitted in the original message.

@lxmota
Copy link
Contributor Author

lxmota commented Jul 22, 2018

Once more, I'm not sure why things get truncated. One more try:

In file included from /home/lcm/LCM/Trilinos/packages/piro/src/Piro_NOXSolver.cpp:43:
/home/lcm/LCM/Trilinos/packages/piro/src/Piro_NOXSolver_Def.hpp:139:44: error:
use 'template' keyword to treat 'get' as a dependent template name
        int iteration = optimizationParams.get<int>("Optimizer Iteration Number");
                                           ^
                                           template
1 error generated.

@mhoemmen
Copy link
Contributor

Sometimes GitHub truncates <stuff in here> unless you protect it with backquotes.

@mperego
Copy link
Contributor

mperego commented Jul 23, 2018

Thanks @lxmota for posting the error code again and @mhoemmen for the explanation.

It seems the compiler wants you to put the template keyword at line 139:
int iteration = optimizationParams.template get<int>("Optimizer Iteration Number");

However Trilinos is full of these getters with no template keyword. Maybe it is the auto that's messing things up..

@lxmota if it is not too much trouble, can you try the solution above, or to replace the auto at lines 135 and 137 with const Teuchos::ParameterList& ?

@mperego
Copy link
Contributor

mperego commented Aug 8, 2018

Closing the issue as it issue should have been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impacting: configure or build The issue is primarily related to configuring or building pkg: Piro type: bug The primary issue is a bug in Trilinos code or tests
Projects
None yet
Development

No branches or pull requests

3 participants