apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.19k stars 1.14k forks source link

Building turicreate is broken with GCC 5.4.0 #3243

Open shreyajain17 opened 4 years ago

shreyajain17 commented 4 years ago
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

Running make -j8 on turicreate/debug breaks with following errors -

In file included from /home/shreya/turicreate/test/unity/toolkits/neural_net/test_combine_queue.cxx:10:0:
/home/shreya/turicreate/src/ml/neural_net/combine_queue.hpp: In instantiation of ‘void turi::neural_net::SubscribeOnQueuePublisher<T>::Proxy::Receive(std::shared_ptr<turi::neural_net::Subscription>) [with T = int]’:
/home/shreya/turicreate/test/unity/toolkits/neural_net/test_combine_queue.cxx:294:1:   required from here
/home/shreya/turicreate/src/ml/neural_net/combine_queue.hpp:72:13: error: ‘assert’ was not declared in this scope
       assert((downstream_));  // We cannot have been canceled yet.
             ^
/home/shreya/turicreate/src/ml/neural_net/combine_queue.hpp:72:13: note: suggested alternatives:
In file included from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/tools/assertion.hpp:23:0,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/test_tools.hpp:53,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/unit_test.hpp:18,
                 from /home/shreya/turicreate/test/unity/toolkits/neural_net/test_combine_queue.cxx:12:
/home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/mpl/assert.hpp:79:27: note:   ‘mpl_::assert’
 template< bool C >  struct assert        { typedef void* type; };
                           ^
/home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/mpl/assert.hpp:79:27: note:   ‘mpl_::assert’
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-tautological-compare’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-mismatched-tags’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]
cc1plus: all warnings being treated as errors
test/unity/toolkits/neural_net/CMakeFiles/test_combine_queue.cxxtest.dir/build.make:62: recipe for target 'test/unity/toolkits/neural_net/CMakeFiles/test_combine_queue.cxxtest.dir/test_combine_queue.cxx.o' failed
make[2]: *** [test/unity/toolkits/neural_net/CMakeFiles/test_combine_queue.cxxtest.dir/test_combine_queue.cxx.o] Error 1
CMakeFiles/Makefile2:17962: recipe for target 'test/unity/toolkits/neural_net/CMakeFiles/test_combine_queue.cxxtest.dir/all' failed
make[1]: *** [test/unity/toolkits/neural_net/CMakeFiles/test_combine_queue.cxxtest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/c++/5/bits/random.h:35:0,
                 from /usr/include/c++/5/random:49,
                 from /home/shreya/turicreate/src/toolkits/drawing_classifier/dc_data_iterator.hpp:11,
                 from /home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_prediction.cxx:9:
/usr/include/c++/5/bits/uniform_int_dist.h: In instantiation of ‘class std::uniform_int_distribution<float>’:
/home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_prediction.cxx:112:54:   required from here
/usr/include/c++/5/bits/uniform_int_dist.h:63:7: error: static assertion failed: template argument not an integral type
       static_assert(std::is_integral<_IntType>::value,
       ^
In file included from /usr/include/c++/5/bits/move.h:57:0,
                 from /usr/include/c++/5/bits/stl_pair.h:59,
                 from /usr/include/c++/5/bits/stl_algobase.h:64,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from /usr/include/c++/5/random:40,
                 from /home/shreya/turicreate/src/toolkits/drawing_classifier/dc_data_iterator.hpp:11,
                 from /home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_prediction.cxx:9:
/usr/include/c++/5/type_traits: In instantiation of ‘struct std::make_unsigned<float>’:
/usr/include/c++/5/bits/uniform_int_dist.h:223:57:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomNumberGenerator = std::linear_congruential_engine<long unsigned int, 16807ul, 0ul, 2147483647ul>; _IntType = float; std::uniform_int_distribution<_IntType>::result_type = float]’
/usr/include/c++/5/bits/uniform_int_dist.h:165:51:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = std::linear_congruential_engine<long unsigned int, 16807ul, 0ul, 2147483647ul>; _IntType = float; std::uniform_int_distribution<_IntType>::result_type = float]’
/home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_prediction.cxx:129:66:   required from here
/usr/include/c++/5/type_traits:1757:62: error: invalid use of incomplete type ‘class std::__make_unsigned_selector<float, false, false>’
     { typedef typename __make_unsigned_selector<_Tp>::__type type; };
                                                              ^
/usr/include/c++/5/type_traits:1721:11: note: declaration of ‘class std::__make_unsigned_selector<float, false, false>’
     class __make_unsigned_selector;
           ^
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-tautological-compare’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-mismatched-tags’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]
cc1plus: all warnings being treated as errors
test/unity/toolkits/drawing_classifier/CMakeFiles/test_dc_prediction.cxxtest.dir/build.make:62: recipe for target 'test/unity/toolkits/drawing_classifier/CMakeFiles/test_dc_prediction.cxxtest.dir/test_dc_prediction.cxx.o' failed
make[2]: *** [test/unity/toolkits/drawing_classifier/CMakeFiles/test_dc_prediction.cxxtest.dir/test_dc_prediction.cxx.o] Error 1
CMakeFiles/Makefile2:18671: recipe for target 'test/unity/toolkits/drawing_classifier/CMakeFiles/test_dc_prediction.cxxtest.dir/all' failed
make[1]: *** [test/unity/toolkits/drawing_classifier/CMakeFiles/test_dc_prediction.cxxtest.dir/all] Error 2
In file included from /usr/include/c++/5/bits/random.h:35:0,
                 from /usr/include/c++/5/random:49,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/smart_ptr/shared_ptr.hpp:39,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/shared_ptr.hpp:17,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/tools/assertion_result.hpp:21,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/tools/old/impl.hpp:20,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/test_tools.hpp:46,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/unit_test.hpp:18,
                 from /home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_evaluation.cxx:10:
/usr/include/c++/5/bits/uniform_int_dist.h: In instantiation of ‘class std::uniform_int_distribution<float>’:
/home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_evaluation.cxx:66:51:   required from here
/usr/include/c++/5/bits/uniform_int_dist.h:63:7: error: static assertion failed: template argument not an integral type
       static_assert(std::is_integral<_IntType>::value,
       ^
In file included from /usr/include/c++/5/bits/move.h:57:0,
                 from /usr/include/c++/5/bits/stl_pair.h:59,
                 from /usr/include/c++/5/bits/stl_algobase.h:64,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/utils/basic_cstring/bcs_char_traits.hpp:25,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/utils/basic_cstring/basic_cstring.hpp:21,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/detail/global_typedef.hpp:15,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/tree/observer.hpp:17,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/unit_test_log.hpp:18,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/tools/old/impl.hpp:19,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/test_tools.hpp:46,
                 from /home/shreya/turicreate/src/external/boost/boost_1_68_0/boost/test/unit_test.hpp:18,
                 from /home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_evaluation.cxx:10:
/usr/include/c++/5/type_traits: In instantiation of ‘struct std::make_unsigned<float>’:
/usr/include/c++/5/bits/uniform_int_dist.h:223:57:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomNumberGenerator = std::linear_congruential_engine<long unsigned int, 16807ul, 0ul, 2147483647ul>; _IntType = float; std::uniform_int_distribution<_IntType>::result_type = float]’
/usr/include/c++/5/bits/uniform_int_dist.h:165:51:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = std::linear_congruential_engine<long unsigned int, 16807ul, 0ul, 2147483647ul>; _IntType = float; std::uniform_int_distribution<_IntType>::result_type = float]’
/home/shreya/turicreate/test/unity/toolkits/drawing_classifier/test_dc_evaluation.cxx:58:44:   required from here
/usr/include/c++/5/type_traits:1757:62: error: invalid use of incomplete type ‘class std::__make_unsigned_selector<float, false, false>’
     { typedef typename __make_unsigned_selector<_Tp>::__type type; };
                                                              ^
/usr/include/c++/5/type_traits:1721:11: note: declaration of ‘class std::__make_unsigned_selector<float, false, false>’
     class __make_unsigned_selector;
           ^
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-tautological-compare’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-mismatched-tags’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]

However, you can build turicreate/debug/src

pradkrish commented 3 years ago

I am experiencing a similar problem while building the debug version on Ubuntu 20.04. My gcc version is 9.3.0. Here is the log

[ 62%] Building CXX object src/model_server/CMakeFiles/unity.dir/server/registration.cpp.o
In file included from /home/pradeep/repos/turicreate/src/core/storage/serialization/serialize.hpp:8,
                 from /home/pradeep/repos/turicreate/src/core/storage/serialization/serialization_includes.hpp:6,
                 from /home/pradeep/repos/turicreate/src/core/parallel/atomic.hpp:12,
                 from /home/pradeep/repos/turicreate/src/core/data/flexible_type/flexible_type.hpp:15,
                 from /home/pradeep/repos/turicreate/src/model_server/lib/toolkit_class_specification.hpp:10,
                 from /home/pradeep/repos/turicreate/src/model_server/lib/toolkit_class_registry.hpp:8,
                 from /home/pradeep/repos/turicreate/src/model_server/server/registration.hpp:9,
                 from /home/pradeep/repos/turicreate/src/model_server/server/registration.cpp:6:
/home/pradeep/repos/turicreate/src/core/storage/serialization/iarchive.hpp: In instantiation of ‘void turi::iarchive::read_into(T&) [with T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >]’:
/home/pradeep/repos/turicreate/src/core/storage/serialization/iarchive.hpp:242:9:   required from ‘static void turi::archive_detail::deserialize_impl<InArcType, T, true>::exec(InArcType&, T&) [with InArcType = turi::iarchive; T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >]’
/home/pradeep/repos/turicreate/src/core/storage/serialization/iarchive.hpp:257:65:   required from ‘turi::iarchive& turi::operator>>(turi::iarchive&, T&) [with T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >]’
/home/pradeep/repos/turicreate/src/core/util/hash_value.hpp:65:39:   required from here
/home/pradeep/repos/turicreate/src/core/storage/serialization/iarchive.hpp:120:15: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
  120 |         memcpy(&c, buf + off, sizeof(T));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pradeep/repos/turicreate/src/external/boost/boost_1_68_0/boost/multiprecision/cpp_int.hpp:12,
                 from /home/pradeep/repos/turicreate/src/core/util/int128_types.hpp:44,
                 from /home/pradeep/repos/turicreate/src/core/data/flexible_type/flexible_type.hpp:16,
                 from /home/pradeep/repos/turicreate/src/model_server/lib/toolkit_class_specification.hpp:10,
                 from /home/pradeep/repos/turicreate/src/model_server/lib/toolkit_class_registry.hpp:8,
                 from /home/pradeep/repos/turicreate/src/model_server/server/registration.hpp:9,
                 from /home/pradeep/repos/turicreate/src/model_server/server/registration.cpp:6:
/home/pradeep/repos/turicreate/src/external/boost/boost_1_68_0/boost/multiprecision/number.hpp:41:7: note: ‘class boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >’ declared here
   41 | class number
      |       ^~~~~~
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-mismatched-tags’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [src/model_server/CMakeFiles/unity.dir/build.make:63: src/model_server/CMakeFiles/unity.dir/server/registration.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3952: src/model_server/CMakeFiles/unity.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
pradkrish commented 3 years ago

I just noticed there is a PR out to fix this here. I will be very happy to have that one resolved. :pray: Also, is there a temporary workaround in the meanwhile (apart from disabling -Werror)?

TobyRoseman commented 3 years ago

I just noticed there is a PR to fix this here. I will be very happy to have that one resolved. 🙏 Also, is there a temporary workaround in the meanwhile (apart from disabling -Werror)?

@pradkrish - I think the temporary workaround would be to apply the changes (or at least the first commit) from the pull request you reference.

@hoytak - It's not clear to me what still needs to be done in that pull request. Can you take over the pull request?

pradkrish commented 3 years ago

Thanks, I rebased the branch on master locally and I was able to build the debug version. Then while running make to build C++ unit tests, it failed with the following error.

[ 79%] Building CXX object test/util/CMakeFiles/SpanTests.cxxtest.dir/SpanTests.cxx.o
In file included from /usr/include/c++/9/vector:67,
                 from /home/pradeep/repos/turicreate/src/core/util/Span.hpp:12,
                 from /home/pradeep/repos/turicreate/test/util/SpanTests.cxx:9:
/usr/include/c++/9/bits/stl_vector.h: In instantiation of ‘class std::vector<const int, std::allocator<const int> >’:
/home/pradeep/repos/turicreate/test/util/SpanTests.cxx:66:41:   required from here
/usr/include/c++/9/bits/stl_vector.h:398:66: error: static assertion failed: std::vector must have a non-const, non-volatile value_type
  398 |       static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
      |                                                                  ^~~~~
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-mismatched-tags’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [test/util/CMakeFiles/SpanTests.cxxtest.dir/build.make:63: test/util/CMakeFiles/SpanTests.cxxtest.dir/SpanTests.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8206: test/util/CMakeFiles/SpanTests.cxxtest.dir/all] Error 2
make: *** [Makefile:152: all] Error 2