pybind / pybind/pybind11

Undefined symbol when installing from source

Open
#1,762 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

I'm trying to build my C++ library in python. Everything work weel except for the source distributions. I can build wheels for windows an linux that work, but the result of '''python setup.py sdist' is not right.

I can install he package in ubuntu 16.04 LTS with pip and python 3.5 but I get an import error

typeinfo for ProjectName::ClassName

beeing ProjectName and ClassName the actual names of those elements.

My CMakeLists looks like this

cmake_minimum_required(VERSION 2.8.12)
project(projectname)
include_directories(SYSTEM ${project_INCLUDE_DIRS})
link_directories(${project_LIBRARY_DIRS})

FILE(GLOB PYBIND_SRC
./pybind.cpp
.
.)

FILE(GLOB EIGEN
.
.
.)

add_subdirectory(pybind11)
pybind11_add_module(projectname
${PYBIND_SRC}
${EIGEN}
)

The file structure is

project
|- .cpp
|- .h
eigen
|- eigen files
pybind
|- CMakeList.txt
|- Manifest.in
|- setup.py
|- projectname
|- - - pybind.cpp

In the setup.py file I have tried with the include_package_data and the package_data options, that didn't work either.

I'm pretty new using CMake and pybind/setuptools but I have searched and found nothing. I have tried including a target_link_libraries in the CMakeList file and moving the constructors to the header but it stil doesn't work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with setup.py, Manifest.in, and CMakeLists.txt; reproduce the source distribution with python setup.py sdist and inspect what it contains before installing it on Ubuntu 16.04 with Python 3.5. Compare the sdist build with the working wheels and trace the undefined typeinfo import involving pybind.cpp. Done means the source distribution installs and imports without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.