Home > C/C++ > Building Boost under Solaris

Building Boost under Solaris

Boost provides free peer-reviewed portable C++ source libraries. I have been using another library “libiqxmlrpc” in my application and that used Boost, now when porting my application to Solaris I had to build Boost from source which I thought would be very simple but it wasnt…

Here is what I had to do:

– Once you have got the latest source for boost, build bjam (build environment setup scripts) from within the Boost source code folder…that is very straight-forward
– After bjam is successfully build, add it to your PATH to make things simpler
– No go to the Boost source root folder and run the following

bjam toolset=sun stdlib=sun-stlport instruction-set=i386 address-model=32 
--prefix=/opt/boost/ --libdir=/opt/boost/lib/ --includedir=/opt/boost/include/

Which is good for 32 bit Solaris and with Sun Studio installed. In case you are using 64 bit change the address-model accordingly and same goes for instruction-set that if you are on AMD use the option as “amd” instead of i386.

The build process will not work just with the default option so these options have to be added. Once the build is started it sure does take quite a while so enjoy a coffee during that time 🙂


Shoaib Mir
shoaibmir[@]gmail.com

Advertisements
Categories: C/C++ Tags: , ,
  1. yogesh
    March 11, 2010 at 5:00 am

    Which version of Boost did compile. Also what version of Sun OS, and Sum compiler did u use. I m also compiling boost on solaris bu i am getting complation errors

  2. April 14, 2010 at 4:01 pm

    IIRC it was an older version of Boost something like 1.32 and I had to patch it with a fix from the mailing to make it compile. Regarding the OS version I am pretty sure I was using 64 bit Open Solaris 11.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: