Update Boost: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
You should upgrade all development environments, including Linux and Windows, to a similar version - don't wait a week or two and expect CVS installations to be compatible.
This can help you get boost set up for the first time, or update an existing boost installation, under Linux or Windows. 
 
== A note about CVS ==
 
I use boost from the CVS repository - it's typically been stable for me, and contains improved functionality over the official stable release.  If you have trouble with the code you grab from CVS, you can wait a day and try again, to see if things have settled down, or google for answers, they're usually available fairly quickly.  Once things seem stable for you, you should sit tight for a little while - no need to have to do this every single week, unless there's something new you just have to have.  :>
 
You should upgrade all development environments, including Linux and Windows, at about the same time - don't wait a week or two and expect CVS installations to be compatible.  I wrote this in early January 2007, and things seem fairly stable.


== Linux ==
== Linux ==


Remove the old boost:
Remove the old boost (if any):


  cd ~m/development/boost_cvs
  cd ~m/development/boost_cvs
Line 16: Line 22:
Grab a fresh copy from CVS:
Grab a fresh copy from CVS:


cd ~m/development/boost_cvs
  cvs -d:pserver:[email protected]/cvsroot/boost login
  cvs -d:pserver:[email protected]/cvsroot/boost login
  cvs -z3 -d:pserver:[email protected]/cvsroot/boost co -P boost
  cvs -z3 -d:pserver:[email protected]/cvsroot/boost co -P boost
Line 25: Line 32:
Now kick off the install.
Now kick off the install.


cd boost
  screen
  screen
  ../bjam/boost-jam-3.1.13-1-linuxx86/bjam "-sTOOLS=gcc"
  ../bjam/boost-jam-3.1.14-1-linuxx86/bjam --toolset=gcc
  (go get lunch)
  (go get lunch)
  ...updated 1341 targets...
  ...updated 1341 targets...
  su -
  su -
  cd ~m/development/boost_cvs/boost
  cd ~m/development/boost_cvs/boost
  ../bjam/boost-jam-3.1.13-1-linuxx86/bjam "-sTOOLS=gcc" install
  ../bjam/boost-jam-3.1.14-1-linuxx86/bjam --toolset=gcc install


Update your projects to use the new boost.   
Update your projects to use the new boost.   
Line 47: Line 55:
== Windows ==
== Windows ==


Wipe out the old directory, '''except the boost\CVS directory''', which will allow an easy fresh grab:
This is for Visual Studio 2005 with SP1 installed.
 
If you do not have boost yet, [http://news.thedigitalmachine.com/2006/09/05/getting-to-sourceforge-from-windows-through-a-proxy-redux/ check here] for instructions on grabbing a CVS snapshot.  Otherwise, wipe out the old directory, '''except the boost\CVS directory''', which will allow an easy fresh grab (it will also clear out potentially TONS of old stuff that won't otherwise be cleaned up - particularly the bin directory, replaced with bin.v2):


  c:\Michael's Data\Software Development\boost_cvs\boost
  c:\Michael's Data\Software Development\boost_cvs\boost


Right-click on it and do a CVS update with Tortoise CVS.
Right-click on it and do a CVS update with Tortoise CVS.
Also grab a new version of bjam, if needed, and put it in your path.
Go to a command window:


  <path to vc8>\vcvars32.bat
Once you have the source, grab a new version of bjam, if needed, and put it in your path.
 
Next, we'll open a command window and set up the environment by running vcvars32.bat. 
 
<font style="color:gray">(older notes...)  But first, two things to check.  First, make sure you run the RIGHT vcvars32.bat - each version of Visual Studio has one, and you won't always get the right one first in your path.  Second, the default vcvars32.bat file will NOT have the Platform SDK files first - why, Microsoft?  I adjusted mine so that the INCLUDE and LIB variables always put the Platform SDK paths first.  On my system the file to adjust was here:
 
E:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars.bat
 
If you check the "Getting Started" boost docs in CVS (the boost/index.htm file), you'll notice that they are VERY different from the boost.org version of "Getting Started".  It looks like the "vc-8_0" toolset recommended for the stable build has been rolled into the more generic "msvc" toolset along with other versions of VC.  The vcvars32.bat file then drives the whole process.  Also, the way you specify the bjam toolset option has apparently changed.
 
(newer notes...)</font> There is a shortcut in the Microsoft Windows SDK folder that seems to correct the include and lib paths:
 
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Windows SDK\Visual Studio Registration\Integrate Windows SDK with Visual Studio 2005
 
So when you're ready, set up the command line development environment and build boost:
 
  <path to vc8>\vcvars32.bat  
  (or use Program Files->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt)
  cd <boost dir>
  cd <boost dir>
  bjam "-sTOOLS=vc-8_0" stage
  bjam "--toolset=msvc" stage
(go get lunch)


Make sure you've added the boost library and include paths to Visual Studio Tools->Options->Projects and Solutions->VC++ directories.
Make sure you've added the boost library and include paths to Visual Studio Tools->Options->Projects and Solutions->VC++ directories.


You shouldn't even need to add the library files you'll be using to your project, as most libraries are included automatically when you include the boost header.
<font style="color:gray">(older notes) HOWEVER, as of this writing, bjam (using the catch-all "--toolset=msvc") is creating Windows static library files named "...-vc-...", while the auto-linking code in the header files is forcing a link to "...-vc80-...".  Silly boost.  I have updated CVS with no luck, so for now I will just copy the libraries I need from the -vc- name to the -vc80- name, as a temporary workaround.  </font>


You should now be good to go!
You should now be good to go!

Latest revision as of 09:32, 17 September 2007

This can help you get boost set up for the first time, or update an existing boost installation, under Linux or Windows.

A note about CVS

I use boost from the CVS repository - it's typically been stable for me, and contains improved functionality over the official stable release. If you have trouble with the code you grab from CVS, you can wait a day and try again, to see if things have settled down, or google for answers, they're usually available fairly quickly. Once things seem stable for you, you should sit tight for a little while - no need to have to do this every single week, unless there's something new you just have to have.  :>

You should upgrade all development environments, including Linux and Windows, at about the same time - don't wait a week or two and expect CVS installations to be compatible. I wrote this in early January 2007, and things seem fairly stable.

Linux

Remove the old boost (if any):

cd ~m/development/boost_cvs
rm -rf boost
su -
cd /usr/local/lib
rm -f libboost*
cd /usr/local/include
rm -rf boost*
ctrl-D

Grab a fresh copy from CVS:

cd ~m/development/boost_cvs
cvs -d:pserver:[email protected]/cvsroot/boost login
cvs -z3 -d:pserver:[email protected]/cvsroot/boost co -P boost

Also grab a new version of bjam, if needed, and put it here:

~m/development/boost_cvs/bjam

Now kick off the install.

cd boost
screen
../bjam/boost-jam-3.1.14-1-linuxx86/bjam --toolset=gcc
(go get lunch)
...updated 1341 targets...
su -
cd ~m/development/boost_cvs/boost
../bjam/boost-jam-3.1.14-1-linuxx86/bjam --toolset=gcc install

Update your projects to use the new boost. I made the following changes to my automake project:

configure.in: CPPFLAGS=”${CPPFLAGS} -I/usr/local/include/boost-#version#”
Makefile.am: yourproject_LDADD = (…) /usr/local/lib/libboost_serialization-gcc#gccversion#.a

I thought about doing this symlink instead, but I'd rather maintain my project than the symlink:

cd /usr/local/lib
ln -s libboost_serialization-gcc33.a libboost_serialization-gcc.a


Windows

This is for Visual Studio 2005 with SP1 installed.

If you do not have boost yet, check here for instructions on grabbing a CVS snapshot. Otherwise, wipe out the old directory, except the boost\CVS directory, which will allow an easy fresh grab (it will also clear out potentially TONS of old stuff that won't otherwise be cleaned up - particularly the bin directory, replaced with bin.v2):

c:\Michael's Data\Software Development\boost_cvs\boost

Right-click on it and do a CVS update with Tortoise CVS.

Once you have the source, grab a new version of bjam, if needed, and put it in your path.

Next, we'll open a command window and set up the environment by running vcvars32.bat.

(older notes...) But first, two things to check. First, make sure you run the RIGHT vcvars32.bat - each version of Visual Studio has one, and you won't always get the right one first in your path. Second, the default vcvars32.bat file will NOT have the Platform SDK files first - why, Microsoft? I adjusted mine so that the INCLUDE and LIB variables always put the Platform SDK paths first. On my system the file to adjust was here:

E:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars.bat

If you check the "Getting Started" boost docs in CVS (the boost/index.htm file), you'll notice that they are VERY different from the boost.org version of "Getting Started". It looks like the "vc-8_0" toolset recommended for the stable build has been rolled into the more generic "msvc" toolset along with other versions of VC. The vcvars32.bat file then drives the whole process. Also, the way you specify the bjam toolset option has apparently changed.

(newer notes...) There is a shortcut in the Microsoft Windows SDK folder that seems to correct the include and lib paths:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Windows SDK\Visual Studio Registration\Integrate Windows SDK with Visual Studio 2005

So when you're ready, set up the command line development environment and build boost:

<path to vc8>\vcvars32.bat 
 (or use Program Files->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt)
cd <boost dir>
bjam "--toolset=msvc" stage
(go get lunch)

Make sure you've added the boost library and include paths to Visual Studio Tools->Options->Projects and Solutions->VC++ directories.

You shouldn't even need to add the library files you'll be using to your project, as most libraries are included automatically when you include the boost header.

(older notes) HOWEVER, as of this writing, bjam (using the catch-all "--toolset=msvc") is creating Windows static library files named "...-vc-...", while the auto-linking code in the header files is forcing a link to "...-vc80-...". Silly boost. I have updated CVS with no luck, so for now I will just copy the libraries I need from the -vc- name to the -vc80- name, as a temporary workaround.

You should now be good to go!