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

Also require C++14 when building gtest #3912

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

masterleinad
Copy link
Contributor

While building with XL, I also needed to request C++14 for building gtest to make that work. I don't see any real drawbacks since we require C++14 anyway.

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While building with XL, I also needed to request C++14 for building gtest to make that work.

Please elaborate

@masterleinad
Copy link
Contributor Author

masterleinad commented Mar 31, 2021

Please elaborate

Without this patch, I get

/sw/summit/xl/16.1.1-9/xlC/16.1.1/bin/xlc++ -x c++ -DGTEST_HAS_PTHREAD=0 -DGTEST_HAS_TR1_TUPLE=0 -I/ccs/home/darndt/kokkos/tpls/gtest -I/ccs/home/darndt/kokkos/build/core/unit_test -I/ccs/home/darndt/kokkos/core/unit_test -F /ccs/home/darndt/kokkos/build/my_xl_configuration -std=c++14 -D__cplusplus=201402L -g -std=gnu++11 -o CMakeFiles/kokkos_gtest.dir/__/__/tpls/gtest/gtest/gtest-all.cc.o -c /ccs/home/darndt/kokkos/tpls/gtest/gtest/gtest-all.cc
In file included from <built-in>:395:
<command line>:8:9: warning: '__cplusplus' macro redefined [-Wmacro-redefined]
#define __cplusplus 201402L
        ^
<built-in>:358:9: note: previous definition is here
#define __cplusplus 201103L
        ^
In file included from /ccs/home/darndt/kokkos/tpls/gtest/gtest/gtest-all.cc:39:
In file included from /ccs/home/darndt/kokkos/tpls/gtest/gtest/gtest.h:3074:
/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/iomanip:460:12: error: 
      'auto' return without trailing return type; deduced return types are a C++14 extension
    inline auto
           ^
/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/iomanip:469:12: error: 
      'auto' return without trailing return type; deduced return types are a C++14 extension
    inline auto
           ^
/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/iomanip:479:12: error: 
      'auto' return without trailing return type; deduced return types are a C++14 extension
    inline auto
           ^
In file included from /ccs/home/darndt/kokkos/tpls/gtest/gtest/gtest-all.cc:316:
In file included from /autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/algorithm:62:
/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/bits/stl_algo.h:3352:7: error: 
      statement not allowed in constexpr function
      while (__first != __last)
      ^
/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/bits/stl_algo.h:5459:7: error: 
      statement not allowed in constexpr function
      while (++__first != __last)
      ^
/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../include/c++/6.4.0/bits/stl_algo.h:5523:7: error: 
      statement not allowed in constexpr function
      while (++__first != __last)
      ^
1 warning and 6 errors generated.
Error while processing /ccs/home/darndt/kokkos/tpls/gtest/gtest/gtest-all.cc.

Of course, you can argue that I do all kinds of horrible things by specifying CMAKE_CXX_FLAGS=-std=c++14 -D__cplusplus=201402L but that's the only way I was able to convince XL to compile Kokkos.

@dalg24 dalg24 merged commit a18ad04 into kokkos:develop Mar 31, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants