Skip to content

Error running test.py: undefined reference to pybind11 #8

@zghodsi

Description

@zghodsi

I am getting the following error when running test.py:

/tmp/tmpgop0gw3c/minionn/lib/.rendered.minionn.o: In function `bool std::operator==<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)':
/usr/include/c++/6/bits/basic_string.h:5101: undefined reference to `pybind11::format_descriptor<long, void>::value'
/usr/bin/ld: /tmp/tmpgop0gw3c/minionn/lib/.rendered.minionn.o: relocation R_X86_64_PC32 against undefined hidden symbol `_ZN8pybind1117format_descriptorIlvE5valueE' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1

I verified the cppimport and pybind11 installation with the example in https://github.com/tbenthompson/cppimport, and pulled a mirrored SEAL v2.3.1 which is the version mentioned in the README. Other package versions are cmake (3.13.2) and gcc/g++ (6.3.0).

Here is my Dockerfile for reproducing the error:

FROM debian:stable

RUN apt-get update && apt-get install -y --no-install-suggests --no-install-recommends \
    git vim libssl-dev python3 python3-pip python3-dev libgmp-dev libglib2.0-dev build-essential make

# Get a newer version of cmake for SEAL (>3.10)
RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list && \
 apt-get update && apt-get -t stretch-backports install -y "cmake" 

RUN git clone https://github.com/SSGAalto/minionn && cd minionn && \
    git submodule update --init --recursive && cd lib && make all

# Get SEAL 2.3.1
RUN cd minionn/lib && git clone https://github.com/deeptechlabs/SEAL \
    && cd SEAL/SEAL && echo "set(CMAKE_POSITION_INDEPENDENT_CODE ON)" >> CMakeLists.txt && cmake . \
    && make && make install 

RUN apt-get install -y python3-setuptools
RUN pip3 install pybind11 cppimport onnx
RUN cd /minionn/lib/ && python3 test.py

I'd appreciate it if you could help me resolve this issue and create the correct environment for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions