<div dir="ltr"><br clear="all"><div>Hello</div><div><br></div><div>I have some code for arm which I would like to use with boost. The boost libraries I am interested in are not header only and thus require building.</div><div><br></div><div>I have downloaded the boost tarfile and I have read the following two webpages relative but I am still confused. Here is a summary of the two urls and where I am confused.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><span id="docs-internal-guid-5aa00f54-3946-262e-09b5-192900a2ddf6"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="text-decoration:underline;font-size:15px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><a href="http://www.boost.org/doc/libs/1_56_0/more/getting_started/" style="text-decoration:none">http://www.boost.org/doc/libs/1_56_0/more/getting_started/</a></span></p><div><br></div><div>This url has the following procedure which seems to use the host default compiler to build boost.</div><div><br></div><div><span id="docs-internal-guid-5aa00f54-3948-0608-07c0-5d2955adb234"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Easy Method for Building and Installing Boost Binary Libraries.</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">step 1: $ cd $BOOST_DIR</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">step 2: $ ./bootstrap.sh --help</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">step 3: $ ./bootstrap.sh --prefix=path/to/installation/prefix</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">(</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;line-height:1.15;white-space:pre-wrap;background-color:transparent">Other docs specify for this step:</span></p><p dir="ltr" style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">$ ./b2 --build-dir=/tmp/build-boost toolset=gcc stage (optional --build-type=complete)</span></p><p dir="ltr" style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">Also says that --stagedir=/path/to/install/special/stage/target/library/binaries</span></p><p style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">I'm not certain what the stage components are or what the stage part is.</span></p><div><span style="vertical-align:baseline;background-color:transparent">)</span></div><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">$ ./b2 install “This will leave Boost binaries in the lib/ subdir of the installation prefix.”</span></p><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">The only customization mentioned here is for where you want your results to be placed.</span></div><div><span style="line-height:1.15;color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;background-color:transparent"><br></span></div><div><span style="line-height:1.15;color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;background-color:transparent">step 4: Add path/to/installation to my $PATH environment variable.</span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span id="docs-internal-guid-5aa00f54-3949-de39-486c-4df97cae8a62"><br><br><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><a href="http://www.boost.org/doc/libs/1_51_0/doc/html/bbv2/tasks.html#bbv2.tasks.crosscompile" style="line-height:1.15;text-decoration:none;background-color:transparent"><span style="text-decoration:underline;vertical-align:baseline;background-color:transparent">http://www.boost.org/doc/libs/1_51_0/doc/html/bbv2/tasks.html#bbv2.tasks.crosscompile</span></a><br></p><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">The section is on common tasks for boost build, in particular in the section is task on cross compilation.</span></p><div><span style="vertical-align:baseline;background-color:transparent"><br></span></div><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">Boost.Build supports cross compilation with gcc toolset.</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">When using gcc, you first need to specify your cross compiler in user-config.jam for example:</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;vertical-align:baseline;background-color:transparent">using gcc : arm : arm-none-linux-gnueabi-g++;</span></p><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div>This looks good, i'm thinking I need to edit a user-config.jam file.</span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">After that, if the host and target os are the same, for example linux, you can just repeat this compiler version to be used:</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;vertical-align:baseline;background-color:transparent">b2 toolset=gcc-arm</span></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent"><br></span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">Regarding the user-config.jam file. These are the notes I took while reading:</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><a href="http://www.boost.org/doc/libs/1_51_0/doc/html/bbv2/overview.html#bbv2.overview.configuration" style="text-decoration:none"><span style="text-decoration:underline;vertical-align:baseline;background-color:transparent">http://www.boost.org/doc/libs/1_51_0/doc/html/bbv2/overview.html#bbv2.overview.configuration</span></a></p><br><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;background-color:transparent">On startup, boost.build searches and reads two config files: site-config.jam and user-config.jam. Alternatively, the docs say you can edit the one at the top of the boost.build directory. In my case, I believe that would be $BOOST_DIR/tools/build/v2 directory rather than $BOOST_DIR. This directory has five .jam files: boost-build.jam, bootstrap.jam, build-system.jam, Jamroot.jam, site-config.jam and user-config.jam.</span></p><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span>Then I started thinking maybe editing this file will build boost.build for running on arm. I don't want to run boost.build on arm. I want it to use the cross compiler to build boost so that the libs will work with code that runs on arm.</span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span>Summary, this is what I think I need to do. Please correct me where I am wrong.</span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span>1. using the tarfile I've downloaded, copy the $BOOST_DIR/tools/build/v2/user-config.jam file to my /home/davis directory.</span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span>2. edit the ~/user-config.jam file (I wish I could put this file in the $BOOST_DIR tree rather than my home dir) to use the cross compilers I have in my /opt/arm directory.</span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span>3. With the /opt/arm/ compiler directory in my path and in the $BOOST_DIR/tools/build/v2 directory issue the commands to build boost</span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span>3.a. </span></span><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;background-color:transparent">$ ./bootstrap.sh --prefix=path/to/installation/prefix --with-toolset=gcc-arm</span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;background-color:transparent">3.b this should add a b2 program in the path/to/installation/prefix dir. /path/to/installation/prefix will actually be /opt/arm/boot.build. This should have the boost build tool I build that runs on intel but is set to build boost for arm.</span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;background-color:transparent">4. Change directory to $BOOST_DIR</span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;white-space:pre-wrap;line-height:1.15;background-color:transparent">4.a $ /path/to/installation/prefix/b2 </span><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;line-height:17.25px;white-space:pre-wrap">--build-dir=/tmp/build-boost toolset=gcc-arm or literally /opt/arm/boot.build/bin?/b2 -build-dir=/tmp/build-boost toolset=gcc-arm</span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:15px;line-height:17.25px;white-space:pre-wrap">4.c $ /path/to/installtion/prefix/b2 install</span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div><div><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><span><br></span></span></div></span></div><div><br></div></span></div>-- <br><div dir="ltr">John F. Davis<div>6 Kandes Court</div><div>Durham, NC 27713</div><div>919-888-8358</div><div><br>独树一帜<br><br><br></div></div> </div>