<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Noto Sans">Hi Daniel,</font></p>
<p><font face="Noto Sans">How did you obtain /opt/lib/python3.6? Are
you sure it's a 64-bit build? Did you build it yourself?<br>
</font></p>
<p><font face="Noto Sans">Cheers,</font></p>
<p><font face="Noto Sans">Sybren</font><br>
</p>
<br>
<div class="moz-cite-prefix">On 01/01/18 00:27, Daniel Savo wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAWVR_Ma7+C115SerbgYOBEg9xcEHBeymj6058AFB5LMyPnVYQ@mail.gmail.com">
<div dir="ltr"><b>Note</b>
<div>Apologies if this is not the right mailing list for this. I
went through the archives and found some similar questions,
but nothing that could help me with this issue. Willing to get
simple feedback or to pay someone to just do it for me.
<div><br>
</div>
<div><b>Problem</b></div>
<div>
<div>I've been trying to compile Blender as a python module
(following these instructions: <a
href="https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake"
moz-do-not-send="true">https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake</a>)
to no avail. I'm able to make an out-of-source build, but
once I do the changes in the "Building" section of those
instructions (and running "make" in the /build directory),
the build fails, and I'm unable to find a solution. I'm
running a 64-bit machine with Linux (Ubuntu 16.04.3). and
this is the relevant info that is outputted:</div>
<div><br>
</div>
<div><i>[ 98%] Building C object
source/creator/CMakeFiles/blender.dir/buildinfo.c.o</i></div>
<div><i>[ 98%] Linking CXX shared module ../../bin/bpy.so</i></div>
<div><i>/usr/bin/ld.gold: error:
/opt/lib/python-3.6/lib/libpython3.6m.a(abstract.o):
requires dynamic R_X86_64_PC32 reloc against
'PyType_IsSubtype' which may overflow at runtime;
recompile with -fPIC</i></div>
<div><i>/usr/bin/ld.gold: error:
/opt/lib/python-3.6/lib/libpython3.6m.a(boolobject.o):
requires dynamic R_X86_64_32 reloc which may overflow at
runtime; recompile with -fPIC</i></div>
<div><i>/usr/bin/ld.gold: error:
/opt/lib/python-3.6/lib/libpython3.6m.a(bytearrayobject.o):
requires dynamic R_X86_64_32 reloc against
'_PyByteArray_empty_string' which may overflow at
runtime; recompile with -fPIC</i></div>
<div><i>.</i></div>
<div><i>.</i></div>
<div><i>. (same error for other .o files)</i></div>
<div><i>.</i></div>
<div><i>.</i></div>
<div><i>/usr/bin/ld.gold: error:
/opt/lib/python-3.6/lib/libpython3.6m.a(getcompiler.o):
requires dynamic R_X86_64_32 reloc which may overflow at
runtime; recompile with -fPIC</i></div>
<div><i>collect2: error: ld returned 1 exit status</i></div>
<div><i>source/creator/CMakeFiles/blender.dir/build.make:363:
recipe for target 'bin/bpy.so' failed</i></div>
<div><i>make[2]: *** [bin/bpy.so] Error 1</i></div>
<div><i>CMakeFiles/Makefile2:7766: recipe for target
'source/creator/CMakeFiles/blender.dir/all' failed</i></div>
<div><i>make[1]: ***
[source/creator/CMakeFiles/blender.dir/all] Error 2</i></div>
<div><i>Makefile:160: recipe for target 'all' failed</i></div>
<div><i>make: *** [all] Error 2</i></div>
<div><br>
</div>
<div><b>Attempted Solutions</b></div>
<div>I tried adding -fPIC to the /blender/CMakeLists.txt
file as discussed here <a
href="https://stackoverflow.com/questions/36779834/compiling-blender-bpy-recompile-with-fpic"
moz-do-not-send="true">https://stackoverflow.com/questions/36779834/compiling-blender-bpy-recompile-with-fpic</a></div>
<div>I tried adding the CMAKE_POSITION_INDEPENDENT_CODE to
ON in /blender/CMakeLists.txt as discussed here <a
href="https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option"
moz-do-not-send="true">https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option</a></div>
<div>I tried changing everything to static linking as
discussed in the "Manual CMake Setup / Static Linking"
section here <a
href="https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake"
moz-do-not-send="true">https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake</a></div>
<div>This caused different issues with the boost library I
tried to address, but ended up giving up on this possible
path, thinking there isn't a specific need to static link
all dependencies, and avoid overcomplicating the situation
for myself.</div>
<div><b><br>
</b></div>
<div><b>Final Note</b></div>
<div>Given how I failed at all my attempts so far and I've
been able to waste 4 days on this, I'd be happy for any
insight I can get, or pay someone of the Blender community
to do this so I can get over this issue and continue with
the work I need to do. Just let me know.</div>
</div>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Daniel</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Bf-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-python@blender.org">Bf-python@blender.org</a>
<a class="moz-txt-link-freetext" href="https://lists.blender.org/mailman/listinfo/bf-python">https://lists.blender.org/mailman/listinfo/bf-python</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Sybren A. Stüvel
<a class="moz-txt-link-freetext" href="https://stuvelfoto.nl/">https://stuvelfoto.nl/</a>
<a class="moz-txt-link-freetext" href="https://stuvel.eu/">https://stuvel.eu/</a>
</pre>
</body>
</html>