halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.86k stars 1.07k forks source link

Fails to compile with GCC 7.2.0 #2713

Open jwfromm opened 6 years ago

jwfromm commented 6 years ago

Trying to compile the Halide master python bindings with GCC 7.2.0 on Ubuntu 16.04 (Python 3.6, GCC) gives the following error:

lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
0xae2c81 lto_tag_to_tree_code
        ../../src/gcc/lto-streamer.h:1005
0xae2c81 streamer_alloc_tree(lto_input_block*, data_in*, LTO_tags)
        ../../src/gcc/tree-streamer-in.c:583
0x82b520 lto_read_tree
        ../../src/gcc/lto-streamer-in.c:1356
0x82b520 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
        ../../src/gcc/lto-streamer-in.c:1475
0x59d30e lto_read_decls
        ../../src/gcc/lto/lto.c:1781
0x59eb63 lto_file_finalize
        ../../src/gcc/lto/lto.c:2040
0x59eb63 lto_create_files_from_ids
        ../../src/gcc/lto/lto.c:2050
0x59eb63 lto_file_read
        ../../src/gcc/lto/lto.c:2091
0x59eb63 read_cgraph_and_symbols
        ../../src/gcc/lto/lto.c:2803
0x59eb63 lto_main()
        ../../src/gcc/lto/lto.c:3308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Makefile:36: recipe for target '/Halide/python_bindings/bin/halide.so' failed
make: *** [/Halide/python_bindings/bin/halide.so] Error 1
jwfromm commented 6 years ago

What configuration works to build the python bindings for Python 3.6 on Ubuntu?

jwfromm commented 6 years ago

Turns out adding -fno-lto to the LDFLAGS resolves this issue.

lunaryan commented 5 years ago

I met this problem when compiling libxml in Linux. I tried this but it doesn't work. Then I add --disable-shared when ./configure, everything goes normal.