Thursday, March 29, 2007

boosting your c++ apps

Boost seems to be the answer to most of my prayers when it comes to getting some extended C++ help. But there is one thing that is totally unknown to me and that is how to understand "bjam". Now I was trying to compile boost on a 64bit system and by default the compilation results in 32bit shared objects. Tried high and low to search for someone who managed to get it compiled in 64bit but well I couldnt, maybe because boost shows up as something else on google :)

Anyways here is the simple way to do it.

(get into the tools/build/jam_src dir)
(go back to the boost home dir)
./tools/build/jam_src/bin.solarisx86/bjam -sTOOLS="gcc" -sBUILD=" < cxxflags > -m64 < linkflags > -m64"

Now if you want to go ahead and use the sun studio compilers you need to do this

(get into the tools/build/jam_src dir)
./ sunpro
(go back to the boost home dir)
./tools/build/jam_src/bin.solaris/bjam -sBUILD=" < threading > multi < runtime-link > dynamic
< cxxflags > -xarch=native64" -sTOOLS="sunpro"
-sSUNPRO_CXX="/opt/SUNWspro/bin/CC -library=stlport4 -xarch=native64"

Now you should have a working 64bit copy of all the boost libraries.