Author Topic: How can I build Boost C++?  (Read 9730 times)

vgmtech

  • Guest
How can I build Boost C++?
« on: November 11, 2005, 09:56:29 pm »
How can I build Boost C++, With the toolkit?

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: How can I build Boost C++?
« Reply #1 on: November 11, 2005, 10:16:40 pm »
Well, the Getting Started page of the Boost website would be a good place to, well, get started ;).
This isn't really a Code::Blocks issue though.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How can I build Boost C++?
« Reply #2 on: November 12, 2005, 01:21:25 pm »
Building BOOST inside Code::Blocks is not supported out-of-the-box. You would need to make a project and add all the required files yourself.

To build the package, you first have to compile bjam (found in tools\build\). Then you can build BOOST using bjam, which is the "correct" way of doing it. Other ways are of course correct, too, but they aren't supported out-of-the-box, so they require a lot more work.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: How can I build Boost C++?
« Reply #3 on: November 12, 2005, 02:50:39 pm »
To build the package, you first have to compile bjam (found in tools\build\).

Or just download a prebuilt executable here.

takeshimiya

  • Guest
Re: How can I build Boost C++?
« Reply #4 on: November 12, 2005, 03:46:42 pm »
I haven't tried, but you could use the DevPak plugin to get Boost 1.31 already compiled, from the category C++ Libraries.

Einar Forselv

  • Guest
Re: How can I build Boost C++?
« Reply #5 on: November 23, 2005, 11:40:51 pm »
I haven't tried, but you could use the DevPak plugin to get Boost 1.31 already compiled, from the category C++ Libraries.
Just installed the Boost devpack from devpacks.org, and it works like a charm. :)

vgmtech

  • Guest
Re: How can I build Boost C++?
« Reply #6 on: November 24, 2005, 04:37:35 am »
I’m sorry, but I have zero experience with 3rd party build tools like bjam. And for the devpak I’m using the vc toolkit…

takeshimiya

  • Guest
Re: How can I build Boost C++?
« Reply #7 on: November 24, 2005, 04:48:57 am »
That's why I'm against build systems like jam, boost.jam, SCons, ... for distributing.

But if you want to use boost with VC, read how to build it in http://boost.org/more/getting_started.html, it isn't difficult.

Offline liaoya

  • Single posting newcomer
  • *
  • Posts: 9
Re: How can I build Boost C++?
« Reply #8 on: December 14, 2005, 09:20:15 am »
Hope the batch script below will be helpful:

@echo off

set BOOST_ROOT=c:\opt\boost
set PYTHON_ROOT=c:\python
set PYTHON_VERSION=2.4

if "%1"=="" goto noparam
if "%1"=="mingw" goto boostmingw
if "%1"=="mingwstl" gotoo boostmingwstl
if "%1"=="vc71" goto boostvc71
if "%1"=="vc71stl" goto boostvc71stl

:boostmingw
echo "building boost on mingw ..."
call c:\mingw.bat
@rem @set PATH=c:\mingw\bin;%PATH%
@rem @set CPLUS_INCLUDE_PATH=c:\mingw\include\c++\4.0.2\mingw32;c:\mingw\include\c++\4.0.2
@rem this maybe important
@set BZIP2_BINARY=bz2
@set BZIP2_INCLUDE=c:\opt\dev-cpp\include
@set ZLIB_BINARY=z
@set ZLIB_INCLUDE=c:\opt\dev-cpp\include

@set TOOLS=mingw
@rem maybe "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <cxxflags>-O2" is enough, static is not necessary
bjam "-sBUILD=debug release <runtime-link>dynamic <threading>multi <cxxflags>-O2" --layout=stage install 1>log.txt 2>err.txt
goto theend

:boostmingwstl
echo "building boost on mingw stlport..."
call c:\mingw.bat
@rem @set CPLUS_INCLUDE_PATH=c:\mingw\include\c++\4.0.2\mingw32;c:\mingw\include\c++\4.0.2
@rem this maybe important
@set STLPORT_PATH=c:\opt
@set STLPORT_5.0_PATH=c:\opt\STLport
@set STLPORT_VERSION=5.0
@set BZIP2_SOURCE=c:\opt\bzip2
@set ZLIB_SOURCE=c:\opt\zlib

set TOOLS=mingw-stlport
bjam "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <cxxflags>-O2" --layout=system stage 1>log.txt 2>err.txt
goto theend

:boostvc71
echo "building boost on vc7_1 ..."
call "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
@set BZIP2_SOURCE=c:\opt\bzip2
@set ZLIB_SOURCE=c:\opt\zlib
@set TOOLS=vc-7_1
bjam "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <native-wchar_t>on" install >log.txt 2>err.txt
@rem do not use this configuration "<cxxflags>/O2"
@rem bjam "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <native-wchar_t>on" install >log.txt 2>err.txt
goto theend

:boostvc71stl
@rem you must build the stlport with /Zc:wchar_t
@rem stlport 4.62 'EXTRA_COMMON_FLAGS=/FI "vc_warning_disable.h" /D "_MBCS" /Zc:wchar_t' in file src\vc71.mak
@rem http://www.stlport.com/dcforum/DCForumID7/2438.html
@rem build/Makefiles/config.mak OPT = $(OPT) /Zc:wchar_t
@rem stlport 5.0 add to "CFLAGS_COMMON" and "CXXFLAGS_COMMON" file build\Makefiles\nmake\vc71.mak
echo "building boost on vc7_1-slport ..."
call "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
@rem set STLPORT_PATH=c:\opt
@rem set STLPORT_4.62_PATH=c:\opt\STLport-4.6.2
@rem set STLPORT_VERSION=4.6.2
@set STLPORT_PATH=c:\opt
@set STLPORT_5.0_PATH=c:\opt\STLport
@set STLPORT_VERSION=5.0
@set BZIP2_SOURCE=c:\opt\bzip2
@set ZLIB_SOURCE=c:\opt\zlib
@set ICU_PATH=c:\opt\icu
@set TOOLS=vc-7_1-stlport
@rem bjam "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <native-wchar_t>on" --with-regex stage
bjam "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <native-wchar_t>on" install >log.txt 2>err.txt
@rem bjam "-sBUILD=debug release <runtime-link>static/dynamic <threading>multi <native-wchar_t>on" --layout=system --with-test stage
goto theend

:noparam
echo "Usage : [vc71 | vc71stl | mingw | mingwstl]"
goto theend

: theend
rem something