Installing C++ Boost on Slackware/Zenwalk
C++ Boost 1.33.1 on Slackware/Zenwalk:
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# export PATH=$PATH:/boost-jam-3.1.11-1-linuxx86/
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 LIBRARY_PATH=/usr/local/lib
The compilation can now be performed using the following simple commands:
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.
9 comments
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?
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.
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?
[...] 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] [...]