There are informations on how to build a bpy python module from blender source but, it does not work (for me) using Ubuntu x64 16.04LTS.
We need a working guidance !?
Building it up with: https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake
but use
sudo ./blender/build_files/build_environment/install_deps.sh
...and at the end:
cd ~/blender-git/blender
make bpy
or: different cmake config: https://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule
Problem:
- building blender bin is fine out of the box.
but make configs and also "make bpy" throws errors:
requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
some solution for this is to:
1.
build up python on your own with "enable-shared" and copy over libpython3.6m.a
sudo apt install build-essential checkinstall
sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
tar xvf Python-3.6.0.tar.xz
cd Python-3.6.0/
./configure --enable-shared
sudo make altinstall
and copy over libpython3.6m.a from /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a to /opt/lib/python-3.6/lib
BUT the main problem is
sudo ./blender/build_files/build_environment/install_deps.sh
which should behave the way to build python with fPIC right away !
2.
Answered from blendercoders chat: There is a pending fix for it: https://developer.blender.org/D3078 But not in master today.
still:
Question: Is it the purpose not to include folder "2.79" on "make bpy" so there are files missing -- compared to the ^^Ideasman42 config, is there a pending fix or is that "working as designed" - could it be made better!?