C++: internal compiler error: Killed (program cc1plus)


#1

Hi, Build failed (install from source) as below:

  • default cmake config
  • gcc: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
  • Target: x86_64-linux-gnu
yuens@iZ280qnmzdzZ:~/code/tvm-20190513/build$ cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SUPPORT_CXX11
-- Performing Test SUPPORT_CXX11 - Success
-- Build with RPC support...
-- Build with Graph runtime support...
-- Build VTA runtime with target: sim
-- Build with contrib.sort
-- Build with contrib.hybriddump
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yuens/code/tvm-20190513/build
yuens@iZ280qnmzdzZ:~/code/tvm-20190513/build$ make 
Scanning dependencies of target tvm
[  0%] Building CXX object CMakeFiles/tvm.dir/src/api/api_pass.cc.o
[  1%] Building CXX object CMakeFiles/tvm.dir/src/api/api_schedule.cc.o
[  1%] Building CXX object CMakeFiles/tvm.dir/src/api/api_lang.cc.o
[  1%] Building CXX object CMakeFiles/tvm.dir/src/api/api_test.cc.o
[  2%] Building CXX object CMakeFiles/tvm.dir/src/api/api_base.cc.o
[  2%] Building CXX object CMakeFiles/tvm.dir/src/api/api_codegen.cc.o
[  2%] Building CXX object CMakeFiles/tvm.dir/src/api/api_arith.cc.o
[  3%] Building CXX object CMakeFiles/tvm.dir/src/api/dsl_api.cc.o
[  3%] Building CXX object CMakeFiles/tvm.dir/src/api/api_ir.cc.o
[  3%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/rewrite_simplify.cc.o
[  4%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/stmt_simplify.cc.o
[  4%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/bound_deducer.cc.o
[  4%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/analyzer.cc.o
[  5%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/detect_linear_equation.cc.o
[  5%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/const_int_bound.cc.o
[  5%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/domain_touched.cc.o
[  6%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/modular_set.cc.o
[  6%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/int_set.cc.o
[  6%] Building CXX object CMakeFiles/tvm.dir/src/arithmetic/canonical_simplify.cc.o
[  7%] Building CXX object CMakeFiles/tvm.dir/src/autotvm/feature_visitor.cc.o
[  7%] Building CXX object CMakeFiles/tvm.dir/src/autotvm/touch_extractor.cc.o
[  7%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_source_base.cc.o
[  8%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule_metal.cc.o
[  8%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule_opencl.cc.o
[  8%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_metal.cc.o
[  9%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_cuda.cc.o
[  9%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule_cuda.cc.o
[  9%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen.cc.o
[ 10%] Building CXX object CMakeFiles/tvm.dir/src/codegen/source_module.cc.o
[ 10%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule.cc.o
[ 10%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule_opengl.cc.o
[ 11%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule_vhls.cc.o
[ 11%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_c.cc.o
[ 11%] Building CXX object CMakeFiles/tvm.dir/src/codegen/build_module.cc.o
[ 12%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_c_host.cc.o
[ 12%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_aocl.cc.o
[ 12%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_opengl.cc.o
[ 13%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_vhls.cc.o
[ 13%] Building CXX object CMakeFiles/tvm.dir/src/codegen/intrin_rule_aocl.cc.o
[ 13%] Building CXX object CMakeFiles/tvm.dir/src/codegen/codegen_opencl.cc.o
[ 14%] Building CXX object CMakeFiles/tvm.dir/src/lang/target_info.cc.o
[ 14%] Building CXX object CMakeFiles/tvm.dir/src/lang/expr_operator.cc.o
[ 14%] Building CXX object CMakeFiles/tvm.dir/src/lang/buffer.cc.o
[ 15%] Building CXX object CMakeFiles/tvm.dir/src/lang/lowered_func.cc.o
[ 15%] Building CXX object CMakeFiles/tvm.dir/src/lang/api_registry.cc.o
[ 15%] Building CXX object CMakeFiles/tvm.dir/src/lang/ir.cc.o
[ 16%] Building CXX object CMakeFiles/tvm.dir/src/lang/data_layout.cc.o
[ 16%] Building CXX object CMakeFiles/tvm.dir/src/lang/channel.cc.o
[ 16%] Building CXX object CMakeFiles/tvm.dir/src/lang/tensor.cc.o
[ 17%] Building CXX object CMakeFiles/tvm.dir/src/lang/reflection.cc.o
[ 17%] Building CXX object CMakeFiles/tvm.dir/src/lang/expr.cc.o
[ 17%] Building CXX object CMakeFiles/tvm.dir/src/lang/attrs.cc.o
[ 18%] Building CXX object CMakeFiles/tvm.dir/src/pass/rewrite_unsafe_select.cc.o
[ 18%] Building CXX object CMakeFiles/tvm.dir/src/pass/ir_deep_compare.cc.o
[ 18%] Building CXX object CMakeFiles/tvm.dir/src/pass/unroll_loop.cc.o
[ 19%] Building CXX object CMakeFiles/tvm.dir/src/pass/loop_partition.cc.o
[ 19%] Building CXX object CMakeFiles/tvm.dir/src/pass/narrow_channel_access.cc.o
[ 19%] Building CXX object CMakeFiles/tvm.dir/src/pass/vectorize_loop.cc.o
[ 20%] Building CXX object CMakeFiles/tvm.dir/src/pass/storage_access.cc.o
[ 20%] Building CXX object CMakeFiles/tvm.dir/src/pass/arg_binder.cc.o
[ 20%] Building CXX object CMakeFiles/tvm.dir/src/pass/verify_memory.cc.o
[ 21%] Building CXX object CMakeFiles/tvm.dir/src/pass/storage_sync.cc.o
[ 21%] Building CXX object CMakeFiles/tvm.dir/src/pass/ir_visitor.cc.o
[ 21%] Building CXX object CMakeFiles/tvm.dir/src/pass/storage_rewrite.cc.o
[ 22%] Building CXX object CMakeFiles/tvm.dir/src/pass/bound_checker.cc.o
[ 22%] Building CXX object CMakeFiles/tvm.dir/src/pass/detect_device.cc.o
[ 22%] Building CXX object CMakeFiles/tvm.dir/src/pass/lift_attr_scope.cc.o
[ 23%] Building CXX object CMakeFiles/tvm.dir/src/pass/remove_no_op.cc.o
[ 23%] Building CXX object CMakeFiles/tvm.dir/src/pass/lower_thread_allreduce.cc.o
[ 23%] Building CXX object CMakeFiles/tvm.dir/src/pass/inject_virtual_thread.cc.o
[ 24%] Building CXX object CMakeFiles/tvm.dir/src/pass/ir_mutator.cc.o
[ 24%] Building CXX object CMakeFiles/tvm.dir/src/pass/make_api.cc.o
[ 24%] Building CXX object CMakeFiles/tvm.dir/src/pass/lower_intrin.cc.o
[ 25%] Building CXX object CMakeFiles/tvm.dir/src/pass/remap_thread_axis.cc.o
[ 25%] Building CXX object CMakeFiles/tvm.dir/src/pass/lower_warp_memory.cc.o
[ 25%] Building CXX object CMakeFiles/tvm.dir/src/pass/inject_double_buffer.cc.o
[ 26%] Building CXX object CMakeFiles/tvm.dir/src/pass/lower_tvm_builtin.cc.o
[ 26%] Building CXX object CMakeFiles/tvm.dir/src/pass/inject_copy_intrin.cc.o
[ 26%] Building CXX object CMakeFiles/tvm.dir/src/pass/ssa.cc.o
[ 27%] Building CXX object CMakeFiles/tvm.dir/src/pass/verify_gpu_code.cc.o
[ 27%] Building CXX object CMakeFiles/tvm.dir/src/pass/simple_passes.cc.o
[ 27%] Building CXX object CMakeFiles/tvm.dir/src/pass/split_host_device.cc.o
[ 28%] Building CXX object CMakeFiles/tvm.dir/src/pass/inline.cc.o
[ 28%] Building CXX object CMakeFiles/tvm.dir/src/pass/inject_prefetch.cc.o
[ 28%] Building CXX object CMakeFiles/tvm.dir/src/pass/split_pipeline.cc.o
[ 29%] Building CXX object CMakeFiles/tvm.dir/src/pass/storage_flatten.cc.o
[ 29%] Building CXX object CMakeFiles/tvm.dir/src/pass/coproc_sync.cc.o
[ 29%] Building CXX object CMakeFiles/tvm.dir/src/pass/ir_util.cc.o
[ 30%] Building CXX object CMakeFiles/tvm.dir/src/pass/combine_context_call.cc.o
[ 30%] Building CXX object CMakeFiles/tvm.dir/src/op/tensorize.cc.o
[ 30%] Building CXX object CMakeFiles/tvm.dir/src/op/tensor_compute_op.cc.o
[ 31%] Building CXX object CMakeFiles/tvm.dir/src/op/compute_op.cc.o
[ 31%] Building CXX object CMakeFiles/tvm.dir/src/op/op_util.cc.o
[ 31%] Building CXX object CMakeFiles/tvm.dir/src/op/extern_op.cc.o
[ 32%] Building CXX object CMakeFiles/tvm.dir/src/op/hybrid_op.cc.o
[ 32%] Building CXX object CMakeFiles/tvm.dir/src/op/placeholder_op.cc.o
[ 32%] Building CXX object CMakeFiles/tvm.dir/src/op/scan_op.cc.o
[ 33%] Building CXX object CMakeFiles/tvm.dir/src/op/cross_thread_reduction.cc.o
[ 33%] Building CXX object CMakeFiles/tvm.dir/src/schedule/graph.cc.o
[ 33%] Building CXX object CMakeFiles/tvm.dir/src/schedule/schedule_dataflow_rewrite.cc.o
[ 34%] Building CXX object CMakeFiles/tvm.dir/src/schedule/schedule_ops.cc.o
[ 34%] Building CXX object CMakeFiles/tvm.dir/src/schedule/auto_inline_elem_wise.cc.o
[ 34%] Building CXX object CMakeFiles/tvm.dir/src/schedule/bound.cc.o
[ 35%] Building CXX object CMakeFiles/tvm.dir/src/schedule/message_passing.cc.o
[ 35%] Building CXX object CMakeFiles/tvm.dir/src/schedule/schedule_lang.cc.o
[ 35%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/nn/pooling.cc.o
[ 36%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/nn/convolution.cc.o
[ 36%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/nn/nn.cc.o
[ 36%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/nn/upsampling.cc.o
[ 37%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/nn/pad.cc.o
[ 37%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/debug.cc.o
[ 37%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/device_copy.cc.o
[ 38%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/type_relations.cc.o
[ 38%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/annotation/annotation.cc.o
[ 38%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/vision/multibox_op.cc.o
[ 39%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/vision/nms.cc.o
[ 39%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/vision/yolo.cc.o
[ 39%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/vision/rcnn_op.cc.o
[ 40%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/algorithm/sort.cc.o
[ 40%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/image/resize.cc.o
[ 40%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/tensor/binary.cc.o
[ 41%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/tensor/unary.cc.o
[ 41%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/tensor/reduce.cc.o
[ 41%] Building CXX object CMakeFiles/tvm.dir/src/relay/op/tensor/transform.cc.o
[ 42%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/param_dict.cc.o
[ 42%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/build_module.cc.o
[ 42%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/interpreter.cc.o
[ 43%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/graph_runtime_codegen.cc.o
[ 43%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/graph_plan_memory.cc.o
[ 43%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/compile_engine.cc.o
[ 44%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/vm/compiler.cc.o
[ 44%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/vm/lambda_lift.cc.o
[ 44%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/vm/inline_primitives.cc.o
[ 45%] Building CXX object CMakeFiles/tvm.dir/src/relay/backend/vm/vm.cc.o
[ 45%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/error.cc.o
[ 45%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/base.cc.o
[ 46%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/alpha_equal.cc.o
[ 46%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/expr_functor.cc.o
[ 46%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/doc.cc.o
[ 47%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/hash.cc.o
[ 47%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/pattern_functor.cc.o
[ 47%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/op.cc.o
[ 48%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/module.cc.o
[ 48%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/type_functor.cc.o
[ 48%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/pretty_printer.cc.o
[ 49%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/expr.cc.o
[ 49%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/type.cc.o
[ 49%] Building CXX object CMakeFiles/tvm.dir/src/relay/ir/adt.cc.o
[ 50%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/eliminate_common_subexpr.cc.o
[ 50%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/kind_check.cc.o
[ 50%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/device_annotation.cc.o
[ 51%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/type_infer.cc.o
[ 51%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/mac_count.cc.o
[ 51%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/dead_code.cc.o
[ 52%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/eta_expand.cc.o
[ 52%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/fuse_ops.cc.o
[ 52%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/dependency_graph.cc.o
[ 53%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/quantize.cc.o
[ 53%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/canonicalize_ops.cc.o
[ 53%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/simplify_inference.cc.o
[ 54%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/type_solver.cc.o
[ 54%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/to_a_normal_form.cc.o
[ 54%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/alter_op_layout.cc.o
[ 55%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/fold_scale_axis.cc.o
[ 55%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/util.cc.o
[ 55%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/well_formed.cc.o
[ 56%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/combine_parallel_conv2d.cc.o
[ 56%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/fold_constant.cc.o
[ 56%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/to_graph_normal_form.cc.o
[ 57%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/gradient.cc.o
[ 57%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/expr_subst.cc.o
[ 57%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/pass_manager.cc.o
[ 58%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/partial_eval.cc.o
[ 58%] Building CXX object CMakeFiles/tvm.dir/src/relay/pass/forward_rewrite.cc.o
[ 58%] Building CXX object CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/ModulusRemainder.cpp.o
[ 59%] Building CXX object CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Deinterleave.cpp.o
[ 59%] Building CXX object CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Interval.cpp.o
[ 59%] Building CXX object CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Substitute.cpp.o
[ 60%] Building CXX object CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Simplify.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
make[2]: *** [CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Simplify.cpp.o] Error 4
make[1]: *** [CMakeFiles/tvm.dir/all] Error 2
make: *** [all] Error 2

Have any idea? Thanks in advance.


#2

It’s a bug in the C++ compiler. Try installing a newer GCC or clang. I’m not sure about GCC, but if you download prebuilt binaries from the LLVM website, you can just unpack them into some directory and use them from there (no need to do a system-wide install).


#3

I downloaded pre-built clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04 and set USE_LLVM as ON. Same issue after rebuilding.

yuens@iZ280qnmzdzZ:~/code/tvm-20190513/build$ make 
[  0%] Building CXX object CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Simplify.cpp.o

c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
make[2]: *** [CMakeFiles/tvm.dir/3rdparty/HalideIR/src/arithmetic/Simplify.cpp.o] Error 4
make[1]: *** [CMakeFiles/tvm.dir/all] Error 2
make: *** [all] Error 2

#4

Do you have enough memory? You may try increasing swap size


#5

Did you set the compiler to be llvm by setting flags like CMAKE_C_COMPILER and CMAKE_CXX_COMPILER?


#6

Because it looks like cc1plus is still gcc not clang


#7

Thanks your reply. I’m not sure whether due to short swap size, maybe I’ll have a try.


#8

Very thanks your reply. I changed a PC and build successfully