-
Notifications
You must be signed in to change notification settings - Fork 2
Boost.Python compilation
Zakant edited this page Jun 21, 2017
·
2 revisions
- Download the latest boost from http://www.boost.org/users/download/.
- Extract everything wherever you want to have boost.
NOTE: If you use MSVC from VisualStudio 2017 start a Developer Command Prompt
as otherwise the build will not work.
- Start a
Developer Command Prompt
or a normal command prompt and go to the boost directory. - Run
bootstrap.bat
. This will compile the boost build tools and prepare everyting for the real build. -
b2.exe
andbjam.exe
should now be present in the boost directory.
Make sure your python version matches the boost version you are going to build. Python x64 is required for Boost.Python x64.
- First copy
.\tools\build\example\user-config.jam
to.\user-config.jam
. - Open the newly made copy with a text editor.
- In the last line (starting with
# using python : ...
) remove the#
character. - Change the settings so that they look like this:
using python : 3.6 : <PythonPath> : <PythonPath>\\include : <PythonPath>\\libs ;
. Make sure to use\\
on windows machines to escape the backslash.
- Change back to the command prompt.
- Run
bjam --user-config=user-config.jam --with-python python-debugging=off threading=multi link=shared variant=release address-model=64 stage
. This will compile python and put the resulting files into.\stage\lib
. - By removing
address-model=64
from the call, the x86 version is build. By removinglink=shared
from the call the static version is build. However this seems to be not-working with python. - Rename
boost_python3-vc141-mt-1_64.lib
toboost_python-vc141-mt-1_64.lib
(remove the3
). Otherwise the compiler will not be able to find it. The.dll
must keep the 3 in the name.