Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
diana:windows:building:boost [2010-01-13 10:28:37]
dages
diana:windows:building:boost [2022-05-31 09:29:31] (current)
Line 1: Line 1:
 ====== Building the Boost libraries on Windows ====== ====== Building the Boost libraries on Windows ======
- 
-**XXX** revisit 
  
 ===== Boost jam ===== ===== Boost jam =====
Line 9: Line 7:
 Get the source tarball from http://downloads.sourceforge.net/project/boost/boost-jam/3.1.17/boost-jam-3.1.17.tgz; once you have it, it's a simple matter of running the build script (which will automatically detect MinGW) and installing the resulting executable: Get the source tarball from http://downloads.sourceforge.net/project/boost/boost-jam/3.1.17/boost-jam-3.1.17.tgz; once you have it, it's a simple matter of running the build script (which will automatically detect MinGW) and installing the resulting executable:
  
-  $ tar zxf boost-jam-3.1.17.tgz 
-  $ cd boost-jam-3.1.17 
   $ sh ./build.sh   $ sh ./build.sh
   $ cp bin.ntx86/bjam.exe /mingw/bin   $ cp bin.ntx86/bjam.exe /mingw/bin
Line 25: Line 21:
 ===== Main libraries ===== ===== Main libraries =====
  
-Download the main Boost libraries from http://downloads.sourceforge.net/project/boost/boost/1.40.0/boost_1_40_0.tar.gz and extract them somewhere convenient+Download the main Boost libraries from http://downloads.sourceforge.net/project/boost/boost and extract them somewhere convenient.
- +
-  $ tar zxvf boost/boost_1_40_0.tar.gz+
  
 Let's see what we've got: Let's see what we've got:
Line 52: Line 46:
 Jam will detect that you're running Windows and (rather then check what's available) assume that you want to use the MSVC toolchain; you have to force it to use gcc instead.  You should also use a separate build directory; it will make it easier to clean up if you make a mistake and need to start over. Jam will detect that you're running Windows and (rather then check what's available) assume that you want to use the MSVC toolchain; you have to force it to use gcc instead.  You should also use a separate build directory; it will make it easier to clean up if you make a mistake and need to start over.
  
-  mkdir obj +In principle, you could use the following command to build Boost: 
-  $ bjam toolset=gcc --prefix=/usr/local --build-dir=obj+ 
 +  bjam toolset=gcc --prefix=/opt/boost --build-dir=obj --layout=system stage 
 + 
 +If you do, though, you will get warnings about several components due to missing compiler features (e.g. ''wchar'' for [[http://www.boost.org/doc/libs/1_40_0/libs/serialization/doc/index.html|Boost.Serialization]]) and / or third-party components (e.g. Python for [[http://www.boost.org/doc/libs/1_40_0/libs/python/doc/index.html|Boost.Python]]). 
 + 
 +  $ bjam toolset=gcc variant=release link=shared threading=multi \ 
 +       --prefix=/c/met.no --build-dir=obj --layout=tagged \ 
 +       --without-graph --without-graph_parallel --without-mpi \ 
 +       --without-python --without-serialization \ 
 +       stage
  
-You will get a number of warnings about [[http://www.boost.org/doc/libs/1_40_0/libs/python/doc/index.html|Boost.Python]][[http://www.boost.org/doc/libs/1_40_0/libs/regex/doc/html/index.html|Boost.Regex]][[http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/index.html|Boost.Graph]] and [[http://www.boost.org/doc/libs/1_40_0/doc/html/mpi.html|Boost.MPI]]; you can safely ignore them, as metlibs doesn't use any of them.  If it bothers you, you can disable the offending components:+To install the resultrun the exact same commandbut with ''install'' instead of ''stage'':
  
-  $ bjam toolset=gcc --prefix=/usr/local --build-dir=obj --without-python +  $ bjam toolset=gcc variant=release link=shared threading=multi \ 
-      --without-regex --without-graph --without-graph_parallel --without-mpi+       --prefix=/c/met.no --build-dir=obj --layout=tagged 
 +       --without-graph --without-graph_parallel --without-mpi \ 
 +       --without-python --without-serialization \ 
 +       install 
 +  $ cp LICENSE_1_0.txt /c/met.no/copyright/boost.txt
  
-If all goes well, you will find the libraries in the ''stage/lib'' subdirectory (under the source tree, not under ''obj''; this is IMHO a mistake on bjam's part).  You can copy them to wherever you need them to be, most likely ''/mingw/lib''.+**XXX** can't get static linking to work
  • diana/windows/building/boost.1263378517.txt.gz
  • Last modified: 2022-05-31 09:23:14
  • (external edit)