Changes between Initial Version and Version 1 of Boost_Build_Standalone


Ignore:
Timestamp:
Sep 3, 2007, 1:58:27 PM (15 years ago)
Author:
Peter Foley
Comment:

Added section on running a standalone instance of Boost Build

Legend:

Unmodified
Added
Removed
Modified
  • Boost_Build_Standalone

    v1 v1  
     1= IMPORTANT THIS IS CURRENTLY A WORK IN PROGRESS AND MIGHT BE INCORRECT =
     2
     3
     4
     5
     6= How do I run Boost Build standalone from the Boost distribution =
     7
     8== Useful Links used throughout this document ==
     9 * Boost Build Homepage - http://www.boost.org/tools/build/index.html
     10   This is the authoritative resource for all things related to Boost Build.
     11
     12 * Boost Build Nightly Build Snapshot
     13  * Zip - http://boost.org/boost-build2/boost-build.zip
     14  * tar.bz2 - http://boost.org/boost-build2/boost-build.tar.bz2
     15
     16 * Boost Build documentation - http://www.boost.org/doc/html/bbv2.html
     17
     18== Assumptions ==
     19
     20 * Throughout this document I will be using the "3 September 2007" file downloaded from the Nightly Build link from http://www.boost.org/tools/build/v2/index.html
     21 * This document is written for the Windows platform.  It should be simple enough to substitute platform specific commands or concepts.
     22 * My setup is using Visual Studio 2005
     23
     24== Definitions ==
     25 * BJAM - In the interests of typing less I have shortened Boost.Build to this.
     26
     27== Compiling BJAM ==
     28
     291. Since BJAM is fairly stable I advise downloading the latest nightly build of BJAM. 
     30
     31Regardless of the version you use as long as you can find the location of the source code for BJAM the following steps should work.  Once you have your copy of BJAM extract the file to a location of your choice.  For documentation convenance I have extracted it to "E:\dev\tools\boost_build" (Please be aware to adjust the folder paths I supply to reflect the location you have extracted your files to).
     32
     33????? Include Attachment here (001 - Extraction Location.PNG)
     34
     352. I then followed the build documentation provided at http://www.boost.org/doc/html/bbv2/installation.html.
     36
     37A brief synopsis is as follows:
     38 i) Open a command prompt that sets the necessary environment to run your compiler from the command line (for me this was the "Visual Studio 2005 Command Prompt")
     39 ii) Navigate to the jam source location (for me this was "E:\dev\tools\boost-build\jam_src")
     40 iii) Execute the build.bat file
     41
     42At the completion of the above steps you should now have two new folders within the jam_src folder (namely "bootstrap" and "bin.ntx86")
     43
     44????? Include Attachment here (002 - After Compiling Two new folders.PNG)
     45
     46BJAM has now been built.
     47
     48== Setting up BJAM for use ==
     49
     503. Hopefully after step 2 you should now have a compiled version of BJAM located within the "bin.ntx86" directory.  To more easily allow for using BJAM against stable or development toolsets I move the BJAM executable to a seperate location.  To do this I create a e:\dev\tools\bjam\bin directory and then move bjam.exe to this location.  To do this I run these commands:
     51
     52 i) mkdir ..\..\..\bjam\bin
     53 ii) copy bjam.exe ..\..\..\bjam\bin
     54
     55????? Include Attachment here (003 - Copy BJAM to BIN.PNG)
     56
     57I also like to keep things neat so I also delete the "bootstrap" and bin.ntx86" folders as they are no longer needed.
     58
     594. Navigate to the bjam\bin directory and execute bjam.exe
     60
     61As you can see from the output of the command bjam.exe is complaining that it cannot find the "boost-build.jam" file
     62
     63????? Include Attachment here (004 - BJAM installed output.PNG)
     64
     65To fix this error we need to let bjam.exe know where the Boost Build directory is with the information it needs to be able to run.  To do this copy the "boost-build.jam" file from "E:\dev\tools\boost-build" to "E:\dev\tools\bjam".
     66
     67Next edit the "boost-build.jam" file you just copied and change it to read: "boost-build E:/dev/tools/boost-build ;".
     68
     69At this point it is useful explaining why I have seperated the "bjam.exe" file and the "boost-build.jam" files.  To provide some sanity with my development environment I periodically download the nightly snapshot (maybe once every quarter or bug fix I need).  If I am planning to migrate to a newer nightly build or want to test against the trunk of the Boost Software Library I just need to download the latest sources from Boost Subversion repository and update the "boost-build.jam" file located within "E:\dev\tools\bjam" to point to the new boost build root and everything will work.
     70
     715. To ensure that bjam is behaving correctly navigate to the bin directory you have just created and execute "bjam -v" (which should give you the version and copyright notices) and "bjam" (which should provide some warnings and an error). 
     72
     73????? Include Attachment here (005 - BJAM with boost_build.PNG)
     74
     75Congratulations although it does not look like it you now have an almost working standalone installation of bjam!
     76
     776. At this point to use BJAM anywhere all you need to do is include the bjam.exe in your PATH environment variable.  I personally have created a batch file that will:
     78 i) Add the directory that bjam.exe is located to the PATH environment variable; and
     79 ii) Called the VCVARS.bat file (which is the Visual Studio 2005 Command Prompt).
     80
     81Without doing anything else BJAM will automajically do the right thing if I run it from a directory with a jamfile.
     82
     83Before we talk about configuring the toolsets that BJAM we should set