Using a local copy of Boost on your cluster account

Boost is a set of libraries for C++.  It increases the language’s functionality, allowing you to do all sorts of interesting things (for example it has lots of random number generators).  Boost may already be installed on your local research computing cluster.  But there are several reasons why it may be a good idea to have your own copy of Boost to use within your user account:

  • It may be difficult or impossible to actually find the location of your computer’s Boost libraries.
  • Boost functions are introduced with newer and newer versions of the software.  So what if you want to use a function that came out in a later version (i.e., 1.5.6) that is not in the version installed on your computer?
  • Perhaps you want to be able to see the source code of the Boost functions within your own account, to better understand how they work.

If so, it’s easy enough to download Boost to your local computer, then upload the files to your user account.  Click “current release” on the main Boost website (see the link above).  Then download the files to your computer.  If you’re on a Windows machine, use a program like 7-zip to unpack all the files (or simply keep the tgz file and unpack them on the cluster, that’s probably faster anyway).  Then, upload the Boost files to the cluster.  I recommend placing the boost_1_56_0 folder inside the /lib/ folder on your home directory, that way all your libraries can be in one place.

Here’s the important part: any time you use Boost you need to point to where the libraries are stored.  Because of that, you’ll need to know the path of Boost, that is, where the files “live” on your computer.  There is probably a command in your makefile already that starts with -I.  All you have to do is add your new Boost path to the command, on my system it looks something like:

CPPFLAGS=-I/home/myUsername/lib/boost_1_56_0

That’s it!  Comments questions and concerns shall be given below.

Advertisements

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