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

Tpetra: Use of "uint" in multiple files causing build failures on Mac OS X, GNU 8.2.x #3976

Closed
glhenni opened this issue Dec 3, 2018 · 3 comments
Assignees
Labels
impacting: configure or build The issue is primarily related to configuring or building pkg: Tpetra

Comments

@glhenni
Copy link
Contributor

glhenni commented Dec 3, 2018

@trilinos/Tpetra

Something on Mac OS X has removed the definition of "uint" from the GNU 8.2 compiler suite and now I'm getting errors during the compilation of tpetra. I don't believe "uint" is portable and should be replaced with the full "unsigned int", although in many cases it looks like it's not used correctly in tpetra. For instance, core/src/Tpetra_Import_Util2.hpp:235

auto NumRecvs                   = Distor.getNumReceives();
.
.
.
for(uint i=0,j=0;i<NumRecvs;i++){

In this case "uint i" should be replaced with "auto i" to be correct.

Your Environment

  • Relevant repo SHA1s: a6e9a58
  • Relevant configure flags or configure script:
  • Operating system and version: Mac OS X 10.12.6
  • Compiler and TPL versions: GNU 8.2.0
@jrood-nrel
Copy link

I'm seeing this for GCC 7.3.0 on Mac Sierra as well:

 6588    ...../trilinos-deve
             lop-cjcyqu2z6lplonewopytw667lmkqvjgx/Trilinos/packages/tpetra/core
             /src/Tpetra_Import_Util2.hpp: In function 'void Tpetra::Import_Uti
             l::reverseNeighborDiscovery(const Tpetra::CrsMatrix<Scalar, LocalO
             rdinal, GlobalOrdinal, Node>&, const Teuchos::ArrayRCP<const long 
             unsigned int>&, const Teuchos::ArrayRCP<const Packet>&, const Tpet
             ra::Details::Transfer<LocalOrdinal, GlobalOrdinal, Node>&, Teuchos
             ::RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> >, T
             euchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
             , Teuchos::ArrayRCP<int>&, Teuchos::ArrayRCP<T2>&, Teuchos::RCP<co
             nst Teuchos::Comm<int> >&)':
  >> 6589    ...../trilinos-deve
             lop-cjcyqu2z6lplonewopytw667lmkqvjgx/Trilinos/packages/tpetra/core
             /src/Tpetra_Import_Util2.hpp:251:9: error: 'uint' was not declared
              in this scope
     6590         for(uint i=0,j=0;i<NumRecvs;i++){
     6591             ^~~~
     6592    ...../trilinos-deve
             lop-cjcyqu2z6lplonewopytw667lmkqvjgx/Trilinos/packages/tpetra/core
             /src/Tpetra_Import_Util2.hpp:251:9: note: suggested alternative: '
             rint'
     6593         for(uint i=0,j=0;i<NumRecvs;i++){
     6594             ^~~~
     6595             rint
  >> 6596    ...../trilinos-deve
             lop-cjcyqu2z6lplonewopytw667lmkqvjgx/Trilinos/packages/tpetra/core
             /src/Tpetra_Import_Util2.hpp:251:22: error: 'i' was not declared i
             n this scope
     6597         for(uint i=0,j=0;i<NumRecvs;i++){

@mhoemmen mhoemmen added pkg: Tpetra impacting: configure or build The issue is primarily related to configuring or building labels Dec 3, 2018
@mhoemmen
Copy link
Contributor

mhoemmen commented Dec 3, 2018

@trilinos/tpetra Using auto there for the loop index could introduce a "signed/unsigned comparison" warning. The loop bound may be a size_t (unsigned), but auto i = 0 would produce an int.

@mhoemmen mhoemmen self-assigned this Dec 3, 2018
@bartlettroscoe bartlettroscoe added the stage: in progress Work on the issue has started label Dec 3, 2018
@mhoemmen
Copy link
Contributor

mhoemmen commented Dec 3, 2018

PR #3979 addresses this issue. Thanks for reporting!

trilinos-autotester added a commit that referenced this issue Dec 3, 2018
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Tpetra: Fix #3976 (build errors due to uint)
PR Author: mhoemmen
@bartlettroscoe bartlettroscoe removed the stage: in progress Work on the issue has started label Dec 4, 2018
tjfulle pushed a commit to tjfulle/Trilinos that referenced this issue Dec 6, 2018
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: Tpetra
Projects
None yet
Development

No branches or pull requests

4 participants