m (→Compiling Your Own Version Of Boost) |
|||
Line 5: | Line 5: | ||
}} | }} | ||
+ | == SHARCNET-Provided Boost Modules == | ||
− | == | + | === Which Versions of Boost are Available? === |
− | + | ||
− | + | SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running: | |
+ | <pre> | ||
+ | module avail boost | ||
+ | </pre> | ||
+ | and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal]. | ||
+ | At the present time, when you look up the available boost modules you will see output such as: | ||
<pre> | <pre> | ||
− | + | $ module avail boost | |
− | + | ||
+ | ------------------------------------ /opt/sharcnet/modules ------------------------------------- | ||
+ | boost/gcc482-openmpi183/1.50.0 boost/intel12-openmpi162/1.50.0 | ||
+ | boost/gcc482-openmpi183/1.53.0 boost/intel12-openmpi162/1.53.0 | ||
+ | boost/gcc482-openmpi183/1.55.0 boost/intel12-openmpi162/1.55.0 | ||
+ | boost/gcc482-openmpi183/1.57.0 boost/intel12-openmpi162/1.57.0 | ||
+ | boost/intel/1.55.0 boost/intel15-noopenmpi/1.57.0 | ||
+ | |||
+ | ------------------------------------ /opt/sharcnet/modules ------------------------------------- | ||
+ | boost/gcc482-openmpi183/1.50.0 boost/intel12-openmpi162/1.50.0 | ||
+ | boost/gcc482-openmpi183/1.53.0 boost/intel12-openmpi162/1.53.0 | ||
+ | boost/gcc482-openmpi183/1.55.0 boost/intel12-openmpi162/1.55.0 | ||
+ | boost/gcc482-openmpi183/1.57.0 boost/intel12-openmpi162/1.57.0 | ||
+ | boost/intel/1.55.0 boost/intel15-noopenmpi/1.57.0 | ||
+ | $ | ||
</pre> | </pre> | ||
− | + | i.e., the following versions of Boost are available: | |
+ | # Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3 | ||
+ | # Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2 | ||
+ | # Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the "noopenmpi" item). | ||
+ | '''NOTE:''' The boost/intel/1.55.0 module should not be used --it is older and will be removed in the near future. Use one of the other Boost modules instead. | ||
+ | |||
+ | All of the aforementioned versions of Boost have been built with the operating system's installed Python. You can see which version of Python it will use by running: | ||
<pre> | <pre> | ||
− | rpm - | + | rpm -qi python |
− | + | ||
</pre> | </pre> | ||
+ | '''NOTE:''' If you need a specific version of Boost compiled for a specific C++ compiler, version of OpenMPI, and/or a specific version of Python, then submit a ticket requesting such. Be sure to mention all required software packages and which versions are needed. | ||
− | |||
− | + | === Using a Specific Version of Boost === | |
− | + | To use a specific version of Boost, do the following: | |
+ | * Unload any loaded OpenMPI modules that will conflict. | ||
+ | * Unload any loaded C++ compiler modules that will conflict. | ||
+ | * Load any required C++ and OpenMPI modules. | ||
+ | * Load the required version of Boost. | ||
+ | e.g., | ||
+ | <pre> | ||
+ | $ module list # View which modules are currently loaded | ||
+ | $ module unload openmpi/intel/1.6.2 # Unload the OpenMPI (for Intel) | ||
+ | $ module unload intel/12.1.3 # Unload the Intel C++ compiler | ||
+ | $ module load gcc/4.8.2 # Load GCC v4.8.2 | ||
+ | $ module load openmpi/gcc/1.8.3 # Load OpenMPI (for GCC) | ||
+ | $ module load boost/gcc482-openmpi183/1.57.0 # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3 | ||
+ | </pre> | ||
− | + | Once this is done, you may use Boost (e.g., write #include <boost/filesystem.hpp> in your code, etc.). No special compiler options will be required. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === If Special Compiler Options are Required === | |
+ | If you are not having success building your code using Boost (e.g., in a Makefile), you might need to manually specify the INCLUDE and LIB directories. You can get these paths by running the following command (replacing the full Boost module name with the one you've loaded), e.g., | ||
+ | <pre> | ||
+ | $ module show boost/gcc482-openmpi183/1.57.0 | ||
+ | ------------------------------------------------------------------- | ||
+ | /opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0: | ||
− | + | module-whatis Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64. | |
+ | conflict intel | ||
+ | conflict pgi | ||
+ | conflict python | ||
+ | prereq gcc/4.8.2 | ||
+ | prereq openmpi/gcc/1.8.3 | ||
+ | prepend-path --delim CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include | ||
+ | prepend-path --delim LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib | ||
+ | prepend-path LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib | ||
+ | ------------------------------------------------------------------- | ||
− | + | $ | |
− | + | </pre> | |
− | + | The options you need to pass to the C++ compiler / linker follow CPPFLAGS and LDFLAGS in the above output, i.e., you will need to add these two options to your C++ compiler's command line: | |
− | * | + | * -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include |
+ | * -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib | ||
− | |||
− | |||
− | |||
− | |||
− | If | + | == Operating System Installed Boost == |
− | + | If you don't load any SHARCNET-provided Boost module, you will be using the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands: | |
− | + | <pre> | |
− | + | rpm -qi boost | |
+ | rpm -qi boost-devel | ||
+ | </pre> | ||
+ | |||
+ | '''NOTE:''' These versions may be very old, they won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be upgraded. You are therefore '''strongly encouraged''' to use the SHARCNET-provided Boost modules discussed earlier on this page. | ||
− | |||
==References== | ==References== |
Revision as of 15:22, 24 January 2015
BOOST |
---|
Description: free peer-reviewed portable C++ source libraries |
SHARCNET Package information: see BOOST software page in web portal |
Full list of SHARCNET supported software |
Contents
SHARCNET-Provided Boost Modules
Which Versions of Boost are Available?
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:
module avail boost
and/or by viewing the BOOST software page in the web portal.
At the present time, when you look up the available boost modules you will see output such as:
$ module avail boost ------------------------------------ /opt/sharcnet/modules ------------------------------------- boost/gcc482-openmpi183/1.50.0 boost/intel12-openmpi162/1.50.0 boost/gcc482-openmpi183/1.53.0 boost/intel12-openmpi162/1.53.0 boost/gcc482-openmpi183/1.55.0 boost/intel12-openmpi162/1.55.0 boost/gcc482-openmpi183/1.57.0 boost/intel12-openmpi162/1.57.0 boost/intel/1.55.0 boost/intel15-noopenmpi/1.57.0 ------------------------------------ /opt/sharcnet/modules ------------------------------------- boost/gcc482-openmpi183/1.50.0 boost/intel12-openmpi162/1.50.0 boost/gcc482-openmpi183/1.53.0 boost/intel12-openmpi162/1.53.0 boost/gcc482-openmpi183/1.55.0 boost/intel12-openmpi162/1.55.0 boost/gcc482-openmpi183/1.57.0 boost/intel12-openmpi162/1.57.0 boost/intel/1.55.0 boost/intel15-noopenmpi/1.57.0 $
i.e., the following versions of Boost are available:
- Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3
- Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2
- Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the "noopenmpi" item).
NOTE: The boost/intel/1.55.0 module should not be used --it is older and will be removed in the near future. Use one of the other Boost modules instead.
All of the aforementioned versions of Boost have been built with the operating system's installed Python. You can see which version of Python it will use by running:
rpm -qi python
NOTE: If you need a specific version of Boost compiled for a specific C++ compiler, version of OpenMPI, and/or a specific version of Python, then submit a ticket requesting such. Be sure to mention all required software packages and which versions are needed.
Using a Specific Version of Boost
To use a specific version of Boost, do the following:
- Unload any loaded OpenMPI modules that will conflict.
- Unload any loaded C++ compiler modules that will conflict.
- Load any required C++ and OpenMPI modules.
- Load the required version of Boost.
e.g.,
$ module list # View which modules are currently loaded $ module unload openmpi/intel/1.6.2 # Unload the OpenMPI (for Intel) $ module unload intel/12.1.3 # Unload the Intel C++ compiler $ module load gcc/4.8.2 # Load GCC v4.8.2 $ module load openmpi/gcc/1.8.3 # Load OpenMPI (for GCC) $ module load boost/gcc482-openmpi183/1.57.0 # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3
Once this is done, you may use Boost (e.g., write #include <boost/filesystem.hpp> in your code, etc.). No special compiler options will be required.
If Special Compiler Options are Required
If you are not having success building your code using Boost (e.g., in a Makefile), you might need to manually specify the INCLUDE and LIB directories. You can get these paths by running the following command (replacing the full Boost module name with the one you've loaded), e.g.,
$ module show boost/gcc482-openmpi183/1.57.0 ------------------------------------------------------------------- /opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0: module-whatis Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64. conflict intel conflict pgi conflict python prereq gcc/4.8.2 prereq openmpi/gcc/1.8.3 prepend-path --delim CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include prepend-path --delim LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib prepend-path LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib ------------------------------------------------------------------- $
The options you need to pass to the C++ compiler / linker follow CPPFLAGS and LDFLAGS in the above output, i.e., you will need to add these two options to your C++ compiler's command line:
- -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include
- -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib
Operating System Installed Boost
If you don't load any SHARCNET-provided Boost module, you will be using the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:
rpm -qi boost rpm -qi boost-devel
NOTE: These versions may be very old, they won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be upgraded. You are therefore strongly encouraged to use the SHARCNET-provided Boost modules discussed earlier on this page.
References
o Boost Homepage
http://www.boost.org/