0
$\begingroup$

I'm following these instructions to build Blender from source as a Python module. As I need to share my build with others in a different runtime environment, I need to build it with static linking.

I did

cmake ../blender -DPYTHON_LIBRARY="/home/anaconda3/envs/project/lib/libpython3.6m.a" -DPYTHON_INCLUDE_DIR="/home/anaconda3/envs/project/include/python3.6m" -DOPENIMAGEIO_LIBRARY="$HOME/blender-deps/built/oiio/lib/libOpenImageIO.so" -DOPENIMAGEIO_INCLUDE_DIR="$HOME/blender-deps/built/oiio/include" -DWITH_PYTHON_MODULE=ON -DWITH_PYTHON_INSTALL=OFF -DWITH_STATIC_LIBS=ON
make -j; make install

and failed at the very end

[100%] Building C object source/creator/CMakeFiles/blender.dir/creator_args.c.o
[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX shared module ../../bin/bpy.so
lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: /usr/bin/c++ returned 1 exit status
compilation terminated.
/usr/bin/ld.gold: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
source/creator/CMakeFiles/blender.dir/build.make:319: recipe for target 'bin/bpy.so' failed
make[2]: *** [bin/bpy.so] Error 1
CMakeFiles/Makefile2:7690: recipe for target 'source/creator/CMakeFiles/blender.dir/all' failed
make[1]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

This error is too obscure for me to figure out what is wrong.

$\endgroup$
  • 2
    $\begingroup$ I'm voting to close this question because compiling custom versions of blender is off topic here. Best place to ask would be devtalk.blender.org. $\endgroup$ – sambler Jun 15 '19 at 11:13
1
$\begingroup$

The most relevant line here is:

lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005 Please submit a full bug report

The compiler has hit code that caused it to fail. It's not possible to continue this build without fixing the compiler, or changing compilers.

I encourage you to submit a bug report. gcc-7 is still widely deployed and this will definitely get looked at.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.