Boost provides free peer-reviewed portable C++ source libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. More information can be found at http://www.boost.org/.
To initialize the environment, use
$ module load LIBRARIES; module load boost
This will set the environment variables BOOST_ROOT, FLAGS_BOOST_INCLUDE and FLAGS_BOOST_LINKER for compiling and linking, and enhance the environment variables PATH, LD_LIBRARY_PATH, FLAGS_MATH_... (The C++ interfaces are available for Open MPI only, please add -lhdf5_cpp to the link line.)
Most Boost libraries are header-only: they consist entirely of header ﬁles containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking. Example:
$ $PSRC/pex/992|| $CXX $FLAGS_BOOST_INCLUDE $PSRC/psr/example.cpp -c
$ $PSRC/pex/992|| $CXX example.o -o example
$ $PSRC/pex/992|| echo 1 2 3 | ./example
However, these Boost libraries are built separately and must be linked explicitly:
atomic, chrono, context, date_time, exception, ﬁlesystem, graph, graph_parallel, iostreams, locale, math, mpi, program_options, python, random, regex serialization, signals, system, test, thread, timer, wave.
E.g. in order to link say the Boost.MPI library you have to add the -lboost_mpi ﬂag to the link line and so forth.
$ $PSRC/pex/994|| $MPICXX $FLAGS_BOOST_INCLUDE $PSRC/psr/pointer_test.cpp -c
$ $PSRC/pex/994|| $MPICXX $FLAGS_BOOST_LINKER pointer_test.o -lboost_mpi
$ $PSRC/pex/994|| $MPIEXEC -np 2 a.out