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

cmake should enforce compiler version #24932

Closed
gm100861 opened this issue Dec 8, 2020 · 6 comments
Closed

cmake should enforce compiler version #24932

gm100861 opened this issue Dec 8, 2020 · 6 comments

Comments

@gm100861
Copy link

gm100861 commented Dec 8, 2020

OS: CentOS Linux release 7.6.1810 (Core)

# uname -a
Linux 172.16.54.23-linux-robot-app 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

cmake params:

cmake  -DgRPC_INSTALL=ON \
       -DCMAKE_BUILD_TYPE=Release \
       -DgRPC_PROTOBUF_PROVIDER=package \
       -DgRPC_SSL_PROVIDER=package

make error:

[ 26%] Linking CXX executable regexp_benchmark
[ 26%] Built target required_prefix_test
[ 26%] Linking CXX static library libabsl_examine_stack.a
[ 26%] Building CXX object third_party/abseil-cpp/absl/random/CMakeFiles/absl_random_internal_pool_urbg.dir/internal/pool_urbg.cc.o
[ 26%] Built target regexp_benchmark
[ 26%] Linking CXX executable grpc_php_plugin
[ 26%] Building CXX object third_party/abseil-cpp/absl/random/CMakeFiles/absl_random_internal_distribution_test_util.dir/internal/distribution_test_util.cc.o
[ 26%] Built target absl_examine_stack
[ 26%] Building CXX object third_party/abseil-cpp/absl/status/CMakeFiles/absl_status.dir/status_payload_printer.cc.o
[ 26%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_synchronization.dir/blocking_counter.cc.o
[ 26%] Building CXX object third_party/abseil-cpp/absl/debugging/CMakeFiles/absl_failure_signal_handler.dir/failure_signal_handler.cc.o
[ 26%] Built target grpc_php_plugin
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/cord.h:83:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/status/internal/status_internal.h:20,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/status/status.h:58,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/status/status.cc:14:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/types/optional.h:119:7: warning: unused parameter ‘src’ [-Wunused-parameter]
 class optional : private optional_internal::optional_data<T>,
       ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/status/status.cc: In lambda function:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/status/status.cc:301:25: note: synthesized method ‘absl::lts_2020_09_23::optional<T>& absl::lts_2020_09_23::optional<T>::operator=(absl::lts_2020_09_23::optional<T>&&) [with T = std::basic_string<char>]’ first required here 
     if (printer) result = printer(type_url, payload);
                         ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc: In instantiation of ‘std::string absl::lts_2020_09_23::flags_internal::UnparseFloatingPointVal(T) [with T = float; std::string = std::basic_string<char>]’:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:193:64:   required from here
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:179:66: error: no matching function for call to ‘StrFormat(const char [5], const int&, float&)’
       absl::StrFormat("%.*g", std::numeric_limits<T>::digits10, v);
                                                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:179:66: note: candidate is:
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:33:0:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template<class ... Args> std::string absl::lts_2020_09_23::StrFormat(absl::lts_2020_09_23::FormatSpec<Args ...>&, const Args& ...)
 ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec<Args...>& format,
                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note:   template argument deduction/substitution failed:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:179:66: note:   mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [5]’
       absl::StrFormat("%.*g", std::numeric_limits<T>::digits10, v);
                                                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:191:73: error: no matching function for call to ‘StrFormat(const char [5], const int&, float&)’
   return absl::StrFormat("%.*g", std::numeric_limits<T>::max_digits10, v);
                                                                         ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:191:73: note: candidate is:
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:33:0:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template<class ... Args> std::string absl::lts_2020_09_23::StrFormat(absl::lts_2020_09_23::FormatSpec<Args ...>&, const Args& ...)
 ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec<Args...>& format,
                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note:   template argument deduction/substitution failed:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:191:73: note:   mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [5]’
   return absl::StrFormat("%.*g", std::numeric_limits<T>::max_digits10, v);
                                                                         ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc: In instantiation of ‘std::string absl::lts_2020_09_23::flags_internal::UnparseFloatingPointVal(T) [with T = double; std::string = std::basic_string<char>]’:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:194:65:   required from here
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:179:66: error: no matching function for call to ‘StrFormat(const char [5], const int&, double&)’
       absl::StrFormat("%.*g", std::numeric_limits<T>::digits10, v);
                                                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:179:66: note: candidate is:
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:33:0:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template<class ... Args> std::string absl::lts_2020_09_23::StrFormat(absl::lts_2020_09_23::FormatSpec<Args ...>&, const Args& ...)
 ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec<Args...>& format,
                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note:   template argument deduction/substitution failed:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:179:66: note:   mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [5]’
       absl::StrFormat("%.*g", std::numeric_limits<T>::digits10, v);
                                                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:191:73: error: no matching function for call to ‘StrFormat(const char [5], const int&, double&)’
   return absl::StrFormat("%.*g", std::numeric_limits<T>::max_digits10, v);
                                                                         ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:191:73: note: candidate is:
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:33:0:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template<class ... Args> std::string absl::lts_2020_09_23::StrFormat(absl::lts_2020_09_23::FormatSpec<Args ...>&, const Args& ...)
 ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec<Args...>& format,
                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note:   template argument deduction/substitution failed:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:191:73: note:   mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [5]’
   return absl::StrFormat("%.*g", std::numeric_limits<T>::max_digits10, v);
                                                                         ^
[ 26%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_synchronization.dir/internal/create_thread_identity.cc.o
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc: In function ‘std::string absl::lts_2020_09_23::flags_internal::UnparseFloatingPointVal(T) [with T = float; std::string = std::basic_string<char>]’:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:192:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc: In function ‘std::string absl::lts_2020_09_23::flags_internal::UnparseFloatingPointVal(T) [with T = double; std::string = std::basic_string<char>]’:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/flags/marshalling.cc:192:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
[ 26%] Linking CXX static library libabsl_flags_private_handle_accessor.a
make[2]: *** [third_party/abseil-cpp/absl/flags/CMakeFiles/absl_flags_marshalling.dir/marshalling.cc.o] Error 1
make[1]: *** [third_party/abseil-cpp/absl/flags/CMakeFiles/absl_flags_marshalling.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 26%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_synchronization.dir/internal/per_thread_sem.cc.o
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h:19:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/civil_time.h:76,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/time.h:88,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/clock.h:26,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h:33,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/mutex.h:71,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/blocking_counter.h:24,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc:15:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h:26:5: warning: "__cpp_constexpr" is not defined [-Wundef]
 #if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
     ^
[ 26%] Linking CXX executable grpc_python_plugin
[ 26%] Built target absl_flags_private_handle_accessor
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h:19:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/civil_time.h:76,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/time.h:88,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/clock.h:26,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h:33,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h:32,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc:27:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h:26:5: warning: "__cpp_constexpr" is not defined [-Wundef]
 #if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
     ^
[ 26%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_synchronization.dir/internal/waiter.cc.o
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc: In function ‘std::ostream& absl::lts_2020_09_23::random_internal::operator<<(std::ostream&, const absl::lts_2020_09_23::random_internal::DistributionMoments&)’:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc:77:66: error: no matching function for call to ‘StrFormat(const char [45], const double&, double, const double&, const double&)’
                                moments.skewness, moments.kurtosis);
                                                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc:77:66: note: candidate is:
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc:25:0:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note: template<class ... Args> std::string absl::lts_2020_09_23::StrFormat(absl::lts_2020_09_23::FormatSpec<Args ...>&, const Args& ...)
 ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec<Args...>& format,
                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/strings/str_format.h:338:34: note:   template argument deduction/substitution failed:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc:77:66: note:   mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [45]’
                                moments.skewness, moments.kurtosis);
                                                                  ^
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc:78:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h:19:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/civil_time.h:76,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/time.h:88,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/clock.h:26,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h:33,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h:32,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc:19:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h:26:5: warning: "__cpp_constexpr" is not defined [-Wundef]
 #if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
     ^
make[2]: *** [third_party/abseil-cpp/absl/random/CMakeFiles/absl_random_internal_distribution_test_util.dir/internal/distribution_test_util.cc.o] Error 1
make[1]: *** [third_party/abseil-cpp/absl/random/CMakeFiles/absl_random_internal_distribution_test_util.dir/all] Error 2
[ 26%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_synchronization.dir/notification.cc.o
[ 26%] Linking CXX static library libabsl_random_internal_pool_urbg.a
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h:19:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/civil_time.h:76,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/time.h:88,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/clock.h:26,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h:33,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/waiter.h:39,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc:15:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h:26:5: warning: "__cpp_constexpr" is not defined [-Wundef]
 #if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
     ^
[ 26%] Built target grpc_python_plugin
[ 26%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_synchronization.dir/mutex.cc.o
[ 26%] Linking CXX static library libabsl_failure_signal_handler.a
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h:19:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/civil_time.h:76,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/time.h:88,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/clock.h:26,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h:33,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/mutex.h:71,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/notification.h:56,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/notification.cc:15:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h:26:5: warning: "__cpp_constexpr" is not defined [-Wundef]
 #if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
     ^
[ 26%] Built target absl_random_internal_pool_urbg
[ 27%] Linking CXX executable grpc_objective_c_plugin
In file included from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h:19:0,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/civil_time.h:76,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/time.h:88,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/clock.h:26,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h:33,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/mutex.h:71,
                 from /usr/local/src/grpc-framework/third_party/abseil-cpp/absl/synchronization/mutex.cc:15:
/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h:26:5: warning: "__cpp_constexpr" is not defined [-Wundef]
 #if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
     ^
[ 27%] Built target absl_failure_signal_handler
[ 28%] Linking CXX executable grpc_ruby_plugin
[ 28%] Linking CXX executable grpc_node_plugin
[ 28%] Built target grpc_objective_c_plugin
[ 28%] Linking CXX executable grpc_csharp_plugin
[ 28%] Built target grpc_ruby_plugin
[ 28%] Built target grpc_node_plugin
[ 28%] Linking CXX static library libabsl_status.a
[ 28%] Built target grpc_csharp_plugin
[ 28%] Built target absl_status
[ 28%] Linking CXX executable re2_test
[ 28%] Built target re2_test
[ 28%] Linking CXX static library libabsl_synchronization.a
[ 28%] Built target absl_synchronization
[ 28%] Linking CXX executable grpc_cpp_plugin
[ 28%] Built target grp
@gm100861
Copy link
Author

gm100861 commented Dec 8, 2020

/usr/local/src/grpc-framework/third_party/abseil-cpp/absl/random/internal/distribution_test_util.cc:77:66: error: no matching function for call to ‘StrFormat(const char [45], const double&, double, const double&, const double&)’

@stanley-cheung
Copy link
Contributor

what's your gcc --version?

@h1z1
Copy link

h1z1 commented Jan 5, 2021

Same error with gcc 4.8.5. Fine with 4.9.2, 5.3.1 and 7.3.1 (CentOS). Docs do indeed state gcc 4.9+ as a requirement however cmake does not check for it.

@markdroth markdroth changed the title centos 7.8 make error cmake should enforce compiler version Jan 12, 2021
@BusyJay
Copy link
Contributor

BusyJay commented Feb 24, 2021

Note the default compiler on CentOS 7 is still 4.8, it would make life easier to keep compatible with older version.

@lhusker
Copy link

lhusker commented Feb 25, 2021

Same error with gcc 4.8.5. Fine with 4.9.2, 5.3.1 and 7.3.1 (CentOS). Docs do indeed state gcc 4.9+ as a requirement however cmake does not check for it.

I've managed to compile it on RHEL7(CentOS7) with Devtoolset 8 (GCC 8.2.1) from https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/
Using:
cmake -DgRPC_INSTALL=ON
-DgRPC_BUILD_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=/my/path/to/grpc
../..
make -j2 # (for my spec. system)

@stale
Copy link

stale bot commented Jun 2, 2021

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@stale stale bot closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants