microsoft / ADBench

Benchmarking various AD tools.
MIT License
107 stars 39 forks source link

Compilation fails due to deprecation and -Werror #203

Open athas opened 3 years ago

athas commented 3 years ago

Following the installation instructions I run

$ cmake -DCMAKE_BUILD_TYPE=Release ..

This fails with a long error log, but the salient points seem to be that it tries to build something that specifies -Werror and also uses deprecated functions, which causes a warning:

...
/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock-matchers.h:432:67: error: implicitly-declared ‘testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >::EndsWithMatcher(const testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >&)’ is deprecated [-Werror=deprecated-copy]
  432 |   explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
      |                                                                   ^
In file included from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googletest/include/gtest/internal/gtest-linked_ptr.h:74,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/internal/gmock-port.h:53,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/internal/gmock-generated-internal-utils.h:44,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/internal/gmock-internal-utils.h:45,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock-actions.h:46,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock.h:58,
                 from /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/src/gmock-all.cc:40:
/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googletest/include/gtest/internal/gtest-port.h:908:8: note: because ‘testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >’ has user-provided ‘void testing::internal::EndsWithMatcher<StringType>::operator=(const testing::internal::EndsWithMatcher<StringType>&) [with StringType = std::__cxx11::basic_string<wchar_t>]’
  908 |   void operator=(type const &)
      |        ^~~~~~~~
/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest/Source/googlemock/include/gmock/gmock-matchers.h:1320:3: note: in expansion of macro ‘GTEST_DISALLOW_ASSIGN_’
 1320 |   GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
      |   ^~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock.dir/build.make:95: googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock_main.dir/build.make:95: googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o] Error 1
[ 63%] Linking CXX static library libgtest.a
make[4]: *** [CMakeFiles/Makefile2:164: googlemock/CMakeFiles/gmock.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [CMakeFiles/Makefile2:137: googlemock/CMakeFiles/gmock_main.dir/all] Error 2
[ 63%] Built target gtest
make[3]: *** [Makefile:160: all] Error 2
make[2]: *** [CMakeFiles/GTest-Release.dir/build.make:134: GTest-Release-prefix/src/GTest-Release-stamp/GTest-Release-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:153: CMakeFiles/GTest-Release.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/c3d4bf9/ef173c2/2d4f59d/Build/GTest
[hunter ** FATAL ERROR **] [Directory:/home/athas/repos/ADBench/etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/projects/GTest]

------------------------------ ERROR -----------------------------
    https://docs.hunter.sh/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_download.cmake:617 (hunter_fatal_error)
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/projects/GTest/hunter.cmake:244 (hunter_download)
  etc/HunterGate-Root-awf/_Base/Download/Hunter/0.23.177/c3d4bf9/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:80 (hunter_add_package)

-- Configuring incomplete, errors occurred!
See also "/home/athas/repos/ADBench/my-build/CMakeFiles/CMakeOutput.log"

I can provide the whole log if needed, but it's mostly the same thing on repeat, so I don't think there is another root cause.

I'm using GCC 10.2.0.

athas commented 3 years ago

Using cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF .. skips the problematic package (GTest) and allows cmake to finish.

toelli-msft commented 3 years ago

@acl33 Is this the same issue that you came across?

dcrc2 commented 3 years ago

It looks like this would be fixed by using a more recent version of googletest: see https://github.com/google/googletest/pull/2815

toelli-msft commented 3 years ago

Thanks for spotting that. We should give it a go.