Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

March 20, 2006

Installing C++ Boost on Slackware/Zenwalk

Filed under: C++ Boost, GNU/Linux — tabrez @ 7:52 am

C++ Boost 1.33.1 on Slackware/Zenwalk:

Download bjam slackware package(tgz) and boost-1_33_1 source package(tar.gz) from the sourceforge.net website:
bjam for slackware
c++ boost source package
(or Google for the latest versions of these two packages)
Save these two files in the home directory and then cd into it:
sh# cd $HOME
Install bjam(as root):
sh# installpkg boost-jam-3.1.11-1-linuxx86.tgz
sh# export PATH=$PATH:/boost-jam-3.1.11-1-linuxx86/
Compile and install boost(as root):
sh# tar xjvf boost_1_33_1.tar.bz2
sh# cd boost_1_33_1
sh# bjam “-sTOOLS=gcc” install

C++ Boost is now installed. This procedure doesn’t install the files in the default library paths, so compilation commands are slightly longer than they are for Gentoo and Debian/Ubuntu:

sh# g++ -o first first.cpp -I/usr/local/include/boost-1_33_1
sh# g++ -o second second.cpp -I/usr/local/include/boost-1_33_1 -L/usr/local/lib -lboost_filesystem-gcc

You can simplify this by adding the paths of boost folders to gcc library environment variables:

sh# export CPLUS_INCLUDE_PATH=/usr/local/include/boost-1_33_1
sh# export LIBRARY_PATH=/usr/local/lib

The compilation can now be performed using the following simple commands:

sh# g++ -o first first.cpp
sh# g++ -o second second.cpp -lboost_filesystem-gcc

The two ‘export’ commands can be added at the end of the profile file(/etc/profile or $HOME/.bash_profile) to avoid having to type them every time a new shell is opened. Other way to simplify the process would be to create symbolic links to boost library paths in the Slackware standard include paths so that gcc can find them directly.


If you want to receive future posts by email, enter your email address here:

Related Posts:

9 Comments »

[...] Related Posts: Installing C++ Boost on: Slackware/Zenwalk   Fedora/SuSE Setting the Stage for C++ Boost How to Test C++ Boost Installation Boost Filesystem Library(Part I): Writing Portable C++ Programs to Acess The Filesystem C++ Boost Filesystem Library(Part II): Example Programs [Digg this] [del.icio.us] [...]

Quote

Pingback by Every Flavour Beans » Installing C++ Boost on Gentoo and Debian/Ubuntu — May 28, 2006 @ 9:56 pm

Good howto however there’s 1 that didn’t work for v. 1_34_1.

sh# bjam “-sTOOLS=gcc†install

should be
sh# bjam –toolset=gcc install

bjam tried to guess gcc correctly however.

Quote

Comment by kerrigangster — August 25, 2007 @ 8:04 am

The doc pages are interspersed with the source code. Would you mind packaging the doc for slackware users?

Quote

Comment by kerrigangster — August 25, 2007 @ 8:08 am

Hi Kerrigangster,

Yes, the build procedure of Boost 1.34.1 suggests

--toolset

as the command-line option to specify the toolchain(as this version uses Boost.Build V2). I will update the Boost installation articles to note that.

I have no idea how to package software or documentation for any of the GNU/Linux distributions. Is there any document outlining how to package documentation for Slackware?

Quote

Comment by tabrez — August 26, 2007 @ 1:20 pm

The SlackBuild for 1.33.1 by Mr. Eric Hameleers at http://www.slackware.com/~alien/slackbuilds/boost/build/boost.SlackBuild can be a good starting point. I am looking into it myself. Apparently, there are file organization changes in 1.34.1 like the jam sources for instance.

Quote

Comment by kerrigangster — August 27, 2007 @ 8:00 am

SlackBuild scripts seem to be a nice way to install applications on Slackware, had never heard of them before. Thanks for pointing it out, I will look into them.

Quote

Comment by tabrez — August 27, 2007 @ 11:46 am

[...] *Thanks to kerrigangster for reminding me about the new syntax to build C++ Boost libraries using bjam build tool. [...]

Quote

Pingback by Installing C++ Boost 1.34.1 on Slackware/Zenwalk — September 17, 2007 @ 8:44 pm

hello and nice post, it’s very useful!

btw i have a question for you: if a grab de src (1.34.1) and simply start compilation with ‘configure’, it will produce (after years of compilation) the libraries specified to me (–with-libraries=regex,serialization,thread and so on) but will add a number version on each librarie produced.

i need to remove the number version from the produced libraries (ex libboost_thread-gcc41-mt-1_34_1.so to libboost_thread-gcc41-mt.so)and don’t know how to do it. ani idea?

Quote

Comment by Sombriks — January 7, 2008 @ 9:27 am

man, ignore my last post, the problem is jsut the toolset (getting gcc41 instead just gcc)

Quote

Comment by Sombriks — January 7, 2008 @ 9:53 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

Subscribe without commenting


Copyright (c) 2006, 2007 Tabrez Iqbal.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


Powered by WordPress
This website is hosted by Dreamhost


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics