google / lyra

A Very Low-Bitrate Codec for Speech Compression
Apache License 2.0
3.83k stars 354 forks source link

failure in building Lyra #55

Closed shoham5 closed 3 years ago

shoham5 commented 3 years ago

I am building Lyra on Ubuntu 18.04.1 for Linux. The bazel version that I have is 4.0.0 (although I have tried with 4.1.0 as well). The gcc/g++ version that I have is 7.5.0.

The error appears to be that bazel is invoking gcc with -std=c++0x, yet calling in functionalies that are only supported starting C++17.

Any help would be appreciated.

In file included from layer_wrapper.h:29:0, from conv1d_layer_wrapper.h:27, from layer_wrappers_lib.h:21, from causal_convolutional_conditioning.h:28, from wavegru_model_impl.h:28, from wavegru_model_impl.cc:15: layer_wrapper_interface.h: At global scope: layer_wrapper_interface.h:82:8: error: 'variant' in namespace 'std' does not name a template type std::variant<FromDisk, FromConstant> from = FromDisk();

aluebs commented 3 years ago

Yes, C++17 is definitely needed. Have you tried passing a compiler option to set the standard library?.

mchinen commented 3 years ago

Also, let us know how you are calling bazel build. The standard should be set automatically to -std=gnu++17 from the .bazelrc file.

shoham5 commented 3 years ago

Hi,

Thank you for the pointer. I was somehow missing the .bazelrc file. After downloading a clean version, most errors have been resolved. There is still this error that I am not sure how to handle:

In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/memory:62, from wavegru_model_impl.h:21, from wavegru_model_impl.cc:15: /usr/include/c++/7/type_traits: In substitution of 'template<class _Tp, class> static std::true_type std::do_is_default_constructible_impl::test(int) [with _Tp = chromemedia::codec::LayerParams::FromDisk; = ]': /usr/include/c++/7/type_traits:889:35: required from 'struct std::is_default_constructible_impl' /usr/include/c++/7/type_traits:143:12: required from 'struct std::and_<std::not_<std::is_void >, std::is_default_constructible_impl >' /usr/include/c++/7/type_traits:893:12: required from 'struct std::is_default_constructible_atom' /usr/include/c++/7/type_traits:914:12: required from 'struct std::is_default_constructible_safe<chromemedia::codec::LayerParams::FromDisk, false>' /usr/include/c++/7/type_traits:920:12: required from 'struct std::is_default_constructible' /usr/include/c++/7/type_traits:2979:25: required from 'constexpr const bool std::is_default_constructible_v' /usr/include/c++/7/variant:889:2: required from 'class std::variant<chromemedia::codec::LayerParams::FromDisk, chromemedia::codec::LayerParams::FromConstant>' layer_wrapper_interface.h:82:56: required from here /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'chromemedia::codec::LayerParams::FromDisk::path' has been parsed template<typename _Tp, typename = decltype(_Tp())> ^~~~~ /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'chromemedia::codec::LayerParams::FromDisk::zipped' has been parsed

aluebs commented 3 years ago

That seems like an error compiling a C++7 header file, not part of the Lyra library.

shoham5 commented 3 years ago

Thank you. when upgrading gcc to 8.4.0 problem solved.