Building Boost.Python

I am trying to create Boost.Python according to the instructions on the official website.

My OS is the 64-bit version of Windows 7, the compiler is MSVC11, the upgrade is 1.54.

==================== Install Boost ===================

To install basic Boost, I downloaded the boost library from my website, unzip it to a local drive. Path C:\local\boost_1_54_0 .

================ Install Boost.Python ================

Then I discovered that Boost.Python needs to be created separately. Therefore, I followed the Boost.Python instruction.

================ Install Boost.Build =================

And in step 3.1.2, Boost.Build is required. So I followed the steps again and set Boost.Build to C:\local\boost_1_54_0\BoostBuild and added C:\local\boost_1_54_0\BoostBuild\bin to the Path environment variable.

Then I got stuck in steps 3.1.3 and 3.1.4 where the instruction says

3.cd to the libs / python / example / quickstart / directory of your Boost installation, which contains a small sample project.

4.Invoke bjam. Replace the "stage" argument from the sample call from section 5 of the "test" Getting Started Guide to build all targets. Also add the argument --verbose-test to the result generated by the tests when they are run.

On Windows, your bjam call might look something like this:

C: \ boost_1_34_0 \ ... \ quickstart> bjam toolset = msvc --verbose-test test

I typed the command line, which the instruction told me, and I'm sure that I am in the correct directory. However, there is no bjam or b2 in the quickstart folder (they are in the root directory of Boost and C: \ local \ boost_1_54_0 \ BoostBuild \ bin).

I even tried to copy these two files to the quickstart folder, but it doesn’t work at all.

I'm not very familiar with the Windows control mechanism, so I'm not sure if the Path key is the key to my question. I think, after I add the bin folder to Path , will the OS automatically link my bjam toolset=msvc --verbose-test test with bjam in the C:\local\boost_1_54_0\BoostBuild\bin ?

Can someone help me with this? :)

+6
source share
1 answer

1.) Unzip boost_1_55_0.zip

2.) Get ready to use the Boost binary libraries

Go to the root directory of boost_1_55_0 and open a command prompt and enter the following commands:

 Bootstrap 

3.) Find user-config.jam:

Type the following at a command prompt:

 ECHO %HOMEDRIVE%%HOMEPATH% 

4.) If user-config.jam is in your homedrive directory, please change it there as follows:

ATTENTION:

The .jam language evaluates the "space" as a separation of arguments!

 # ------------------- # MSVC configuration. # ------------------- # Configure msvc (default version, searched for in standard locations and PATH). # using msvc ; # Configure specific msvc version (searched for in standard locations and PATH). using msvc : 10.0 : C:\\app\\tools\\MSVisualStudio2010\\VC\\bin\\cl.exe ; …. # --------------------- # Python configuration. # --------------------- # Configure specific Python version. # using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ; using python : 2.5 # Version : C:\\app\\tools\\Python25\\python.exe # Python Path : C:\\app\\tools\\Python25\\include # include path : C:\\app\\tools\\Python25\\libs # lib path(s) : <define>BOOST_ALL_NO_LIB=1 ; 

5.) Create Libraries AFTER configuration!

Go to the root directory of boost_1_55_0 and open a command prompt and enter the following commands:

 .\b2 

6.) Copy user-config.jam to \ boost_1_55_0 \ libs \ python \ example \ tutorial

7.) Go to \ boost_1_55_0 \ stage \ lib \

Rename libboost_python-vc100-mt-gd-1_55.lib to boost_python-vc100-mt-gd-1_55.lib and copy it to

 \boost_1_55_0\libs\python\example\tutorial 

8.) Now you should have all these files in the \ boost_1_55_0 \ libs \ python \ example \ tutorial directory

 hello.cpp hello.py user-config.jam Jamroot boost_python-vc100-mt-gd-1_55.lib bjam.exe 

9.) Open a command prompt in \ boost_1_55_0 \ libs \ python \ example \ tutorial

And enter the following command:

 bjam 

10.) After successful construction ..

You should have this file in the directory:

 hello_ext.dll 

rename this file:

 hello_ext.pyd 
+4
source

Source: https://habr.com/ru/post/954580/


All Articles