Dlib: Undefined symbols with Python 3.5.1 (but not 2.7.11)

Created on 19 Feb 2016  路  1Comment  路  Source: davisking/dlib

Thank you for all of your hard work, especially when supporting those of us with Macs.

I'm having some trouble compiling/installing dlib on my Macbook Pro OS X 10.11.3 and it seems to be hanging up at the very end of compilation with Python 3.5.1. I had no issue installing it on Python 2.7.11. Boost-python was installed with brew install boost-python --with-python3

I've tried installing with pip install git+git://github.com/davisking/dlib.git, as well as cloning the repo and compiling using python setup.py install. It seems to make it through everything until the final linking.

Here's the pertinent cmake output:

Configuring cmake ...
-- The C compiler identification is AppleClang 7.0.2.7000181
-- The CXX compiler identification is AppleClang 7.0.2.7000181
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Boost
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   python
-- Found PythonLibs: /usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib (found suitable version "3.5.1", minimum required is "3.4")
-- USING BOOST_LIBS: /usr/local/lib/libboost_python-mt.dylib
-- USING PYTHON_LIBS: /usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib
-- Enabling SSE4 instructions
-- Looking for png_create_read_struct
-- Looking for png_create_read_struct - found
-- Looking for jpeg_read_header
-- Looking for jpeg_read_header - found
-- Searching for BLAS and LAPACK
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Found LAPACK library
-- Found CBLAS library
-- Looking for cblas_ddot
-- Looking for cblas_ddot - found
-- Check for STD namespace
-- Check for STD namespace - found
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/code/dlib/tools/python/build
Build using cmake ...

And here's where it ends up dying:

[100%] Linking CXX shared library dlib.so
Undefined symbols for architecture x86_64:
  "boost::python::detail::init_module(PyModuleDef&, void (*)())", referenced from:
      _PyInit_dlib in dlib.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [dlib.so] Error 1
make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2
make: *** [all] Error 2
error: cmake build failed!

Any ideas what could be the issue?

Most helpful comment

Looks like I solved my own issue... Turns out that boost-python was still being linked to python2, so reinstalling it with brew reinstall boost-python --with-python3 --without-python allowed me to compile dlib.

>All comments

Looks like I solved my own issue... Turns out that boost-python was still being linked to python2, so reinstalling it with brew reinstall boost-python --with-python3 --without-python allowed me to compile dlib.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

srikanthreddybethi picture srikanthreddybethi  路  4Comments

farazirfan47 picture farazirfan47  路  5Comments

AeroClassics picture AeroClassics  路  4Comments

unicorn7t picture unicorn7t  路  3Comments

AivanF picture AivanF  路  4Comments