我用的是win10上的Ubuntu虚拟机(18.04)
bazel版本是最新的4.2.2
https://blog.csdn.net/qq_36959443/article/details/116136965
运行这一行命令bazel build -c opt :encoder_main
前面很多已经完成编译,最后这八个显示一直无法编译
ERROR: /home/sshh/lyra/lyra-main/BUILD:600:11: Compiling lyra_components.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 60 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/com_google_audio_dsp/audio/dsp/spectrogram/spectrogram.h:42:0,
from log_mel_spectrogram_extractor_impl.h:27,
from lyra_components.cc:25:
./sparse_matmul/vector/cache_aligned_vector.h: In member function 'int csrblocksparse::CacheAlignedVector<DataType>::ScalarSample(float, std::minstd_rand*, csrblocksparse::CacheAlignedVector<float>*, int, int, int, csrblocksparse::SpinBarrier*) const':
./sparse_matmul/vector/cache_aligned_vector.h:448:27: warning: comparison of constant '0' with boolean expression is always true [-Wbool-compare]
DCHECK(size_ > mindex >= 0);
~~~~~~~~~~~~~~~^~~~
bazel-out/k8-opt/bin/external/com_google_glog/_virtual_includes/glog/glog/logging.h:681:5: note: in definition of macro 'LOG_IF'
!(condition) ? (void) 0 : google::LogMessageVoidify() & LOG(severity)
^~~~~~~~~
bazel-out/k8-opt/bin/external/com_google_glog/_virtual_includes/glog/glog/logging.h:696:21: note: in expansion of macro 'GOOGLE_PREDICT_BRANCH_NOT_TAKEN'
LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-opt/bin/external/com_google_glog/_virtual_includes/glog/glog/logging.h:1344:29: note: in expansion of macro 'CHECK'
GLOG_MSVC_POP_WARNING() CHECK(condition)
^~~~~
./sparse_matmul/vector/cache_aligned_vector.h:448:5: note: in expansion of macro 'DCHECK'
DCHECK(size_ > mindex >= 0);
^~~~~~
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 lyra_components.h:21,
from lyra_components.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; <template-parameter-1-2> = <missing>]':
/usr/include/c++/7/type_traits:889:35: required from 'struct std::__is_default_constructible_impl<chromemedia::codec::LayerParams::FromDisk>'
/usr/include/c++/7/type_traits:143:12: required from 'struct std::__and_<std::__not_<std::is_void<chromemedia::codec::LayerParams::FromDisk> >, std::__is_default_constructible_impl<chromemedia::codec::LayerParams::FromDisk> >'
/usr/include/c++/7/type_traits:893:12: required from 'struct std::__is_default_constructible_atom<chromemedia::codec::LayerParams::FromDisk>'
/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<chromemedia::codec::LayerParams::FromDisk>'
/usr/include/c++/7/type_traits:2979:25: required from 'constexpr const bool std::is_default_constructible_v<chromemedia::codec::LayerParams::FromDisk>'
/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
Target //:encoder_main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.124s, Critical Path: 2.01s
INFO: 5 processes: 5 internal.
FAILED: Build did NOT complete successfully
无法成功编译