Linux - make bpy link error

On Fedora, Ubuntu, Debian and Centos I am getting the following errors when trying to build Blender using make bpy.

[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX shared module ../../bin/bpy.so
/usr/bin/ld.gold: error: /blenderpy/lib/linux_centos7_x86_64/gmp/lib/libgmp.a(bdiv_q_1.o): requires dynamic R_X86_64_PC32 reloc against '__gmp_binvert_limb_table' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /blenderpy/lib/linux_centos7_x86_64/gmp/lib/libgmp.a(dive_1.o): requires dynamic R_X86_64_PC32 reloc against '__gmp_binvert_limb_table' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /blenderpy/lib/linux_centos7_x86_64/gmp/lib/libgmp.a(mode1o.o): requires dynamic R_X86_64_PC32 reloc against '__gmp_binvert_limb_table' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[3]: *** [source/creator/CMakeFiles/blender.dir/build.make:435: bin/bpy.so] Error 1
make[2]: *** [CMakeFiles/Makefile2:6489: source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: *** [Makefile:182: all] Error 2
make: *** [GNUmakefile:321: all] Error 2

Here are my Dockerfiles if it helps any.

Debian Dockerfile
FROM debian:sid-20200803

WORKDIR /blenderpy

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -y update
RUN apt-get -y install \
    build-essential \
    cmake \
    curl \
    g++ \
    gcc \
    git \
    libffi-dev \
    libglew-dev \
    libssl-dev \
    libx11-dev \
    libxxf86vm-dev \
    libxcursor-dev \
    libxi-dev \
    libxrandr-dev \
    libxinerama-dev \
    subversion \
    zlib1g-dev

ADD https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz Python-3.7.7.tgz
RUN tar xzf Python-3.7.7.tgz
RUN cd Python-3.7.7 && \
    ./configure --enable-optimizations
RUN cd Python-3.7.7 && \
    make install

RUN git clone https://git.blender.org/blender.git

RUN mkdir lib
RUN cd lib && \
    svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64

RUN cd blender && \
    make update
RUN cd blender && \
    make bpy
	
RUN cp /blenderpy/build_linux_bpy/bin/bpy.so /usr/local/lib/python3.7/site-packages
RUN cd /blenderpy/lib/linux_centos7_x86_64/python/lib/python3.7/site-packages && \
    find -maxdepth 1 -type d -exec cp -R {} /usr/local/lib/python3.7/site-packages/
	
CMD python3 -c "import bpy;print(dir(bpy.types));"
Fedora Dockerfile
FROM fedora:rawhide

WORKDIR /blenderpy

RUN sudo dnf -y update
RUN sudo dnf -y install \
    cmake \
    findutils \
    gcc \
    gcc-c++ \
    git \
    glew-devel \
    libffi-devel \
    libstdc++-static \
    libX11-devel \
    libXi-devel \
    libXcursor-devel \
    libXrandr-devel \
    libXinerama-devel \
    libXxf86vm-devel \
    make \
    openssl-devel \
    subversion \
    zlib-devel

ADD https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz Python-3.7.7.tgz
RUN tar xzf Python-3.7.7.tgz
RUN cd Python-3.7.7 && \
    ./configure --enable-optimizations
RUN cd Python-3.7.7 && \
    make install

RUN git clone https://git.blender.org/blender.git

RUN mkdir lib
RUN cd lib && \
    svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64

RUN cd blender && \
    make update
RUN cd blender && \
    make bpy
	
RUN cp /blenderpy/build_linux_bpy/bin/bpy.so /usr/local/lib/python3.7/site-packages
RUN mv /blenderpy/lib/linux_centos7_x86_64/python/lib/python3.7/site-packages/2.91 /usr/local/lib/python3.7/site-packages/
	
CMD python3 -c "import bpy;print(dir(bpy.types));"
CentOS Dockerfile
FROM quay.io/pypa/manylinux2014_x86_64

WORKDIR /blenderpy

RUN yum install -y \
    gcc \
    gcc-c++ \
    git \
    git-lfs \
    glew-devel \
    libffi-devel \
    libX11-devel \
    libXcursor-devel \
    libXi-devel \
    libXinerama-devel \
    libxml2-devel \
    libXrandr-devel \
    make \
    openssl-devel \
    subversion

ADD https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz Python-3.7.7.tgz
RUN tar xzf Python-3.7.7.tgz
RUN cd Python-3.7.7 && \
    ./configure --enable-optimizations
RUN cd Python-3.7.7 && \
    make install

RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-x86_64.tar.gz -o cmake-3.17.3-Linux-x86_64.tar.gz
RUN tar xzf cmake-3.17.3-Linux-x86_64.tar.gz
ENV PATH="/blenderpy/cmake-3.17.3-Linux-x86_64/bin:${PATH}"

RUN git clone https://git.blender.org/blender.git

RUN mkdir lib
RUN cd lib && \
    svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64

RUN cd blender && \
    make update
RUN cd blender && \
    make bpy
	
RUN cp /blenderpy/build_linux_bpy/bin/bpy.so /usr/local/lib/python3.7/site-packages
RUN mv /blenderpy/lib/linux_centos7_x86_64/python/lib/python3.7/site-packages/2.91 /usr/local/lib/python3.7/site-packages/
	
CMD python3 -c "import bpy;print(dir(bpy.types));"
Ubuntu Dockerfile
FROM ubuntu:groovy-20200812

WORKDIR /blenderpy

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -y update
RUN apt-get -y install \
    build-essential \
    cmake \
    curl \
    git \
    libffi-dev \
    libssl-dev \
    libx11-dev \
    libxxf86vm-dev \
    libxcursor-dev \
    libxi-dev \
    libxrandr-dev \
    libxinerama-dev \
    libglew-dev \
    subversion \
    zlib1g-dev

ADD https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz Python-3.7.7.tgz
RUN tar xzf Python-3.7.7.tgz
RUN cd Python-3.7.7 && \
    ./configure --enable-optimizations
RUN cd Python-3.7.7 && \
    make install

RUN git clone https://git.blender.org/blender.git

RUN mkdir lib
RUN cd lib && \
    svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64

RUN cd blender && \
    make update
RUN cd blender && \
    make bpy
	
RUN cp /blenderpy/build_linux_bpy/bin/bpy.so /usr/local/lib/python3.7/site-packages
RUN mv /blenderpy/lib/linux_centos7_x86_64/python/lib/python3.7/site-packages/2.91 /usr/local/lib/python3.7/site-packages/
	
CMD python3 -c "import bpy;print(dir(bpy.types));"

The main thing that I don’t understand is that this seems to me to be a static linking of libgmp, but I’m pretty sure that most of the libraries are forced to be static anyways from the make bpy recipie.

Many thanks in advance for any help or suggestions.

@sergey it seems this is needed for Linux too:
https://developer.blender.org/D8823

1 Like

Committed an updated version of libraries at SVN revision 62493.

2 Likes

Thanks @brecht & @sergey! My Dockerfiles now build flawlessly. I can’t thank you enough!

@sergey Sorry to be a bother but when will there be a tagged svn release with all the fixes?

Currently, on the most recent tag, the linking error still exists:

[100%] Building C object source/creator/CMakeFiles/blender.dir/creator_signals.c.o
[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX shared module ../../bin/bpy.so
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(team.o): unsupported reloc 23 against global symbol gomp_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(affinity.o): requires dynamic R_X86_64_PC32 reloc against 'stderr' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-init.o): unsupported reloc 23 against global symbol goacc_tls_data
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(affinity-fmt.o): requires dynamic R_X86_64_PC32 reloc against 'stderr' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(oacc-profiling.o): requires dynamic R_X86_64_PC32 reloc against 'acc_prof_lookup' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(env.o): requires dynamic R_X86_64_PC32 reloc against 'stderr' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/10/libgomp.a(error.o): requires dynamic R_X86_64_PC32 reloc against 'stderr' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[2]: *** [source/creator/CMakeFiles/blender.dir/build.make:503: bin/bpy.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:6941: source/creator/CMakeFiles/blender.dir/all] Error 2
make: *** [Makefile:182: all] Error 2
The command '/bin/sh -c cd build &&     make install' returned a non-zero code: 2

@TylerGubala, not sure what you mean by tag. Tag happens every release. The libraries are lareayd committed at the svn revision 62493 of the trunk (see https://developer.blender.org/rBL62493)

The error messages from your latest comment are different from the -fPIC ones.

Is the issue only limited to make bpy or also happens when building regular Blender as well (make sure you compile full feature set)?

Yes, I should have paid more attention to that, my mistake.

It is only limited to make bpy. When doing make full for instance it works fine on the 2.90 tag. make bpy works great on master, but I was just wondering when a tagged version would have a working build of bpy as a python module is all. Here’s the Dockerfile that produces the errors in the currently publicly released version 2.90:

Debian Dockerfile for `2.90`
FROM debian:sid-20200803

WORKDIR /blenderpy

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -y update
RUN apt-get -y install \
    build-essential \
    cmake \
    curl \
    g++ \
    gcc \
    git \
    libffi-dev \
    libglew-dev \
    libssl-dev \
    libx11-dev \
    libxxf86vm-dev \
    libxcursor-dev \
    libxi-dev \
    libxrandr-dev \
    libxinerama-dev \
    subversion \
    zlib1g-dev

ADD https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz Python-3.7.7.tgz
RUN tar xzf Python-3.7.7.tgz
RUN cd Python-3.7.7 && \
    ./configure --enable-optimizations
RUN cd Python-3.7.7 && \
    make install

RUN git clone https://git.blender.org/blender.git
RUN cd blender && \
    git checkout tags/v2.90.0 -b origin/master

RUN mkdir lib
RUN cd lib && \
    svn checkout https://svn.blender.org/svnroot/bf-blender/tags/blender-2.90-release/lib/linux_centos7_x86_64

RUN cd blender && \
    git submodule update --init --recursive
RUN cd blender && \
    make bpy
	
RUN cp /blenderpy/build_linux_bpy/bin/bpy.so /usr/local/lib/python3.7/site-packages
RUN mv /blenderpy/lib/linux_centos7_x86_64/python/lib/python3.7/site-packages/2.90 /usr/local/lib/python3.7/site-packages/
	
CMD python3 -c "import bpy;print(dir(bpy.types));"

I have a similar problem when trying to build the 2.83 release, but for me the current master branch works.

Those two things are unrelated, as soon as a release enters bcon3 the libraries will be branched for a release, and once a final release is made, the libraries (and code) will be tagged. This is a purely administrative process, the libs having a tag or not will not magically make any bpy as module build issues issues go away.

Given blenders as a bpy module’s unsupported status it is not being build on a regular basis , there is no CI for it, and no tests are performed on it. so these kinds of issues are unlikely to be noticed/fixed by the coredevs and would definitely not hold back a release (and the accompanying tagging) .

You’re somewhat dependent on the goodwill and time/motivation available from the coredevs here, and that tends to be hard to give estimates for.

I honestly don’t believe that tagging is going to “magically” make bpy build. I was just wondering if I could look forward to a tag that incidentally ships with a bpy recipe that builds.

I apologize if I overstepped some boundary here. I am not familiar with the administrative process that governs the release and subsequent tagging of Blender code and libraries.

Is there a particular reason why bpy doesn’t have any CI? Unsupported is understandable but just because CI fails for one (unsupported) part of a project doesn’t mean you have to hold back releasing the rest of it. It could just be worth it to know that the unsupported part builds or not.

Sorry if I am being a pain! I really appreciate that there is such a dedicated developer team for Blender, and that there are options to use it as a Python module!

Oh no bounds were overstepped, don’t worry about that! I though I’d educate you a little on our release process, so you don’t get all excited when we release/tag 2.91 and then have crushing disappointment when your build issues are still there :slight_smile:

1 Like

Fair point, thanks for the clarification!