GithubHelp home page GithubHelp logo

Comments (16)

superphil0 avatar superphil0 commented on July 24, 2024 1

I managed to build boost python 3.4 64 bit lib and dll without problems I only set the env var for BOOST_ROOT and changed the config jam file to

import option ; 

using msvc : 12.0 ;
using python : 3.4 : C:\\Python34 ;

option.set keep-going : false ; 

and compiling with
.\bjam.exe --with-python address-model=64 variant=release link=shared --build-type=complete

I also managed to build dlib but with a lot of hassles, first i had to rename the libs in BOOST_LIBRARYDIR to "boost_python-py34" to satisfy the cmake module find of cmake
then while it was compiling (before linking) i copied the lib and dll to the build folder and renamed them to boost_python-vc120-mt-1_55.lib or dll

I am able to use your library now, so if you update the buildfile python3.4 dlib should be no problem

I suggest you add some documentation that clarifies the path's you are looking for boost in the add_python_module script, or better make a config file for the python build script

Additionally I suggest you add a requirements.txt for python that includes at least
scipy and numpy

This would make it much easier to start using your library with python 3.4

keep up the great work!

from dlib.

davisking avatar davisking commented on July 24, 2024

Well, you are ahead of the game because I haven't gotten boost.python to work on windows with anything but Python 2.7 32bit. However, that works with all versions of boost. I've only tried the precompiled boost binaries though. So as you say, I can imagine they are just not compiled correctly.

I also just tried compiling using python 3.4 on windows 8.1 with visual studio 2013 in 64bit mode and I get a linker error (just one error though). It's that boost::python::detail::init_module is missing and googling for this shows a bunch of people complaining about the same thing.

By the way, did you set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake? That should make it all work (aside from the eventual linker error because boost-python is broken). These variables need to be set to something like this:
BOOST_LIBRARYDIR=C:\local\boost_1_57_0\lib32-msvc-12.0
BOOST_ROOT=C:\local\boost_1_57_0

from dlib.

davisking avatar davisking commented on July 24, 2024

Thanks for the info. I just tweaked the cmake scripts so it's more straight forward to compile. In particular, I just tested it on linux with python 2.7 and 3.4 as well as on windows with your particular configuration as well as a few others and cmake now correctly builds everything (so long as BOOT_ROOT and BOOST_LIBRARYDIR env variables are set).

I also added cmake messages that print when boost.python isn't found and give instructions for compiling and setting up boost.python. If you pull from the repo you will get the new changes. Let me know if they don't work out.

from dlib.

shelper avatar shelper commented on July 24, 2024

i was able to compile under windows 64bit by following @superphil0 's comments above, and i get the dlib.pyd, however, when i import in python, i got "ImportError: DLL load failed: The specified module could not be found."
i also tried to copy dlib.pyd to the site-packages folder, but still not working, could you provide a little guidance here on how to install dlib.pyd for python?

thanks!

from dlib.

davisking avatar davisking commented on July 24, 2024

You are probably missing something from your path, maybe the boost dlls. The compile_dlib_python_module.bat should output the dlls that are needed. Make sure they are in your path or in the current working folder.

from dlib.

shelper avatar shelper commented on July 24, 2024

i found out that i need to rename the boost_python dll from boost_python to boost_python3, that saved me .

from dlib.

davisking avatar davisking commented on July 24, 2024

Huh, yeah, the filenames in boost and related python libraries are always changing. This makes it really hard to keep the cmake scripts working on all configurations. It's kinda aggravating.

What version of windows, visual studio, boost, and python are you using exactly? I'll see if I can roll in whatever changes are necessary to the cmake script to cover that configuration.

from dlib.

shelper avatar shelper commented on July 24, 2024

win 7 64bit, python3.4 64 bit, visual studio community version 2013, boost
1_58
it would be nice if there is a config file to setup for different
environment.

thanks!

On Wed, Aug 5, 2015 at 9:33 PM, Davis E. King [email protected]
wrote:

Huh, yeah, the filenames in boost and related python libraries are always
changing. This makes it really hard to keep the cmake scripts working on
all configurations. It's kinda aggravating.

What version of windows, visual studio, boost, and python are you using
exactly? I'll see if I can roll in whatever changes are necessary to the
cmake script to cover that configuration.


Reply to this email directly or view it on GitHub
#9 (comment).

warm regards

Zhijia Yuan

from dlib.

davisking avatar davisking commented on July 24, 2024

from dlib.

shelper avatar shelper commented on July 24, 2024

yes, i am using the most updated one

On Wed, Aug 5, 2015 at 9:58 PM, Davis E. King [email protected]
wrote:

Thanks, I'll see what I can do. The general idea is to make cmake just
work automatically regardless of the environment. Also, you are using dlib
18.16 right?


Reply to this email directly or view it on GitHub
#9 (comment).

warm regards

Zhijia Yuan

from dlib.

davisking avatar davisking commented on July 24, 2024

I've run through a few configurations but haven't been able to reproduce this. For example, I just did the following:

  • downloaded boost 1_58 and python 3.4.3 64bit
  • ran cmake inside dclib/python_examples/build and got an error about not being able to find boost. The error message has instructions for compiling boost which I followed. This resulted in a bunch of boost binaries in C:\local\boost_1_58_0\stage\lib.
  • Then I ran cmake again, selected the PYTHON3 option via cmake-gui
  • Then I ran cmake --build . --config release --target install and cmake built everything and put a dlib.pyd in the examples folder as well as the needed boost dlls.
  • Then from within dclib/python_examples I ran python svm_rank.py and it worked correctly.

What did you do?

from dlib.

shelper avatar shelper commented on July 24, 2024

i think the problem i have is that i am using vs2013, while the boost i
downloaded is not compiled by vs2013, that causes problem.
i build the boost myself and now everything seems to be fine.

still i think it would be very helpful if a notice can be put in the
installation manual so people like me can avoid these painful steps...

thanks :)

On Sat, Aug 15, 2015 at 12:12 PM, Davis E. King [email protected]
wrote:

I've run through a few configurations but haven't been able to reproduce
this. For example, I just did the following:

  • downloaded boost 1_58 and python 3.4.3 64bit
  • ran cmake inside dclib/python_examples/build and got an error about
    not being able to find boost. The error message has instructions for
    compiling boost which I followed. This resulted in a bunch of boost
    binaries in C:\local\boost_1_58_0\stage\lib.
  • Then I ran cmake again, selected the PYTHON3 option via cmake-gui
  • Then I ran cmake --build . --config release --target install and
    cmake built everything and put a dlib.pyd in the examples folder as well as
    the needed boost dlls.
  • Then from within dclib/python_examples I ran python svm_rank.py and
    it worked correctly.

What did you do?


Reply to this email directly or view it on GitHub
#9 (comment).

warm regards

Zhijia Yuan

from dlib.

shelper avatar shelper commented on July 24, 2024

did you download boost source code and compiled urself?
if not, why i have a different fold structure? i have my boost dll an lib
files in folder :
C:\local\boost_1_58_0\lib64-msvc-12.0

it seems to be a common problem for many OSS on windows....
what a pity. :(

On Thu, Aug 20, 2015 at 1:40 PM, zhijia yuan [email protected] wrote:

i think the problem i have is that i am using vs2013, while the boost i
downloaded is not compiled by vs2013, that causes problem.
i build the boost myself and now everything seems to be fine.

still i think it would be very helpful if a notice can be put in the
installation manual so people like me can avoid these painful steps...

thanks :)

On Sat, Aug 15, 2015 at 12:12 PM, Davis E. King [email protected]
wrote:

I've run through a few configurations but haven't been able to reproduce
this. For example, I just did the following:

  • downloaded boost 1_58 and python 3.4.3 64bit
  • ran cmake inside dclib/python_examples/build and got an error about
    not being able to find boost. The error message has instructions for
    compiling boost which I followed. This resulted in a bunch of boost
    binaries in C:\local\boost_1_58_0\stage\lib.
  • Then I ran cmake again, selected the PYTHON3 option via cmake-gui
  • Then I ran cmake --build . --config release --target install and
    cmake built everything and put a dlib.pyd in the examples folder as well as
    the needed boost dlls.
  • Then from within dclib/python_examples I ran python svm_rank.py and
    it worked correctly.

What did you do?


Reply to this email directly or view it on GitHub
#9 (comment).

warm regards

Zhijia Yuan

warm regards

Zhijia Yuan

from dlib.

davisking avatar davisking commented on July 24, 2024

from dlib.

tnusraddinov avatar tnusraddinov commented on July 24, 2024

After I compiled boost_1_59_0 version , I compile dlib-master for python (python setup.py install) from github I got error :

-- Could NOT find Boost
-- We couldn't find the right version of boost python. If you installed boost a
nd you are still getting this error then you might have installed a version of b
oost that was compiled with a different version of visual studio than the one yo
u are using. So you have to make sure that the version of visual studio is the
same version that was used to compile the copy of boost you are using.
-- Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake.

I set vars to
BOOST_LIBRARYDIR = C:\boost_1_59_0\stage\lib
BOOST_ROOT = C:\boost_1_59_0

What is wrong?

from dlib.

davisking avatar davisking commented on July 24, 2024

I have no idea.

from dlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.