<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.sharcnet.ca/help/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Preney</id>
		<title>Documentation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.sharcnet.ca/help/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Preney"/>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php/Special:Contributions/Preney"/>
		<updated>2026-05-23T20:35:30Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=Deploying_a_web_server&amp;diff=16570</id>
		<title>Deploying a web server</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=Deploying_a_web_server&amp;diff=16570"/>
				<updated>2018-05-29T16:50:56Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: Preney moved page Deploying a web server. to Deploying a web server over redirect: Removing dot in title.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependencies - Launch Cloud Instance=&lt;br /&gt;
Before deploying a web server, first a cloud instance must be lauched.  The instruction to do this can be found [[Carpet|here]].&lt;br /&gt;
For the remainder of the instructions the ip address used is 199.241.164.95, this is for demonstration purposes and you should replace&lt;br /&gt;
it with your assigned floating IP address.&lt;br /&gt;
&lt;br /&gt;
# login to cloud.sharcnet.ca&lt;br /&gt;
# Don’t forget volume size&lt;br /&gt;
# Choose Debian 9.2.2 (not required, but the remaining instructions are Debian centric).&lt;br /&gt;
# Choose persistent (ephemeral is for shorter jobs) (4C-8GB)&lt;br /&gt;
# Setup keypair&lt;br /&gt;
# Associate floating ip&lt;br /&gt;
&lt;br /&gt;
==(Optional) Apply IP Address to your name server==&lt;br /&gt;
If you have a registered domain name you should apply your floating IP address to it so that you can use the &amp;quot;let's encrypt&amp;quot; service to &lt;br /&gt;
enable the secure socket layer without client side warnings.  It is often best to do this at the beginning as there is typically a delay&lt;br /&gt;
in updating the name service.&lt;br /&gt;
&lt;br /&gt;
= Server Setup =&lt;br /&gt;
&lt;br /&gt;
==Login to Server &amp;amp; perform preliminaries==&lt;br /&gt;
At this point log into the server to ensure that the service is up and running.  There are a number of steps you can perform that will make &lt;br /&gt;
the remaining steps easier.  First loging to the server.  Then setup a user prompt to make navigation easier.  Switch to root (or use sudo in&lt;br /&gt;
from of the remaining commands). Update and upgrade the system.  Last install the manual pages.&lt;br /&gt;
    $ ssh debian@199.241.164.95&lt;br /&gt;
    $ echo 'export PS1=&amp;quot;\[\e[33m\]\w\[\e[0m\]\n\[\e[32m\]\u@\h$ \[\e[0m\]&amp;quot;' &amp;gt;&amp;gt; .bash_aliases&lt;br /&gt;
    $ sudo su root&lt;br /&gt;
    $ apt update&lt;br /&gt;
    $ apt upgrade&lt;br /&gt;
    $ apt install man&lt;br /&gt;
&lt;br /&gt;
==Apt error==&lt;br /&gt;
If you receive the &amp;quot;apt error&amp;quot; mesage put &amp;quot;nameserver 8.8.8.8&amp;quot; in /etc/resolve.conf.&lt;br /&gt;
    $ echo 'nameserver 8.8.8.8 &amp;gt;&amp;gt;' /etc/resolve.conf&lt;br /&gt;
&lt;br /&gt;
==Secure the SSH login==&lt;br /&gt;
The following changes will disable logging into the server by using a password on any account and prevent logging into root remotly.  Root can&lt;br /&gt;
still be accessed by logging into a ''sudo'' enabled account and using the command ''su root''.  For more information on the sshd_config file&lt;br /&gt;
options, go [https://man.openbsd.org/sshd_config here].  The unattended-upgrades package is used to keep they server up to date automatically.&lt;br /&gt;
    $ sudo vim /etc/ssh/sshd_config&lt;br /&gt;
    ChallengeResponseAuthentication no&lt;br /&gt;
    PasswordAuthentication no&lt;br /&gt;
    PermitRootLogin no&lt;br /&gt;
    $ service ssh reload&lt;br /&gt;
    $ apt install unattended-upgrades&lt;br /&gt;
    $ dpkg-reconfigure --priority=low unattended-upgrades&lt;br /&gt;
    $ sudo unattended-upgrade -d&lt;br /&gt;
&lt;br /&gt;
=Install webserver and suppporting packages=&lt;br /&gt;
==MYSQL==&lt;br /&gt;
    $ apt install mysql-server&lt;br /&gt;
    $ mysql_secure_installation #password=password&lt;br /&gt;
&lt;br /&gt;
==Apache==&lt;br /&gt;
Installing the Apache webserver will allow you to access a default page at your ip address. (ex http://199.241.164.95, or http://frar.ca).&lt;br /&gt;
Note that https will not yet work. httpd is the Apache HyperText Transfer Protocol (HTTP) server program. It is designed to be run as a standalone daemon process. When used like this it will create a pool of child processes or threads to handle requests.  In general, httpd should not be invoked directly, but rather should be invoked via apachectl on Unix-based systems or as a service on Windows NT, 2000 and XP and as a console application on Windows 9x and ME.&lt;br /&gt;
&lt;br /&gt;
    $ apt install apache2&lt;br /&gt;
    $ service apache2 start #add 80, 443 to default security group rules&lt;br /&gt;
    $ a2enmod cgid.load #(optional) enable cgi scripting, a2dismod to remove&lt;br /&gt;
&lt;br /&gt;
===Basic information &amp;amp; settings===&lt;br /&gt;
# Document root Directory: /var/www/html or /var/www&lt;br /&gt;
# Main Configuration file:&lt;br /&gt;
## /etc/httpd/conf/httpd.conf (RHEL/CentOS/Fedora) &lt;br /&gt;
## /etc/apache2/apache2.conf (Debian/Ubuntu).&lt;br /&gt;
# Default HTTP Port: 80 TCP&lt;br /&gt;
# Default HTTPS Port: 443 TCP&lt;br /&gt;
# Access Log files of Web Server: /var/log/apache2/access_log&lt;br /&gt;
# Error Log files of Web Server: /var/log/apache2/error_log&lt;br /&gt;
# service apache2 {start|stop|graceful-stop|restart|reload|force-reload}&lt;br /&gt;
# apachectl -v &lt;br /&gt;
## [https://httpd.apache.org/docs/2.4/programs/apachectl.html see]&lt;br /&gt;
&lt;br /&gt;
===Secure Apache with SSL certificates===&lt;br /&gt;
Going to https is now possible but will trigger a warning.&lt;br /&gt;
    $ a2enmod ssl&lt;br /&gt;
    $ a2ensite default-ssl.conf&lt;br /&gt;
    $ service apache2 restart&lt;br /&gt;
&lt;br /&gt;
===Enable let's encrypt (requires a domain name)===&lt;br /&gt;
    $ apt install git&lt;br /&gt;
    $ sudo git clone https://github.com/letsencrypt/letsencrypt  /opt/letsencrypt&lt;br /&gt;
    $ cd /opt/letsencrypt&lt;br /&gt;
    $ ./certbot-auto --authenticator webroot --installer apache&lt;br /&gt;
    www.frar.ca&lt;br /&gt;
    /var/www/html&lt;br /&gt;
&lt;br /&gt;
===Add basic user-password verfication===&lt;br /&gt;
    $ mkdir /var/www/passwd&lt;br /&gt;
    $ htpasswd -c /var/www/passwd/passwords user&lt;br /&gt;
    $ vim /etc/apache2/apache2.conf&lt;br /&gt;
    &amp;lt;Directory /var/www/html&amp;gt;&lt;br /&gt;
        Require valid-user&lt;br /&gt;
        AuthType basic&lt;br /&gt;
        AuthName &amp;quot;Restricted Files&amp;quot;&lt;br /&gt;
        AuthUserFile &amp;quot;/var/www/passwd/passwords&amp;quot;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
    $ service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==Helper packages==&lt;br /&gt;
===Install PHP===&lt;br /&gt;
    $ apt -y install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-gd php7.0-opcache&lt;br /&gt;
    $ echo ‘&amp;lt;?php phpinfo(); ?&amp;gt;’ &amp;gt; /var/www/html/test.php&lt;br /&gt;
&lt;br /&gt;
===Give www-data an ssh key and ownership of home directory===&lt;br /&gt;
$ chmod 774 /var/www/html&lt;br /&gt;
$ chown www-data:www-data -R /var/www&lt;br /&gt;
$ mkdir /var/www/.ssh&lt;br /&gt;
$ chown www-data:www-data /var/www/.ssh&lt;br /&gt;
$ sudo -u www-data ssh-keygen -C www-data #no passphrase for now&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=File:Dice_0p9_Makefile.txt&amp;diff=15881</id>
		<title>File:Dice 0p9 Makefile.txt</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=File:Dice_0p9_Makefile.txt&amp;diff=15881"/>
				<updated>2017-10-24T19:04:36Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: Patchfile for Makefile in Dice v0.9.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Patchfile for Makefile in Dice v0.9.&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=15484</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=15484"/>
				<updated>2017-07-25T19:43:39Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Template:GrahamUpdate}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
When you look up the available boost modules you will see output similar tossh-:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------ /opt/sharcnet/modules -------------------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0         boost/gcc510-openmpi187/1.59.0         boost/intel1503-openmpi187/1.59.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0         boost/gcc510-openmpi187debug/1.59.0    boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
boost/gcc492-openmpi187/1.59.0         boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc492-openmpi187debug/1.59.0    boost/intel12-openmpi162/1.55.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# versions 1.53 and 1.55 built with GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.53.0 and boost/gcc482-openmpi183/1.55.0&lt;br /&gt;
# version 1.59 built with GCC v4.9.2 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e.,, boost/gcc492-openmpi187/1.59.0  and boost/gcc492-openmpi187debug/1.59.0&lt;br /&gt;
# version 1.59 built with GCC v5.1.0 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/gcc510-openmpi187/1.59.0 and boost/gcc510-openmpi187debug/1.59.0&lt;br /&gt;
# versions 1.53 and 1.55 built with Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.53.0 and boost/intel12-openmpi162/1.55.0&lt;br /&gt;
# version 1.59 built with Intel v15.0.3 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/intel1503-openmpi187/1.59.0 and boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
=== Loading a module ===&lt;br /&gt;
&lt;br /&gt;
To load a specific module of Boost simply use &amp;quot;module load&amp;quot; followed by the module name, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module load boost/intel1503-openmpi187debug/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an error occurs, ensure that you load all pre-requisite modules first. Often it is easier to remove all modules, load the required ldwrapper module (which is needed for your programs to work when submitted using sqsub), and the the modules you need to use, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/5.1.0&lt;br /&gt;
$ module load openmpi/gcc-5.1.0/std/1.8.7&lt;br /&gt;
$ module load boost/gcc510-openmpi187/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling Programs Using CMake With Boost ==&lt;br /&gt;
&lt;br /&gt;
With CMake you will want code similar to the following to properly load Boost:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;find_package(&lt;br /&gt;
    Boost 1.56.0 REQUIRED&lt;br /&gt;
    COMPONENTS&lt;br /&gt;
        filesystem&lt;br /&gt;
        system&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# 1.56.0 is the MINIMUM version that can be used by your program. You should replace this with the version you are using, e.g., 1.59.0. (Know that omitting the minimum version setting can cause issues with CMake not finding Boost.)&lt;br /&gt;
# REQUIRED means that if the minimum version is not about to be used, an error will occur and compilation will be aborted. Generally it is a good idea to use REQUIRED to avoid cryptic compilation error messages when an incompatible version of Boost is used.&lt;br /&gt;
# If you use any Boost components that have library code that must be linked into your program, you will need to specify COMPONENTS followed by the names of those components. &lt;br /&gt;
&lt;br /&gt;
If CMake finds the wrong version of boost. Try telling CMake to not use the built in boost system path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set(Boost_NO_SYSTEM_PATHS ON)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will cause CMake to look at the BOOST_ROOT environment variable, instead of the default locations.&lt;br /&gt;
&lt;br /&gt;
You can view the names of all required-to-be-linked-to-a-library components for the version of Boost you are using by running the following command (after using &amp;quot;module load&amp;quot; to load the version of Boost you want to use):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will output something similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&lt;br /&gt;
atomic&lt;br /&gt;
chrono&lt;br /&gt;
context&lt;br /&gt;
coroutine&lt;br /&gt;
date_time&lt;br /&gt;
exception&lt;br /&gt;
filesystem&lt;br /&gt;
graph&lt;br /&gt;
graph_parallel&lt;br /&gt;
iostreams&lt;br /&gt;
locale&lt;br /&gt;
log&lt;br /&gt;
log_setup&lt;br /&gt;
math_c99&lt;br /&gt;
math_c99f&lt;br /&gt;
math_c99l&lt;br /&gt;
math_tr1&lt;br /&gt;
math_tr1f&lt;br /&gt;
math_tr1l&lt;br /&gt;
mpi&lt;br /&gt;
prg_exec_monitor&lt;br /&gt;
program_options&lt;br /&gt;
python&lt;br /&gt;
random&lt;br /&gt;
regex&lt;br /&gt;
serialization&lt;br /&gt;
signals&lt;br /&gt;
system&lt;br /&gt;
test_exec_monitor&lt;br /&gt;
thread&lt;br /&gt;
timer&lt;br /&gt;
unit_test_framework&lt;br /&gt;
wave&lt;br /&gt;
wserialization&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the library components depend on other components. For example, the &amp;quot;filesystem&amp;quot; component depends on the &amp;quot;system&amp;quot; component --so both of these must be specified in the find_package() CMake function call.&lt;br /&gt;
&lt;br /&gt;
You also will need lines similar to the follwing in your CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;add_executable(&lt;br /&gt;
    program.exe&lt;br /&gt;
    src/somecode.cxx&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
target_link_libraries(&lt;br /&gt;
    program.exe&lt;br /&gt;
    ${Boost_LIBRARIES}&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# program.exe is the executable being produced.&lt;br /&gt;
# ${Boost_LIBRARIES} is set by the find_package() function and contains all of the libraries it discovered (for the listed COMPONENTS section above).&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' With the target_link_libraries() set, you do not need or want to set LD_LIBRARY_PATH at all for Boost to work, i.e., if you are loading the SHARCNET module, everything is properly set. (With CMake you must tell it which libraries must be linked in to your executable --it is not automatic.)&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A Header-Only Example ==&lt;br /&gt;
&lt;br /&gt;
Many libraries in Boost are header-only (i.e., the program does not need to be linked to a library). With header-only libraries one does not specify any linking options when compiling/linking the code.&lt;br /&gt;
&lt;br /&gt;
Consider the following Boost.Multiprecision program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// This program's code combines code from the following Boost.Multiprecision documentation's pages:&lt;br /&gt;
//   1) http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html&lt;br /&gt;
//   2) http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_bin_float.html&lt;br /&gt;
//   3) http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html&lt;br /&gt;
&lt;br /&gt;
#include &amp;amp;lt;boost/multiprecision/cpp_int.hpp&amp;amp;gt; &lt;br /&gt;
#include &amp;amp;lt;boost/multiprecision/cpp_bin_float.hpp&amp;amp;gt;&lt;br /&gt;
#include &amp;amp;lt;boost/multiprecision/cpp_dec_float.hpp&amp;amp;gt; &lt;br /&gt;
#include &amp;amp;lt;boost/math/special_functions/gamma.hpp&amp;amp;gt;&lt;br /&gt;
#include &amp;amp;lt;iostream&amp;amp;gt;&lt;br /&gt;
  &lt;br /&gt;
void mp_int()&lt;br /&gt;
{&lt;br /&gt;
  // For integer type docs see:&lt;br /&gt;
  // http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html&lt;br /&gt;
&lt;br /&gt;
  // Example Boost docs code follows...&lt;br /&gt;
&lt;br /&gt;
  using namespace boost::multiprecision;&lt;br /&gt;
&lt;br /&gt;
  // Do some fixed precision arithmetic:&lt;br /&gt;
  int128_t v = 1;&lt;br /&gt;
  for (unsigned i = 1; i &amp;amp;lt;= 20; ++i)&lt;br /&gt;
    v *= i;&lt;br /&gt;
  std::cout &amp;amp;lt;&amp;amp;lt; v &amp;amp;lt;&amp;amp;lt; std::endl; // prints 20&lt;br /&gt;
&lt;br /&gt;
  // Repeat at arbitrary precision:&lt;br /&gt;
  cpp_int u = 1;&lt;br /&gt;
  for (unsigned i = 1; i &amp;amp;lt;= 100; ++i)&lt;br /&gt;
    u *= i;&lt;br /&gt;
  std::cout &amp;amp;lt;&amp;amp;lt; u &amp;amp;lt;&amp;amp;lt; std::endl; // prints 100&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void mp_bin_float()&lt;br /&gt;
{&lt;br /&gt;
  // For floating-point type docs see:&lt;br /&gt;
  // http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html&lt;br /&gt;
&lt;br /&gt;
  // Example Boost docs code follows...&lt;br /&gt;
&lt;br /&gt;
  using namespace boost::multiprecision;&lt;br /&gt;
&lt;br /&gt;
   // Operations at fixed precision and full numeric_limits support:&lt;br /&gt;
   cpp_bin_float_100 b = 2;&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_bin_float_100&amp;amp;gt;::digits &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_bin_float_100&amp;amp;gt;::digits10 &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // We can use any C++ std lib function, lets print all the digits as well:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::setprecision(std::numeric_limits&amp;amp;lt;cpp_bin_float_100&amp;amp;gt;::max_digits10)&lt;br /&gt;
      &amp;amp;lt;&amp;amp;lt; log(b) &amp;amp;lt;&amp;amp;lt; std::endl; // print log(2)&lt;br /&gt;
&lt;br /&gt;
   // We can also use any function from Boost.Math:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // These even work when the argument is an expression template:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b * b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // And since we have an extended exponent range we can generate some really large &lt;br /&gt;
   // numbers here (4.0238726007709377354370243e+2564):&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(cpp_bin_float_100(1000)) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void mp_dec_float()&lt;br /&gt;
{&lt;br /&gt;
   using namespace boost::multiprecision;&lt;br /&gt;
&lt;br /&gt;
   // Operations at fixed precision and full numeric_limits support:&lt;br /&gt;
   cpp_dec_float_100 b = 2;&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_dec_float_100&amp;amp;gt;::digits &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // Note that digits10 is the same as digits, since we&amp;amp;apos;re base 10! :&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_dec_float_100&amp;amp;gt;::digits10 &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // We can use any C++ std lib function, lets print all the digits as well:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::setprecision(std::numeric_limits&amp;amp;lt;cpp_dec_float_100&amp;amp;gt;::max_digits10)&lt;br /&gt;
      &amp;amp;lt;&amp;amp;lt; log(b) &amp;amp;lt;&amp;amp;lt; std::endl; // print log(2)&lt;br /&gt;
&lt;br /&gt;
   // We can also use any function from Boost.Math:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // These even work when the argument is an expression template:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b * b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // And since we have an extended exponent range we can generate some really large &lt;br /&gt;
   // numbers here (4.0238726007709377354370243e+2564):&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(cpp_dec_float_100(1000)) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
  mp_int();&lt;br /&gt;
  mp_bin_float();&lt;br /&gt;
  mp_dec_float();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It be compiled and run using GCC v6.3.0 as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module unload gcc intel openmpi mkl boost&lt;br /&gt;
$ module load gcc/6.3.0 boost/gcc630/1.63.0&lt;br /&gt;
$ g++ -I$BOOST_ROOT/include boost-multiprecision.cxx&lt;br /&gt;
$ ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or with Intel v17.0.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module unload gcc intel openmpi mkl boost&lt;br /&gt;
$ module load intel/17.0.1 boost/intel1701/1.63.0&lt;br /&gt;
$ icpc -I$BOOST_ROOT/include boost-multiprecision.cxx&lt;br /&gt;
$ ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
If you don't load a SHARCNET boost module, your program will most likely link to the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' System versions are rather old and won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be updated. Therefore we '''strongly encourag''' using the SHARCNET provided Boost modules discussed above on this page.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=14978</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=14978"/>
				<updated>2017-03-17T18:44:35Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Building an Example Boost Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
When you look up the available boost modules you will see output similar tossh-:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------ /opt/sharcnet/modules -------------------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0         boost/gcc510-openmpi187/1.59.0         boost/intel1503-openmpi187/1.59.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0         boost/gcc510-openmpi187debug/1.59.0    boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
boost/gcc492-openmpi187/1.59.0         boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc492-openmpi187debug/1.59.0    boost/intel12-openmpi162/1.55.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# versions 1.53 and 1.55 built with GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.53.0 and boost/gcc482-openmpi183/1.55.0&lt;br /&gt;
# version 1.59 built with GCC v4.9.2 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e.,, boost/gcc492-openmpi187/1.59.0  and boost/gcc492-openmpi187debug/1.59.0&lt;br /&gt;
# version 1.59 built with GCC v5.1.0 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/gcc510-openmpi187/1.59.0 and boost/gcc510-openmpi187debug/1.59.0&lt;br /&gt;
# versions 1.53 and 1.55 built with Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.53.0 and boost/intel12-openmpi162/1.55.0&lt;br /&gt;
# version 1.59 built with Intel v15.0.3 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/intel1503-openmpi187/1.59.0 and boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
=== Loading a module ===&lt;br /&gt;
&lt;br /&gt;
To load a specific module of Boost simply use &amp;quot;module load&amp;quot; followed by the module name, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module load boost/intel1503-openmpi187debug/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an error occurs, ensure that you load all pre-requisite modules first. Often it is easier to remove all modules, load the required ldwrapper module (which is needed for your programs to work when submitted using sqsub), and the the modules you need to use, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/5.1.0&lt;br /&gt;
$ module load openmpi/gcc-5.1.0/std/1.8.7&lt;br /&gt;
$ module load boost/gcc510-openmpi187/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling Programs Using CMake With Boost ==&lt;br /&gt;
&lt;br /&gt;
With CMake you will want code similar to the following to properly load Boost:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;find_package(&lt;br /&gt;
    Boost 1.56.0 REQUIRED&lt;br /&gt;
    COMPONENTS&lt;br /&gt;
        filesystem&lt;br /&gt;
        system&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# 1.56.0 is the MINIMUM version that can be used by your program. You should replace this with the version you are using, e.g., 1.59.0. (Know that omitting the minimum version setting can cause issues with CMake not finding Boost.)&lt;br /&gt;
# REQUIRED means that if the minimum version is not about to be used, an error will occur and compilation will be aborted. Generally it is a good idea to use REQUIRED to avoid cryptic compilation error messages when an incompatible version of Boost is used.&lt;br /&gt;
# If you use any Boost components that have library code that must be linked into your program, you will need to specify COMPONENTS followed by the names of those components. &lt;br /&gt;
&lt;br /&gt;
If CMake finds the wrong version of boost. Try telling CMake to not use the built in boost system path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set(Boost_NO_SYSTEM_PATHS ON)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will cause CMake to look at the BOOST_ROOT environment variable, instead of the default locations.&lt;br /&gt;
&lt;br /&gt;
You can view the names of all required-to-be-linked-to-a-library components for the version of Boost you are using by running the following command (after using &amp;quot;module load&amp;quot; to load the version of Boost you want to use):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will output something similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&lt;br /&gt;
atomic&lt;br /&gt;
chrono&lt;br /&gt;
context&lt;br /&gt;
coroutine&lt;br /&gt;
date_time&lt;br /&gt;
exception&lt;br /&gt;
filesystem&lt;br /&gt;
graph&lt;br /&gt;
graph_parallel&lt;br /&gt;
iostreams&lt;br /&gt;
locale&lt;br /&gt;
log&lt;br /&gt;
log_setup&lt;br /&gt;
math_c99&lt;br /&gt;
math_c99f&lt;br /&gt;
math_c99l&lt;br /&gt;
math_tr1&lt;br /&gt;
math_tr1f&lt;br /&gt;
math_tr1l&lt;br /&gt;
mpi&lt;br /&gt;
prg_exec_monitor&lt;br /&gt;
program_options&lt;br /&gt;
python&lt;br /&gt;
random&lt;br /&gt;
regex&lt;br /&gt;
serialization&lt;br /&gt;
signals&lt;br /&gt;
system&lt;br /&gt;
test_exec_monitor&lt;br /&gt;
thread&lt;br /&gt;
timer&lt;br /&gt;
unit_test_framework&lt;br /&gt;
wave&lt;br /&gt;
wserialization&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the library components depend on other components. For example, the &amp;quot;filesystem&amp;quot; component depends on the &amp;quot;system&amp;quot; component --so both of these must be specified in the find_package() CMake function call.&lt;br /&gt;
&lt;br /&gt;
You also will need lines similar to the follwing in your CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;add_executable(&lt;br /&gt;
    program.exe&lt;br /&gt;
    src/somecode.cxx&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
target_link_libraries(&lt;br /&gt;
    program.exe&lt;br /&gt;
    ${Boost_LIBRARIES}&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# program.exe is the executable being produced.&lt;br /&gt;
# ${Boost_LIBRARIES} is set by the find_package() function and contains all of the libraries it discovered (for the listed COMPONENTS section above).&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' With the target_link_libraries() set, you do not need or want to set LD_LIBRARY_PATH at all for Boost to work, i.e., if you are loading the SHARCNET module, everything is properly set. (With CMake you must tell it which libraries must be linked in to your executable --it is not automatic.)&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A Header-Only Example ==&lt;br /&gt;
&lt;br /&gt;
Many libraries in Boost are header-only (i.e., the program does not need to be linked to a library). With header-only libraries one does not specify any linking options when compiling/linking the code.&lt;br /&gt;
&lt;br /&gt;
Consider the following Boost.Multiprecision program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// This program's code combines code from the following Boost.Multiprecision documentation's pages:&lt;br /&gt;
//   1) http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html&lt;br /&gt;
//   2) http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_bin_float.html&lt;br /&gt;
//   3) http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/cpp_dec_float.html&lt;br /&gt;
&lt;br /&gt;
#include &amp;amp;lt;boost/multiprecision/cpp_int.hpp&amp;amp;gt; &lt;br /&gt;
#include &amp;amp;lt;boost/multiprecision/cpp_bin_float.hpp&amp;amp;gt;&lt;br /&gt;
#include &amp;amp;lt;boost/multiprecision/cpp_dec_float.hpp&amp;amp;gt; &lt;br /&gt;
#include &amp;amp;lt;boost/math/special_functions/gamma.hpp&amp;amp;gt;&lt;br /&gt;
#include &amp;amp;lt;iostream&amp;amp;gt;&lt;br /&gt;
  &lt;br /&gt;
void mp_int()&lt;br /&gt;
{&lt;br /&gt;
  // For integer type docs see:&lt;br /&gt;
  // http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html&lt;br /&gt;
&lt;br /&gt;
  // Example Boost docs code follows...&lt;br /&gt;
&lt;br /&gt;
  using namespace boost::multiprecision;&lt;br /&gt;
&lt;br /&gt;
  // Do some fixed precision arithmetic:&lt;br /&gt;
  int128_t v = 1;&lt;br /&gt;
  for (unsigned i = 1; i &amp;amp;lt;= 20; ++i)&lt;br /&gt;
    v *= i;&lt;br /&gt;
  std::cout &amp;amp;lt;&amp;amp;lt; v &amp;amp;lt;&amp;amp;lt; std::endl; // prints 20&lt;br /&gt;
&lt;br /&gt;
  // Repeat at arbitrary precision:&lt;br /&gt;
  cpp_int u = 1;&lt;br /&gt;
  for (unsigned i = 1; i &amp;amp;lt;= 100; ++i)&lt;br /&gt;
    u *= i;&lt;br /&gt;
  std::cout &amp;amp;lt;&amp;amp;lt; u &amp;amp;lt;&amp;amp;lt; std::endl; // prints 100&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void mp_bin_float()&lt;br /&gt;
{&lt;br /&gt;
  // For floating-point type docs see:&lt;br /&gt;
  // http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html&lt;br /&gt;
&lt;br /&gt;
  // Example Boost docs code follows...&lt;br /&gt;
&lt;br /&gt;
  using namespace boost::multiprecision;&lt;br /&gt;
&lt;br /&gt;
   // Operations at fixed precision and full numeric_limits support:&lt;br /&gt;
   cpp_bin_float_100 b = 2;&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_bin_float_100&amp;amp;gt;::digits &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_bin_float_100&amp;amp;gt;::digits10 &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // We can use any C++ std lib function, lets print all the digits as well:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::setprecision(std::numeric_limits&amp;amp;lt;cpp_bin_float_100&amp;amp;gt;::max_digits10)&lt;br /&gt;
      &amp;amp;lt;&amp;amp;lt; log(b) &amp;amp;lt;&amp;amp;lt; std::endl; // print log(2)&lt;br /&gt;
&lt;br /&gt;
   // We can also use any function from Boost.Math:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // These even work when the argument is an expression template:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b * b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // And since we have an extended exponent range we can generate some really large &lt;br /&gt;
   // numbers here (4.0238726007709377354370243e+2564):&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(cpp_bin_float_100(1000)) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void mp_dec_float()&lt;br /&gt;
{&lt;br /&gt;
   using namespace boost::multiprecision;&lt;br /&gt;
&lt;br /&gt;
   // Operations at fixed precision and full numeric_limits support:&lt;br /&gt;
   cpp_dec_float_100 b = 2;&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_dec_float_100&amp;amp;gt;::digits &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // Note that digits10 is the same as digits, since we&amp;amp;apos;re base 10! :&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::numeric_limits&amp;amp;lt;cpp_dec_float_100&amp;amp;gt;::digits10 &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // We can use any C++ std lib function, lets print all the digits as well:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; std::setprecision(std::numeric_limits&amp;amp;lt;cpp_dec_float_100&amp;amp;gt;::max_digits10)&lt;br /&gt;
      &amp;amp;lt;&amp;amp;lt; log(b) &amp;amp;lt;&amp;amp;lt; std::endl; // print log(2)&lt;br /&gt;
&lt;br /&gt;
   // We can also use any function from Boost.Math:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // These even work when the argument is an expression template:&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(b * b) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
   // And since we have an extended exponent range we can generate some really large &lt;br /&gt;
   // numbers here (4.0238726007709377354370243e+2564):&lt;br /&gt;
   std::cout &amp;amp;lt;&amp;amp;lt; boost::math::tgamma(cpp_dec_float_100(1000)) &amp;amp;lt;&amp;amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
  mp_int();&lt;br /&gt;
  mp_bin_float();&lt;br /&gt;
  mp_dec_float();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It be compiled and run using GCC v6.3.0 as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module unload gcc intel openmpi mkl boost&lt;br /&gt;
$ module load gcc/6.3.0 boost/gcc630/1.63.0&lt;br /&gt;
$ g++ -I$BOOST_ROOT/include boost-multiprecision.cxx&lt;br /&gt;
$ ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or with Intel v17.0.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module unload gcc intel openmpi mkl boost&lt;br /&gt;
$ module load intel/17.0.1 boost/intel1701/1.63.0&lt;br /&gt;
$ icpc -I$BOOST_ROOT/include boost-multiprecision.cxx&lt;br /&gt;
$ ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
If you don't load a SHARCNET boost module, your program will most likely link to the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' System versions are rather old and won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be updated. Therefore we '''strongly encourag''' using the SHARCNET provided Boost modules discussed above on this page.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=14977</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=14977"/>
				<updated>2017-03-17T18:33:19Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Compiling Programs Using CMake With Boost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
When you look up the available boost modules you will see output similar tossh-:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------ /opt/sharcnet/modules -------------------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0         boost/gcc510-openmpi187/1.59.0         boost/intel1503-openmpi187/1.59.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0         boost/gcc510-openmpi187debug/1.59.0    boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
boost/gcc492-openmpi187/1.59.0         boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc492-openmpi187debug/1.59.0    boost/intel12-openmpi162/1.55.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# versions 1.53 and 1.55 built with GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.53.0 and boost/gcc482-openmpi183/1.55.0&lt;br /&gt;
# version 1.59 built with GCC v4.9.2 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e.,, boost/gcc492-openmpi187/1.59.0  and boost/gcc492-openmpi187debug/1.59.0&lt;br /&gt;
# version 1.59 built with GCC v5.1.0 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/gcc510-openmpi187/1.59.0 and boost/gcc510-openmpi187debug/1.59.0&lt;br /&gt;
# versions 1.53 and 1.55 built with Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.53.0 and boost/intel12-openmpi162/1.55.0&lt;br /&gt;
# version 1.59 built with Intel v15.0.3 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/intel1503-openmpi187/1.59.0 and boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
=== Loading a module ===&lt;br /&gt;
&lt;br /&gt;
To load a specific module of Boost simply use &amp;quot;module load&amp;quot; followed by the module name, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module load boost/intel1503-openmpi187debug/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an error occurs, ensure that you load all pre-requisite modules first. Often it is easier to remove all modules, load the required ldwrapper module (which is needed for your programs to work when submitted using sqsub), and the the modules you need to use, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/5.1.0&lt;br /&gt;
$ module load openmpi/gcc-5.1.0/std/1.8.7&lt;br /&gt;
$ module load boost/gcc510-openmpi187/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling Programs Using CMake With Boost ==&lt;br /&gt;
&lt;br /&gt;
With CMake you will want code similar to the following to properly load Boost:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;find_package(&lt;br /&gt;
    Boost 1.56.0 REQUIRED&lt;br /&gt;
    COMPONENTS&lt;br /&gt;
        filesystem&lt;br /&gt;
        system&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# 1.56.0 is the MINIMUM version that can be used by your program. You should replace this with the version you are using, e.g., 1.59.0. (Know that omitting the minimum version setting can cause issues with CMake not finding Boost.)&lt;br /&gt;
# REQUIRED means that if the minimum version is not about to be used, an error will occur and compilation will be aborted. Generally it is a good idea to use REQUIRED to avoid cryptic compilation error messages when an incompatible version of Boost is used.&lt;br /&gt;
# If you use any Boost components that have library code that must be linked into your program, you will need to specify COMPONENTS followed by the names of those components. &lt;br /&gt;
&lt;br /&gt;
If CMake finds the wrong version of boost. Try telling CMake to not use the built in boost system path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set(Boost_NO_SYSTEM_PATHS ON)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will cause CMake to look at the BOOST_ROOT environment variable, instead of the default locations.&lt;br /&gt;
&lt;br /&gt;
You can view the names of all required-to-be-linked-to-a-library components for the version of Boost you are using by running the following command (after using &amp;quot;module load&amp;quot; to load the version of Boost you want to use):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will output something similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&lt;br /&gt;
atomic&lt;br /&gt;
chrono&lt;br /&gt;
context&lt;br /&gt;
coroutine&lt;br /&gt;
date_time&lt;br /&gt;
exception&lt;br /&gt;
filesystem&lt;br /&gt;
graph&lt;br /&gt;
graph_parallel&lt;br /&gt;
iostreams&lt;br /&gt;
locale&lt;br /&gt;
log&lt;br /&gt;
log_setup&lt;br /&gt;
math_c99&lt;br /&gt;
math_c99f&lt;br /&gt;
math_c99l&lt;br /&gt;
math_tr1&lt;br /&gt;
math_tr1f&lt;br /&gt;
math_tr1l&lt;br /&gt;
mpi&lt;br /&gt;
prg_exec_monitor&lt;br /&gt;
program_options&lt;br /&gt;
python&lt;br /&gt;
random&lt;br /&gt;
regex&lt;br /&gt;
serialization&lt;br /&gt;
signals&lt;br /&gt;
system&lt;br /&gt;
test_exec_monitor&lt;br /&gt;
thread&lt;br /&gt;
timer&lt;br /&gt;
unit_test_framework&lt;br /&gt;
wave&lt;br /&gt;
wserialization&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the library components depend on other components. For example, the &amp;quot;filesystem&amp;quot; component depends on the &amp;quot;system&amp;quot; component --so both of these must be specified in the find_package() CMake function call.&lt;br /&gt;
&lt;br /&gt;
You also will need lines similar to the follwing in your CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;add_executable(&lt;br /&gt;
    program.exe&lt;br /&gt;
    src/somecode.cxx&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
target_link_libraries(&lt;br /&gt;
    program.exe&lt;br /&gt;
    ${Boost_LIBRARIES}&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# program.exe is the executable being produced.&lt;br /&gt;
# ${Boost_LIBRARIES} is set by the find_package() function and contains all of the libraries it discovered (for the listed COMPONENTS section above).&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' With the target_link_libraries() set, you do not need or want to set LD_LIBRARY_PATH at all for Boost to work, i.e., if you are loading the SHARCNET module, everything is properly set. (With CMake you must tell it which libraries must be linked in to your executable --it is not automatic.)&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
If you don't load a SHARCNET boost module, your program will most likely link to the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' System versions are rather old and won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be updated. Therefore we '''strongly encourag''' using the SHARCNET provided Boost modules discussed above on this page.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=12589</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=12589"/>
				<updated>2015-12-19T15:57:04Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Loading a module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
When you look up the available boost modules you will see output similar tossh-:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------ /opt/sharcnet/modules -------------------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0         boost/gcc510-openmpi187/1.59.0         boost/intel1503-openmpi187/1.59.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0         boost/gcc510-openmpi187debug/1.59.0    boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
boost/gcc492-openmpi187/1.59.0         boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc492-openmpi187debug/1.59.0    boost/intel12-openmpi162/1.55.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# versions 1.53 and 1.55 built with GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.53.0 and boost/gcc482-openmpi183/1.55.0&lt;br /&gt;
# version 1.59 built with GCC v4.9.2 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e.,, boost/gcc492-openmpi187/1.59.0  and boost/gcc492-openmpi187debug/1.59.0&lt;br /&gt;
# version 1.59 built with GCC v5.1.0 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/gcc510-openmpi187/1.59.0 and boost/gcc510-openmpi187debug/1.59.0&lt;br /&gt;
# versions 1.53 and 1.55 built with Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.53.0 and boost/intel12-openmpi162/1.55.0&lt;br /&gt;
# version 1.59 built with Intel v15.0.3 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/intel1503-openmpi187/1.59.0 and boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
=== Loading a module ===&lt;br /&gt;
&lt;br /&gt;
To load a specific module of Boost simply use &amp;quot;module load&amp;quot; followed by the module name, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module load boost/intel1503-openmpi187debug/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an error occurs, ensure that you load all pre-requisite modules first. Often it is easier to remove all modules, load the required ldwrapper module (which is needed for your programs to work when submitted using sqsub), and the the modules you need to use, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/5.1.0&lt;br /&gt;
$ module load openmpi/gcc-5.1.0/std/1.8.7&lt;br /&gt;
$ module load boost/gcc510-openmpi187/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling Programs Using CMake With Boost ==&lt;br /&gt;
&lt;br /&gt;
With CMake you will want code similar to the following to properly load Boost:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;find_package(&lt;br /&gt;
    Boost 1.56.0 REQUIRED&lt;br /&gt;
    COMPONENTS&lt;br /&gt;
        filesystem&lt;br /&gt;
        system&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# 1.56.0 is the MINIMUM version that can be used by your program. You should replace this with the version you are using, e.g., 1.59.0. (Know that omitting the minimum version setting can cause issues with CMake not finding Boost.)&lt;br /&gt;
# REQUIRED means that if the minimum version is not about to be used, an error will occur and compilation will be aborted. Generally it is a good idea to use REQUIRED to avoid cryptic compilation error messages when an incompatible version of Boost is used.&lt;br /&gt;
# If you use any Boost components that have library code that must be linked into your program, you will need to specify COMPONENTS followed by the names of those components. &lt;br /&gt;
&lt;br /&gt;
You can view the names of all library components for the version of Boost you are using by running the following command (after using &amp;quot;module load&amp;quot; to load the version of Boost you want to use):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will output something similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&lt;br /&gt;
atomic&lt;br /&gt;
chrono&lt;br /&gt;
context&lt;br /&gt;
coroutine&lt;br /&gt;
date_time&lt;br /&gt;
exception&lt;br /&gt;
filesystem&lt;br /&gt;
graph&lt;br /&gt;
graph_parallel&lt;br /&gt;
iostreams&lt;br /&gt;
locale&lt;br /&gt;
log&lt;br /&gt;
log_setup&lt;br /&gt;
math_c99&lt;br /&gt;
math_c99f&lt;br /&gt;
math_c99l&lt;br /&gt;
math_tr1&lt;br /&gt;
math_tr1f&lt;br /&gt;
math_tr1l&lt;br /&gt;
mpi&lt;br /&gt;
prg_exec_monitor&lt;br /&gt;
program_options&lt;br /&gt;
python&lt;br /&gt;
random&lt;br /&gt;
regex&lt;br /&gt;
serialization&lt;br /&gt;
signals&lt;br /&gt;
system&lt;br /&gt;
test_exec_monitor&lt;br /&gt;
thread&lt;br /&gt;
timer&lt;br /&gt;
unit_test_framework&lt;br /&gt;
wave&lt;br /&gt;
wserialization&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the library components depend on other components. For example, the &amp;quot;filesystem&amp;quot; component depends on the &amp;quot;system&amp;quot; component --so both of these must be specified in the find_package() CMake function call.&lt;br /&gt;
&lt;br /&gt;
You also will need lines similar to the follwing in your CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;add_executable(&lt;br /&gt;
    program.exe&lt;br /&gt;
    src/somecode.cxx&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
target_link_libraries(&lt;br /&gt;
    program.exe&lt;br /&gt;
    ${Boost_LIBRARIES}&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# program.exe is the executable being produced.&lt;br /&gt;
# ${Boost_LIBRARIES} is set by the find_package() function and contains all of the libraries it discovered (for the listed COMPONENTS section above).&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' With the target_link_libraries() set, you do not need or want to set LD_LIBRARY_PATH at all for Boost to work, i.e., if you are loading the SHARCNET module, everything is properly set. (With CMake you must tell it which libraries must be linked in to your executable --it is not automatic.)&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
If you don't load a SHARCNET boost module, your program will most likely link to the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' System versions are rather old and won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be updated. Therefore we '''strongly encourag''' using the SHARCNET provided Boost modules discussed above on this page.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=12588</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=12588"/>
				<updated>2015-12-19T15:56:13Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Compiling Programs Using CMake With Boost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
When you look up the available boost modules you will see output similar tossh-:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------ /opt/sharcnet/modules -------------------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0         boost/gcc510-openmpi187/1.59.0         boost/intel1503-openmpi187/1.59.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0         boost/gcc510-openmpi187debug/1.59.0    boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
boost/gcc492-openmpi187/1.59.0         boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc492-openmpi187debug/1.59.0    boost/intel12-openmpi162/1.55.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# versions 1.53 and 1.55 built with GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.53.0 and boost/gcc482-openmpi183/1.55.0&lt;br /&gt;
# version 1.59 built with GCC v4.9.2 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e.,, boost/gcc492-openmpi187/1.59.0  and boost/gcc492-openmpi187debug/1.59.0&lt;br /&gt;
# version 1.59 built with GCC v5.1.0 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/gcc510-openmpi187/1.59.0 and boost/gcc510-openmpi187debug/1.59.0&lt;br /&gt;
# versions 1.53 and 1.55 built with Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.53.0 and boost/intel12-openmpi162/1.55.0&lt;br /&gt;
# version 1.59 built with Intel v15.0.3 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/intel1503-openmpi187/1.59.0 and boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
=== Loading a module ===&lt;br /&gt;
&lt;br /&gt;
To load a specific module of Boost simply use &amp;quot;module load&amp;quot; followed by the module name, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module load boost/intel1503-openmpi187debug/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an error occurs, ensure that you load all pre-requisite modules first. Often it is easier to remove all modules, load the required ldwrapper module (which is needed for your programs to work when submitted using sqsub), and the the modules you need to use, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module purge&lt;br /&gt;
module load ldwrapper&lt;br /&gt;
module load gcc/5.1.0&lt;br /&gt;
module load openmpi/gcc-5.1.0/std/1.8.7&lt;br /&gt;
module load boost/gcc510-openmpi187/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling Programs Using CMake With Boost ==&lt;br /&gt;
&lt;br /&gt;
With CMake you will want code similar to the following to properly load Boost:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;find_package(&lt;br /&gt;
    Boost 1.56.0 REQUIRED&lt;br /&gt;
    COMPONENTS&lt;br /&gt;
        filesystem&lt;br /&gt;
        system&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# 1.56.0 is the MINIMUM version that can be used by your program. You should replace this with the version you are using, e.g., 1.59.0. (Know that omitting the minimum version setting can cause issues with CMake not finding Boost.)&lt;br /&gt;
# REQUIRED means that if the minimum version is not about to be used, an error will occur and compilation will be aborted. Generally it is a good idea to use REQUIRED to avoid cryptic compilation error messages when an incompatible version of Boost is used.&lt;br /&gt;
# If you use any Boost components that have library code that must be linked into your program, you will need to specify COMPONENTS followed by the names of those components. &lt;br /&gt;
&lt;br /&gt;
You can view the names of all library components for the version of Boost you are using by running the following command (after using &amp;quot;module load&amp;quot; to load the version of Boost you want to use):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will output something similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&lt;br /&gt;
atomic&lt;br /&gt;
chrono&lt;br /&gt;
context&lt;br /&gt;
coroutine&lt;br /&gt;
date_time&lt;br /&gt;
exception&lt;br /&gt;
filesystem&lt;br /&gt;
graph&lt;br /&gt;
graph_parallel&lt;br /&gt;
iostreams&lt;br /&gt;
locale&lt;br /&gt;
log&lt;br /&gt;
log_setup&lt;br /&gt;
math_c99&lt;br /&gt;
math_c99f&lt;br /&gt;
math_c99l&lt;br /&gt;
math_tr1&lt;br /&gt;
math_tr1f&lt;br /&gt;
math_tr1l&lt;br /&gt;
mpi&lt;br /&gt;
prg_exec_monitor&lt;br /&gt;
program_options&lt;br /&gt;
python&lt;br /&gt;
random&lt;br /&gt;
regex&lt;br /&gt;
serialization&lt;br /&gt;
signals&lt;br /&gt;
system&lt;br /&gt;
test_exec_monitor&lt;br /&gt;
thread&lt;br /&gt;
timer&lt;br /&gt;
unit_test_framework&lt;br /&gt;
wave&lt;br /&gt;
wserialization&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the library components depend on other components. For example, the &amp;quot;filesystem&amp;quot; component depends on the &amp;quot;system&amp;quot; component --so both of these must be specified in the find_package() CMake function call.&lt;br /&gt;
&lt;br /&gt;
You also will need lines similar to the follwing in your CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;add_executable(&lt;br /&gt;
    program.exe&lt;br /&gt;
    src/somecode.cxx&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
target_link_libraries(&lt;br /&gt;
    program.exe&lt;br /&gt;
    ${Boost_LIBRARIES}&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# program.exe is the executable being produced.&lt;br /&gt;
# ${Boost_LIBRARIES} is set by the find_package() function and contains all of the libraries it discovered (for the listed COMPONENTS section above).&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' With the target_link_libraries() set, you do not need or want to set LD_LIBRARY_PATH at all for Boost to work, i.e., if you are loading the SHARCNET module, everything is properly set. (With CMake you must tell it which libraries must be linked in to your executable --it is not automatic.)&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
If you don't load a SHARCNET boost module, your program will most likely link to the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' System versions are rather old and won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be updated. Therefore we '''strongly encourag''' using the SHARCNET provided Boost modules discussed above on this page.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=12587</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=12587"/>
				<updated>2015-12-19T15:55:36Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Which Versions of Boost are Available? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
When you look up the available boost modules you will see output similar tossh-:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------ /opt/sharcnet/modules -------------------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0         boost/gcc510-openmpi187/1.59.0         boost/intel1503-openmpi187/1.59.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0         boost/gcc510-openmpi187debug/1.59.0    boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
boost/gcc492-openmpi187/1.59.0         boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc492-openmpi187debug/1.59.0    boost/intel12-openmpi162/1.55.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# versions 1.53 and 1.55 built with GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.53.0 and boost/gcc482-openmpi183/1.55.0&lt;br /&gt;
# version 1.59 built with GCC v4.9.2 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e.,, boost/gcc492-openmpi187/1.59.0  and boost/gcc492-openmpi187debug/1.59.0&lt;br /&gt;
# version 1.59 built with GCC v5.1.0 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/gcc510-openmpi187/1.59.0 and boost/gcc510-openmpi187debug/1.59.0&lt;br /&gt;
# versions 1.53 and 1.55 built with Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.53.0 and boost/intel12-openmpi162/1.55.0&lt;br /&gt;
# version 1.59 built with Intel v15.0.3 and non-debug and debug versions of OpenMPI v1.8.7&lt;br /&gt;
#* i.e., boost/intel1503-openmpi187/1.59.0 and boost/intel1503-openmpi187debug/1.59.0&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
=== Loading a module ===&lt;br /&gt;
&lt;br /&gt;
To load a specific module of Boost simply use &amp;quot;module load&amp;quot; followed by the module name, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module load boost/intel1503-openmpi187debug/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an error occurs, ensure that you load all pre-requisite modules first. Often it is easier to remove all modules, load the required ldwrapper module (which is needed for your programs to work when submitted using sqsub), and the the modules you need to use, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module purge&lt;br /&gt;
module load ldwrapper&lt;br /&gt;
module load gcc/5.1.0&lt;br /&gt;
module load openmpi/gcc-5.1.0/std/1.8.7&lt;br /&gt;
module load boost/gcc510-openmpi187/1.59.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling Programs Using CMake With Boost ==&lt;br /&gt;
&lt;br /&gt;
With CMake you will want code similar to the following to properly load Boost:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;find_package(&lt;br /&gt;
    Boost 1.56.0 REQUIRED&lt;br /&gt;
    COMPONENTS&lt;br /&gt;
        filesystem&lt;br /&gt;
        system&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# 1.56.0 is the MINIMUM version that can be used by your program. You should replace this with the version you are using, e.g., 1.59.0. (Know that omitting the minimum version setting can cause issues with CMake not finding Boost.)&lt;br /&gt;
# REQUIRED means that if the minimum version is not about to be used, an error will occur and compilation will be aborted. Generally it is a good idea to use REQUIRED to avoid cryptic compilation error messages when an incompatible version of Boost is used.&lt;br /&gt;
# If you use any Boost components that have library code that must be linked into your program, you will need to specify COMPONENTS followed by the names of those components. &lt;br /&gt;
&lt;br /&gt;
You can view the names of all library components for the version of Boost you are using by running the following command (after using &amp;quot;module load&amp;quot; to load the version of Boost you want to use):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will output something similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls -1 $BOOST_ROOT/lib/libboost*{so,a}* | xargs -n 1 basename | sed -e 's/^libboost_//' -e 's/\.so.*$//' -e 's/\.a.*$//' | sort -u&lt;br /&gt;
atomic&lt;br /&gt;
chrono&lt;br /&gt;
context&lt;br /&gt;
coroutine&lt;br /&gt;
date_time&lt;br /&gt;
exception&lt;br /&gt;
filesystem&lt;br /&gt;
graph&lt;br /&gt;
graph_parallel&lt;br /&gt;
iostreams&lt;br /&gt;
locale&lt;br /&gt;
log&lt;br /&gt;
log_setup&lt;br /&gt;
math_c99&lt;br /&gt;
math_c99f&lt;br /&gt;
math_c99l&lt;br /&gt;
math_tr1&lt;br /&gt;
math_tr1f&lt;br /&gt;
math_tr1l&lt;br /&gt;
mpi&lt;br /&gt;
prg_exec_monitor&lt;br /&gt;
program_options&lt;br /&gt;
python&lt;br /&gt;
random&lt;br /&gt;
regex&lt;br /&gt;
serialization&lt;br /&gt;
signals&lt;br /&gt;
system&lt;br /&gt;
test_exec_monitor&lt;br /&gt;
thread&lt;br /&gt;
timer&lt;br /&gt;
unit_test_framework&lt;br /&gt;
wave&lt;br /&gt;
wserialization&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the library components depend on other components. For example, the &amp;quot;filesystem&amp;quot; component depends on the &amp;quot;system&amp;quot; component --so both of these must be specified in the find_package() CMake function call.&lt;br /&gt;
&lt;br /&gt;
You also will need lines similar to the follwing in your CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
add_executable(&lt;br /&gt;
    program.exe&lt;br /&gt;
    src/somecode.cxx&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
target_link_libraries(&lt;br /&gt;
    program.exe&lt;br /&gt;
    ${Boost_LIBRARIES}&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
# program.exe is the executable being produced.&lt;br /&gt;
# ${Boost_LIBRARIES} is set by the find_package() function and contains all of the libraries it discovered (for the listed COMPONENTS section above).&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' With the target_link_libraries() set, you do not need or want to set LD_LIBRARY_PATH at all for Boost to work, i.e., if you are loading the SHARCNET module, everything is properly set. (With CMake you must tell it which libraries must be linked in to your executable --it is not automatic.)&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
If you don't load a SHARCNET boost module, your program will most likely link to the operating system's installed version of Boost. To determine which version(s) of boost and boost-devel are installed run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' System versions are rather old and won't be upgraded or maintained by SHARCNET staff unless something in the operating system requires it to be updated. Therefore we '''strongly encourag''' using the SHARCNET provided Boost modules discussed above on this page.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=MPFUN90&amp;diff=11973</id>
		<title>MPFUN90</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=MPFUN90&amp;diff=11973"/>
				<updated>2015-09-28T19:25:13Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=MPFUN90&lt;br /&gt;
|package_description=A Fortran-90 arbitrary precision package&lt;br /&gt;
|package_idnumber=16&lt;br /&gt;
}}&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' This page is currently in the process of being edited.&lt;br /&gt;
&lt;br /&gt;
MPFUN90 is a Fortran-90 arbitrary precision package (i.e. user specifies the desired precision).  The library is written by David H. Bailey et. al from the Lawrence Berkeley National Laboratory. If 64 digits of precision are sufficient for an application then users should use QD instead of MPFUN which would run much faster.&lt;br /&gt;
&lt;br /&gt;
=== Version Selection ===&lt;br /&gt;
* This page details how to use MPFUN90 (version 20100825) that is available as a SHARCNET module.&lt;br /&gt;
** '''NOTE:''' The only SHARCNET module currently available supports the Intel v15.0.3 Fortran compiler.&lt;br /&gt;
* There is an older MPFUN library version 6.1.23 for the intel compiler available on SHARCNET. See the [[MPFUN]] page for those details.&lt;br /&gt;
&lt;br /&gt;
===Job Submission===&lt;br /&gt;
To compile an MPFUN90 job you need to have the intel/15.0.3 module loaded. After loading it, use the following&lt;br /&gt;
command to compile an  MPFUN90 source file, my_mpfun.f90:&lt;br /&gt;
&lt;br /&gt;
  ifort my_mpfun.f90&lt;br /&gt;
&lt;br /&gt;
To submit the job to the serial queue use:&lt;br /&gt;
  sqsub -r  10m --mpp=2G -n 1   -o OUTPUT_MY_MPFUN ./a.out &lt;br /&gt;
&lt;br /&gt;
===Testing the MPFUN90 functions===&lt;br /&gt;
This example shows how to compile the test program &amp;lt;I&amp;gt;testmp90.f90&amp;lt;/I&amp;gt; using the SHARCNET mpfun build.  This program is used to verify DHB's multiprecision computation package MPFUN.  It exercises most routines and verifies that they are working properly.  Note that MPFUN was compiled with the intel compiler on each cluster shown in the availability table therefore its necessary to also compile the below example with the appropriate compiler.  The environment variable $FC handles this automatically as follows:&lt;br /&gt;
&lt;br /&gt;
Following commands copy the testmp90.f90 file into a user subdirectory and run the test.&lt;br /&gt;
&lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] cp /opt/sharcnet/mpfun/6.1.23/f90/src/testmp90.f90 .&lt;br /&gt;
 &lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] $FC testmp90.f90  -I/opt/sharcnet/mpfun/6.1.23/f90/include   \&lt;br /&gt;
                                                         -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp&lt;br /&gt;
 &lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] ./a.out&lt;br /&gt;
 Completed Test  1&lt;br /&gt;
 Completed Test  2&lt;br /&gt;
 etc&lt;br /&gt;
 Completed Test 60&lt;br /&gt;
 Completed Test 62&lt;br /&gt;
&lt;br /&gt;
===Simple MPFUN  example===&lt;br /&gt;
&lt;br /&gt;
Here is a simple MPFUN90 example and the commands required to compile and execute it:&lt;br /&gt;
&lt;br /&gt;
 ! file = factorial_100.f90&lt;br /&gt;
 &lt;br /&gt;
       program factorial_100_pgm&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       implicit none&lt;br /&gt;
       integer, parameter :: Nmx = 100&lt;br /&gt;
       integer            :: AllocateStatus&lt;br /&gt;
       integer            :: J&lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real), dimension (:), allocatable        :: fac&lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       allocate(fac(0:Nmx),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fac &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do J=1,Nmx&lt;br /&gt;
         fac(J)=fac(J-1)*J&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       J=4&lt;br /&gt;
       write(6,1001) J&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(J))&lt;br /&gt;
 &lt;br /&gt;
       J=100&lt;br /&gt;
       write(6,1001) J&lt;br /&gt;
       call mpwrite(6,fac(J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       end&lt;br /&gt;
 &lt;br /&gt;
Compile (copy/paste the three lines)&lt;br /&gt;
  &lt;br /&gt;
 $FC factorial_100.f90                             \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
&lt;br /&gt;
Execute code &lt;br /&gt;
&lt;br /&gt;
         ./a.out&lt;br /&gt;
 &lt;br /&gt;
 fac(004) =10 ^         1 x  2.4,&lt;br /&gt;
 &lt;br /&gt;
 fac(100) =10 ^       157 x  9.3326215443944152681699238856266700490715968264381621468592&lt;br /&gt;
 963895217599993229915608941463976156518286253697920827223758251185210916864,&lt;br /&gt;
 &lt;br /&gt;
 DONE&lt;br /&gt;
&lt;br /&gt;
===OpenMP with MPFUN and QD===&lt;br /&gt;
&lt;br /&gt;
The Multi Precision packages MPFUN90 and QD use &amp;quot;user defined data type&amp;quot; for their variables.&lt;br /&gt;
Since the OpenMP reduction clause cannot be used for &amp;quot;user defined data types&amp;quot; to run MPFUN90 or QD&lt;br /&gt;
with OpenMP the reduction must be done manually in a PARALLEL OpenMP region.&lt;br /&gt;
&lt;br /&gt;
Detailed documentation on how to use OpenMP with MPFUN90 and QD are presented in the following&lt;br /&gt;
document:&lt;br /&gt;
&lt;br /&gt;
https://www.sharcnet.ca/help/index.php/OpenMP_Reduction_for_User_Defined_Data_Types&lt;br /&gt;
&lt;br /&gt;
===Handling large arrays in an MPFUN program ===&lt;br /&gt;
&lt;br /&gt;
Declaring large arrays in an MPFUN program often leads to compile&lt;br /&gt;
errors like:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;relocation truncated to fit r_x86_64_pc32 against .bss&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Even with the flag '-mcmodel large' in the compile command the error&lt;br /&gt;
will persist, because there is a limit to the amount of data you can&lt;br /&gt;
have allocated in static arrays for x86_64 architecture. This data&lt;br /&gt;
segment is limited to 2GB. The data in COMMON plus any other&lt;br /&gt;
statically declared arrays PLUS your code must fit in 2GB.&lt;br /&gt;
&lt;br /&gt;
In order to overcome this problem use allocatable arrays declared in&lt;br /&gt;
a module together with a short subroutine which allocates the arrays.&lt;br /&gt;
&lt;br /&gt;
We illustrate these concepts by starting with a program 'betax.f90'&lt;br /&gt;
which work fine for values of parameter 'Nsz' less than 37. Thus, if&lt;br /&gt;
you compile it with&lt;br /&gt;
&lt;br /&gt;
       integer, parameter :: Nsz=36&lt;br /&gt;
&lt;br /&gt;
it works, but for any higher values it fails with error message:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;relocation truncated to fit: R_X86_64_PC32 against symbol '...'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To overcome this problem, we first copy program betax.f90 into a new file,&lt;br /&gt;
say, betay.f90, and write a module called 'mp_data' and a subroutine called&lt;br /&gt;
'allocate_arrays' at the top of the new file. We move all the declarations&lt;br /&gt;
of large arrays into the module, and declare them as 'allocatable'.&lt;br /&gt;
&lt;br /&gt;
In the subroutine 'allocate_arrays' we do the allocations and in the main&lt;br /&gt;
program we add the statements:&lt;br /&gt;
&lt;br /&gt;
      USE mp_data&lt;br /&gt;
      ...&lt;br /&gt;
      call allocate_arrays&lt;br /&gt;
      ...&lt;br /&gt;
&lt;br /&gt;
Below you will find the listings for the files 'betax.f90', 'betay.f90' and&lt;br /&gt;
the 'HIST' file containing the commands to compile these files and submit&lt;br /&gt;
jobs:&lt;br /&gt;
&lt;br /&gt;
 ! file betax.f90&lt;br /&gt;
 &lt;br /&gt;
       program BETAX&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       implicit none&lt;br /&gt;
 !     integer, parameter :: Nsz=12   ! compilation fails for 37&lt;br /&gt;
       integer, parameter :: Nsz=37&lt;br /&gt;
 &lt;br /&gt;
       INTEGER :: I,J,K,L&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) fac(0:Nsz),fci(0:Nsz)&lt;br /&gt;
       type(mp_real) BETA2(Nsz,Nsz)&lt;br /&gt;
       type(mp_real) BETA3(Nsz,Nsz,Nsz)&lt;br /&gt;
       type(mp_real) BETA4(Nsz,Nsz,Nsz,Nsz)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
       fci(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do j=1,Nsz&lt;br /&gt;
         fac(j)=fac(j-1)*j&lt;br /&gt;
         fci(j)=one/fac(j)&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       I=Nsz/2&lt;br /&gt;
       J=I-1&lt;br /&gt;
       K=J-1&lt;br /&gt;
       L=K-1&lt;br /&gt;
 &lt;br /&gt;
       write(6,1000) I,J,K,L&lt;br /&gt;
  1000 format(/&amp;quot;I,J,K,L = &amp;quot;,4i3)&lt;br /&gt;
  &lt;br /&gt;
       write(6,1001) I&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(I))&lt;br /&gt;
 &lt;br /&gt;
       BETA2(I,J)      =fac(I)*fac(J)*fci(I+J)&lt;br /&gt;
       BETA3(I,J,K)    =fac(I)*fac(J)*fac(K)*fci(I+J)*fci(J+K)&lt;br /&gt;
       BETA4(I,J,K,L)  =fac(I)*fac(J)*fac(K)*fac(L)*                     &amp;amp;&lt;br /&gt;
      &amp;amp;                 fci(I+J)*fci(J+K)*fci(K+L)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1002) I,J&lt;br /&gt;
  1002 format(/&amp;quot;BETA2(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA2(I,J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1003) I,J,K&lt;br /&gt;
  1003 format(/&amp;quot;BETA3(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA3(I,J,K))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1004) I,J,K,L&lt;br /&gt;
  1004 format(/&amp;quot;BETA4(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA4(I,J,K,L))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       stop&lt;br /&gt;
       end&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
 ! file betay.f90&lt;br /&gt;
 &lt;br /&gt;
       module mp_data&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       use mpfunmod&lt;br /&gt;
 &lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       integer, parameter :: Nsz =48&lt;br /&gt;
 &lt;br /&gt;
       integer            :: AllocateStatus&lt;br /&gt;
 &lt;br /&gt;
 !     type(mp_real) zero, one&lt;br /&gt;
 !&lt;br /&gt;
 !     type(mp_real) fac(0:Nsz),fci(0:Nsz)&lt;br /&gt;
 !     type(mp_real) BETA2(Nsz,Nsz)&lt;br /&gt;
 !     type(mp_real) BETA3(Nsz,Nsz,Nsz)&lt;br /&gt;
 !     type(mp_real) BETA4(Nsz,Nsz,Nsz,Nsz)&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real), dimension (:), allocatable        :: fac,fci&lt;br /&gt;
       type(mp_real), dimension (:,:), allocatable      :: BETA2&lt;br /&gt;
       type(mp_real), dimension (:,:,:), allocatable    :: BETA3&lt;br /&gt;
       type(mp_real), dimension (:,:,:,:), allocatable  :: BETA4&lt;br /&gt;
 &lt;br /&gt;
       end module mp_data&lt;br /&gt;
 &lt;br /&gt;
       subroutine allocate_arrays&lt;br /&gt;
 &lt;br /&gt;
       USE mp_data&lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       allocate(fac(0:Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fac &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(fci(0:Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fci &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA2(Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA2&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA3(Nsz,Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA3&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA4(Nsz,Nsz,Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA4&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       print *,&amp;quot;Done with allocations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       return&lt;br /&gt;
       END&lt;br /&gt;
 &lt;br /&gt;
 ! ----------------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
       program BETAY&lt;br /&gt;
       USE mp_data&lt;br /&gt;
 &lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       INTEGER :: I,J,K,L&lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       call allocate_arrays&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
       fci(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do j=1,Nsz&lt;br /&gt;
         fac(j)=fac(j-1)*j&lt;br /&gt;
         fci(j)=one/fac(j)&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       I=Nsz/2&lt;br /&gt;
       J=I-1&lt;br /&gt;
       K=J-1&lt;br /&gt;
       L=K-1&lt;br /&gt;
 &lt;br /&gt;
       write(6,1000) I,J,K,L&lt;br /&gt;
  1000 format(/&amp;quot;I,J,K,L = &amp;quot;,4i3)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1001) I&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(I))&lt;br /&gt;
 &lt;br /&gt;
       BETA2(I,J)      =fac(I)*fac(J)*fci(I+J)&lt;br /&gt;
       BETA3(I,J,K)    =fac(I)*fac(J)*fac(K)*fci(I+J)*fci(J+K)&lt;br /&gt;
       BETA4(I,J,K,L)  =fac(I)*fac(J)*fac(K)*fac(L)*                     &amp;amp;&lt;br /&gt;
      &amp;amp;                 fci(I+J)*fci(J+K)*fci(K+L)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1002) I,J&lt;br /&gt;
  1002 format(/&amp;quot;BETA2(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA2(I,J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1003) I,J,K&lt;br /&gt;
  1003 format(/&amp;quot;BETA3(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA3(I,J,K))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1004) I,J,K,L&lt;br /&gt;
  1004 format(/&amp;quot;BETA4(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA4(I,J,K,L))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       stop&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
 # file HIST&lt;br /&gt;
 #&lt;br /&gt;
 # Set Nsz=12&lt;br /&gt;
 &lt;br /&gt;
         vi betax.f90&lt;br /&gt;
 &lt;br /&gt;
 and set Nsz=12 in file betax.f90&lt;br /&gt;
 &lt;br /&gt;
 # Compile (copy/paste the three lines)&lt;br /&gt;
 &lt;br /&gt;
 ifort betax.f90                                   \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
 &lt;br /&gt;
 # Execute code (it should work)&lt;br /&gt;
 &lt;br /&gt;
         ./a.out&lt;br /&gt;
 &lt;br /&gt;
 # Set Nsz=40&lt;br /&gt;
 &lt;br /&gt;
         vi betax.f90&lt;br /&gt;
 &lt;br /&gt;
 and set Nsz=40 in file betax.f90&lt;br /&gt;
 &lt;br /&gt;
 # Re-compile and look at file AOUT1&lt;br /&gt;
 &lt;br /&gt;
 ifort betax.f90                                   \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
 &lt;br /&gt;
 # File betay.f90 was copied from betax.f90 and modified as described earlier.&lt;br /&gt;
 &lt;br /&gt;
 # Compile betay.f90&lt;br /&gt;
 &lt;br /&gt;
 ifort betay.f90 -mcmodel medium -shared-intel \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT2&lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
 &lt;br /&gt;
 # The executable might require more than 2.0G of memory: &lt;br /&gt;
 &lt;br /&gt;
 # This will pruduce an error: &lt;br /&gt;
 &lt;br /&gt;
 sqsub -r 5m  --mpp=4.0G  -o OUTPUTFILE4 ./a.out&lt;br /&gt;
 &lt;br /&gt;
 # This should work:&lt;br /&gt;
 &lt;br /&gt;
 sqsub -r 5m  --mpp=8.0G  -o OUTPUTFILE8 ./a.out&lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MPFUN's TOOLKIT===&lt;br /&gt;
&lt;br /&gt;
This toolkit provides and extensive example of how the mpfun package can be used.  Read the header of files &lt;br /&gt;
 mathinit.f90 &lt;br /&gt;
     and &lt;br /&gt;
 mathtool.f90 &lt;br /&gt;
found under &lt;br /&gt;
 /opt/sharcnet/mpfun/current/toolkit &lt;br /&gt;
for an explanation what the package does.  The Makefile in this directory shows how the mpfun libraries were linked to compile this sample program pair.  The following steps shows the first initialization step followed by actually running the mathtool program to perform some examples such as performing an integration and displaying the value of pie.  Note that the displayed zero cputimes are due to a bug in the mpfun current build which will be fixed in future updates on the clusters.&lt;br /&gt;
&lt;br /&gt;
====Initializing Mathtool====&lt;br /&gt;
To run Mathtool you must first generate following two input files &lt;br /&gt;
 const.dat &lt;br /&gt;
   and &lt;br /&gt;
 quadts.dat &lt;br /&gt;
&lt;br /&gt;
which can be accomplished by running following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] /opt/sharcnet/mpfun/current/toolkit/mathinit&lt;br /&gt;
 mathinit: start&lt;br /&gt;
 const complete&lt;br /&gt;
 file const.dat written&lt;br /&gt;
 cpu time = 0.E+0&lt;br /&gt;
initqts: Tanh-sinh quadrature initialization&lt;br /&gt;
 0 18632&lt;br /&gt;
 1000 18632&lt;br /&gt;
 2000 18632&lt;br /&gt;
 3000 18632&lt;br /&gt;
 4000 18632&lt;br /&gt;
 5000 18632&lt;br /&gt;
 6000 18632&lt;br /&gt;
 7000 18632&lt;br /&gt;
 8000 18632&lt;br /&gt;
initqts: Table spaced used =    8177&lt;br /&gt;
 initqts complete&lt;br /&gt;
 file quadts.dat written&lt;br /&gt;
 cpu time = 0.E+0&lt;br /&gt;
 total cpu time = 0.E+0&lt;br /&gt;
&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] ls&lt;br /&gt;
const.dat  quadts.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Running Mathtool====&lt;br /&gt;
Use the files created in the previous section to run mathtool as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] /opt/sharcnet/mpfun/current/toolkit/mathtool&lt;br /&gt;
Welcome to the Experimental Mathematician's Toolkit&lt;br /&gt;
Initializing...&lt;br /&gt;
&lt;br /&gt;
Current settings:&lt;br /&gt;
Debug level =   2&lt;br /&gt;
Primary precision level =   100 digits&lt;br /&gt;
Secondary precision level =   200 digits&lt;br /&gt;
Primary epsilon = 10^  -100&lt;br /&gt;
Secondary epsilon = 10^  -200&lt;br /&gt;
PSLQ bound = 100&lt;br /&gt;
PSLQ level =   1&lt;br /&gt;
Quadrature level =   6&lt;br /&gt;
Quadrature type =   3  (Tanh-Sinh)&lt;br /&gt;
-- snip --&lt;br /&gt;
&lt;br /&gt;
TYPE: integrate[1/(1+x^2), {x, 0, 1}]   (hit enter)&lt;br /&gt;
quadts: Iteration  1 of  6; est error = 10^    0; approx value =&lt;br /&gt;
       7.853157298876894309110693190063938396203990510665917998384243e-1&lt;br /&gt;
quadts: Iteration  2 of  6; est error = 10^    0; approx value =&lt;br /&gt;
       7.853981605125528448099840689980111720633592558858121242731082e-1&lt;br /&gt;
quadts: Iteration  3 of  6; est error = 10^  -17; approx value =&lt;br /&gt;
       7.853981633974483082028533923930157568609007576776270726821597e-1&lt;br /&gt;
quadts: Iteration  4 of  6; est error = 10^  -36; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757190586422063114153956005278e-1&lt;br /&gt;
quadts: Iteration  5 of  6; est error = 10^  -71; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757210492923498437764552437361e-1&lt;br /&gt;
quadts: Iteration  6 of  6; est error = 10^ -101; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757210492923498437764552437361e-1&lt;br /&gt;
Result[  1] =&lt;br /&gt;
     7.85398163397448309615660845819875721049292349843776455243736148076954e-1&lt;br /&gt;
CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
TYPE: functions  (hit enter)&lt;br /&gt;
Abs              Arccos           Arcsin           Arctan          &lt;br /&gt;
Arctan2          Bessel           Besselexp        Binomial        &lt;br /&gt;
Cos              Erf              Exp              Factorial       &lt;br /&gt;
Gamma            Integrate        Log              Max             &lt;br /&gt;
Min              Polyroot         Pslq             Result          &lt;br /&gt;
Sin              Sqrt             Sum              Table           &lt;br /&gt;
Tan              Zeta             Zetap            Zetaz           &lt;br /&gt;
&lt;br /&gt;
TYPE: variables  (hit enter)&lt;br /&gt;
E                Log2             Log10            Pi              &lt;br /&gt;
Catalan          Eulergamma       Infinity         Arg1            &lt;br /&gt;
Arg2             Arg3             Arg4             Arg5            &lt;br /&gt;
Arg6             Arg7             Arg8             Arg9            &lt;br /&gt;
Debug            Digits           Digits2          Epsilon         &lt;br /&gt;
Epsilon2         Pslqbound        Pslqlevel        Quadlevel       &lt;br /&gt;
Quadtype         x                &lt;br /&gt;
&lt;br /&gt;
TYPE: Pi  (hit enter)&lt;br /&gt;
Result[  2] =&lt;br /&gt;
      3.14159265358979323846264338327950288419716939937510582097494459230781e0&lt;br /&gt;
CPU time =      0.0000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====More Mathtool commands====&lt;br /&gt;
To start mathtool (assuming you have issued the command /opt/sharcnet/mpfun/current/toolkit/mathinit and have these two files: const.dat  HIST  quadts.dat  - you type:&lt;br /&gt;
 &lt;br /&gt;
 /opt/sharcnet/mpfun/current/toolkit/mathtool&lt;br /&gt;
&lt;br /&gt;
Then try following commands:&lt;br /&gt;
 integrate[2*x,{x,0,1}]&lt;br /&gt;
 sqrt[1600]&lt;br /&gt;
 help  Binomial&lt;br /&gt;
 Binomial[3,2]&lt;br /&gt;
 hypo[x,y] = sqrt[x^2+y^2]&lt;br /&gt;
 z=hypo[3,4]&lt;br /&gt;
 z&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
This is what you should get from above commands:&lt;br /&gt;
&lt;br /&gt;
 integrate[2*x,{x,0,1}]&lt;br /&gt;
 quadts: Iteration  1 of  6; est error = 10^    0; approx  value =&lt;br /&gt;
         1.000003359570811224742398159504692881030640064061042259417294e0&lt;br /&gt;
 quadts: Iteration  2 of  6; est error = 10^    0; approx value =&lt;br /&gt;
          1.000000000000036584185557611216071731517571134591404403031033e0&lt;br /&gt;
 quadts: Iteration  3 of  6; est error = 10^  -27; approx  value =&lt;br /&gt;
         1.000000000000000000000000000001046972220803162709182580101627e0&lt;br /&gt;
 quadts: Iteration  4 of  6; est error = 10^  -60; approx value =&lt;br /&gt;
          1.000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 quadts: Iteration  5 of  6; est error = 10^ -101; approx  value =&lt;br /&gt;
       9.999999999999999999999999999999999999999999999999999999999999e-1&lt;br /&gt;
 Result[  1] =&lt;br /&gt;
     9.99999999999999999999999999999999999999999999999999999999999999999999e-1&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 sqrt[1600]&lt;br /&gt;
 Result[  2] =&lt;br /&gt;
       4.00000000000000000000000000000000000000000000000000000000000000000000e1&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 help  Binomial&lt;br /&gt;
 Binomial[m,n] computes the binomial coefficient of integers (m,n).&lt;br /&gt;
&lt;br /&gt;
 Binomial[3,2]&lt;br /&gt;
 Result[  3] =&lt;br /&gt;
      3.00000000000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 hypo[x,y] = sqrt[x^2+y^2]&lt;br /&gt;
 parse: new function name = hypo&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 z=hypo[3,4]&lt;br /&gt;
 parse: new variable name = z&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 z&lt;br /&gt;
 Result[  4] =&lt;br /&gt;
       5.00000000000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o High-Precision Software Directory&amp;lt;br&amp;gt;&lt;br /&gt;
http://crd.lbl.gov/~dhbailey/mpdist/index.html&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=MPFUN90&amp;diff=11972</id>
		<title>MPFUN90</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=MPFUN90&amp;diff=11972"/>
				<updated>2015-09-28T19:24:41Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=MPFUN90&lt;br /&gt;
|package_description=A Fortran-90 arbitrary precision package&lt;br /&gt;
|package_idnumber=16&lt;br /&gt;
}}&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
MPFUN90 is a Fortran-90 arbitrary precision package (i.e. user specifies the desired precision).  The library is written by David H. Bailey et. al from the Lawrence Berkeley National Laboratory. If 64 digits of precision are sufficient for an application then users should use QD instead of MPFUN which would run much faster.&lt;br /&gt;
&lt;br /&gt;
=== Version Selection ===&lt;br /&gt;
* This page details how to use MPFUN90 (version 20100825) that is available as a SHARCNET module.&lt;br /&gt;
** '''NOTE:''' The only SHARCNET module currently available supports the Intel v15.0.3 Fortran compiler.&lt;br /&gt;
* There is an older MPFUN library version 6.1.23 for the intel compiler available on SHARCNET. See the [[MPFUN]] page for those details.&lt;br /&gt;
&lt;br /&gt;
===Job Submission===&lt;br /&gt;
To compile an MPFUN90 job you need to have the intel/15.0.3 module loaded. After loading it, use the following&lt;br /&gt;
command to compile an  MPFUN90 source file, my_mpfun.f90:&lt;br /&gt;
&lt;br /&gt;
  ifort my_mpfun.f90&lt;br /&gt;
&lt;br /&gt;
To submit the job to the serial queue use:&lt;br /&gt;
  sqsub -r  10m --mpp=2G -n 1   -o OUTPUT_MY_MPFUN ./a.out &lt;br /&gt;
&lt;br /&gt;
===Testing the MPFUN90 functions===&lt;br /&gt;
This example shows how to compile the test program &amp;lt;I&amp;gt;testmp90.f90&amp;lt;/I&amp;gt; using the SHARCNET mpfun build.  This program is used to verify DHB's multiprecision computation package MPFUN.  It exercises most routines and verifies that they are working properly.  Note that MPFUN was compiled with the intel compiler on each cluster shown in the availability table therefore its necessary to also compile the below example with the appropriate compiler.  The environment variable $FC handles this automatically as follows:&lt;br /&gt;
&lt;br /&gt;
Following commands copy the testmp90.f90 file into a user subdirectory and run the test.&lt;br /&gt;
&lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] cp /opt/sharcnet/mpfun/6.1.23/f90/src/testmp90.f90 .&lt;br /&gt;
 &lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] $FC testmp90.f90  -I/opt/sharcnet/mpfun/6.1.23/f90/include   \&lt;br /&gt;
                                                         -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp&lt;br /&gt;
 &lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] ./a.out&lt;br /&gt;
 Completed Test  1&lt;br /&gt;
 Completed Test  2&lt;br /&gt;
 etc&lt;br /&gt;
 Completed Test 60&lt;br /&gt;
 Completed Test 62&lt;br /&gt;
&lt;br /&gt;
===Simple MPFUN  example===&lt;br /&gt;
&lt;br /&gt;
Here is a simple MPFUN90 example and the commands required to compile and execute it:&lt;br /&gt;
&lt;br /&gt;
 ! file = factorial_100.f90&lt;br /&gt;
 &lt;br /&gt;
       program factorial_100_pgm&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       implicit none&lt;br /&gt;
       integer, parameter :: Nmx = 100&lt;br /&gt;
       integer            :: AllocateStatus&lt;br /&gt;
       integer            :: J&lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real), dimension (:), allocatable        :: fac&lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       allocate(fac(0:Nmx),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fac &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do J=1,Nmx&lt;br /&gt;
         fac(J)=fac(J-1)*J&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       J=4&lt;br /&gt;
       write(6,1001) J&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(J))&lt;br /&gt;
 &lt;br /&gt;
       J=100&lt;br /&gt;
       write(6,1001) J&lt;br /&gt;
       call mpwrite(6,fac(J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       end&lt;br /&gt;
 &lt;br /&gt;
Compile (copy/paste the three lines)&lt;br /&gt;
  &lt;br /&gt;
 $FC factorial_100.f90                             \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
&lt;br /&gt;
Execute code &lt;br /&gt;
&lt;br /&gt;
         ./a.out&lt;br /&gt;
 &lt;br /&gt;
 fac(004) =10 ^         1 x  2.4,&lt;br /&gt;
 &lt;br /&gt;
 fac(100) =10 ^       157 x  9.3326215443944152681699238856266700490715968264381621468592&lt;br /&gt;
 963895217599993229915608941463976156518286253697920827223758251185210916864,&lt;br /&gt;
 &lt;br /&gt;
 DONE&lt;br /&gt;
&lt;br /&gt;
===OpenMP with MPFUN and QD===&lt;br /&gt;
&lt;br /&gt;
The Multi Precision packages MPFUN90 and QD use &amp;quot;user defined data type&amp;quot; for their variables.&lt;br /&gt;
Since the OpenMP reduction clause cannot be used for &amp;quot;user defined data types&amp;quot; to run MPFUN90 or QD&lt;br /&gt;
with OpenMP the reduction must be done manually in a PARALLEL OpenMP region.&lt;br /&gt;
&lt;br /&gt;
Detailed documentation on how to use OpenMP with MPFUN90 and QD are presented in the following&lt;br /&gt;
document:&lt;br /&gt;
&lt;br /&gt;
https://www.sharcnet.ca/help/index.php/OpenMP_Reduction_for_User_Defined_Data_Types&lt;br /&gt;
&lt;br /&gt;
===Handling large arrays in an MPFUN program ===&lt;br /&gt;
&lt;br /&gt;
Declaring large arrays in an MPFUN program often leads to compile&lt;br /&gt;
errors like:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;relocation truncated to fit r_x86_64_pc32 against .bss&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Even with the flag '-mcmodel large' in the compile command the error&lt;br /&gt;
will persist, because there is a limit to the amount of data you can&lt;br /&gt;
have allocated in static arrays for x86_64 architecture. This data&lt;br /&gt;
segment is limited to 2GB. The data in COMMON plus any other&lt;br /&gt;
statically declared arrays PLUS your code must fit in 2GB.&lt;br /&gt;
&lt;br /&gt;
In order to overcome this problem use allocatable arrays declared in&lt;br /&gt;
a module together with a short subroutine which allocates the arrays.&lt;br /&gt;
&lt;br /&gt;
We illustrate these concepts by starting with a program 'betax.f90'&lt;br /&gt;
which work fine for values of parameter 'Nsz' less than 37. Thus, if&lt;br /&gt;
you compile it with&lt;br /&gt;
&lt;br /&gt;
       integer, parameter :: Nsz=36&lt;br /&gt;
&lt;br /&gt;
it works, but for any higher values it fails with error message:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;relocation truncated to fit: R_X86_64_PC32 against symbol '...'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To overcome this problem, we first copy program betax.f90 into a new file,&lt;br /&gt;
say, betay.f90, and write a module called 'mp_data' and a subroutine called&lt;br /&gt;
'allocate_arrays' at the top of the new file. We move all the declarations&lt;br /&gt;
of large arrays into the module, and declare them as 'allocatable'.&lt;br /&gt;
&lt;br /&gt;
In the subroutine 'allocate_arrays' we do the allocations and in the main&lt;br /&gt;
program we add the statements:&lt;br /&gt;
&lt;br /&gt;
      USE mp_data&lt;br /&gt;
      ...&lt;br /&gt;
      call allocate_arrays&lt;br /&gt;
      ...&lt;br /&gt;
&lt;br /&gt;
Below you will find the listings for the files 'betax.f90', 'betay.f90' and&lt;br /&gt;
the 'HIST' file containing the commands to compile these files and submit&lt;br /&gt;
jobs:&lt;br /&gt;
&lt;br /&gt;
 ! file betax.f90&lt;br /&gt;
 &lt;br /&gt;
       program BETAX&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       implicit none&lt;br /&gt;
 !     integer, parameter :: Nsz=12   ! compilation fails for 37&lt;br /&gt;
       integer, parameter :: Nsz=37&lt;br /&gt;
 &lt;br /&gt;
       INTEGER :: I,J,K,L&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) fac(0:Nsz),fci(0:Nsz)&lt;br /&gt;
       type(mp_real) BETA2(Nsz,Nsz)&lt;br /&gt;
       type(mp_real) BETA3(Nsz,Nsz,Nsz)&lt;br /&gt;
       type(mp_real) BETA4(Nsz,Nsz,Nsz,Nsz)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
       fci(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do j=1,Nsz&lt;br /&gt;
         fac(j)=fac(j-1)*j&lt;br /&gt;
         fci(j)=one/fac(j)&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       I=Nsz/2&lt;br /&gt;
       J=I-1&lt;br /&gt;
       K=J-1&lt;br /&gt;
       L=K-1&lt;br /&gt;
 &lt;br /&gt;
       write(6,1000) I,J,K,L&lt;br /&gt;
  1000 format(/&amp;quot;I,J,K,L = &amp;quot;,4i3)&lt;br /&gt;
  &lt;br /&gt;
       write(6,1001) I&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(I))&lt;br /&gt;
 &lt;br /&gt;
       BETA2(I,J)      =fac(I)*fac(J)*fci(I+J)&lt;br /&gt;
       BETA3(I,J,K)    =fac(I)*fac(J)*fac(K)*fci(I+J)*fci(J+K)&lt;br /&gt;
       BETA4(I,J,K,L)  =fac(I)*fac(J)*fac(K)*fac(L)*                     &amp;amp;&lt;br /&gt;
      &amp;amp;                 fci(I+J)*fci(J+K)*fci(K+L)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1002) I,J&lt;br /&gt;
  1002 format(/&amp;quot;BETA2(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA2(I,J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1003) I,J,K&lt;br /&gt;
  1003 format(/&amp;quot;BETA3(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA3(I,J,K))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1004) I,J,K,L&lt;br /&gt;
  1004 format(/&amp;quot;BETA4(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA4(I,J,K,L))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       stop&lt;br /&gt;
       end&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
 ! file betay.f90&lt;br /&gt;
 &lt;br /&gt;
       module mp_data&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       use mpfunmod&lt;br /&gt;
 &lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       integer, parameter :: Nsz =48&lt;br /&gt;
 &lt;br /&gt;
       integer            :: AllocateStatus&lt;br /&gt;
 &lt;br /&gt;
 !     type(mp_real) zero, one&lt;br /&gt;
 !&lt;br /&gt;
 !     type(mp_real) fac(0:Nsz),fci(0:Nsz)&lt;br /&gt;
 !     type(mp_real) BETA2(Nsz,Nsz)&lt;br /&gt;
 !     type(mp_real) BETA3(Nsz,Nsz,Nsz)&lt;br /&gt;
 !     type(mp_real) BETA4(Nsz,Nsz,Nsz,Nsz)&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real), dimension (:), allocatable        :: fac,fci&lt;br /&gt;
       type(mp_real), dimension (:,:), allocatable      :: BETA2&lt;br /&gt;
       type(mp_real), dimension (:,:,:), allocatable    :: BETA3&lt;br /&gt;
       type(mp_real), dimension (:,:,:,:), allocatable  :: BETA4&lt;br /&gt;
 &lt;br /&gt;
       end module mp_data&lt;br /&gt;
 &lt;br /&gt;
       subroutine allocate_arrays&lt;br /&gt;
 &lt;br /&gt;
       USE mp_data&lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       allocate(fac(0:Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fac &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(fci(0:Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fci &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA2(Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA2&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA3(Nsz,Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA3&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA4(Nsz,Nsz,Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA4&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       print *,&amp;quot;Done with allocations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       return&lt;br /&gt;
       END&lt;br /&gt;
 &lt;br /&gt;
 ! ----------------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
       program BETAY&lt;br /&gt;
       USE mp_data&lt;br /&gt;
 &lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       INTEGER :: I,J,K,L&lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       call allocate_arrays&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
       fci(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do j=1,Nsz&lt;br /&gt;
         fac(j)=fac(j-1)*j&lt;br /&gt;
         fci(j)=one/fac(j)&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       I=Nsz/2&lt;br /&gt;
       J=I-1&lt;br /&gt;
       K=J-1&lt;br /&gt;
       L=K-1&lt;br /&gt;
 &lt;br /&gt;
       write(6,1000) I,J,K,L&lt;br /&gt;
  1000 format(/&amp;quot;I,J,K,L = &amp;quot;,4i3)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1001) I&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(I))&lt;br /&gt;
 &lt;br /&gt;
       BETA2(I,J)      =fac(I)*fac(J)*fci(I+J)&lt;br /&gt;
       BETA3(I,J,K)    =fac(I)*fac(J)*fac(K)*fci(I+J)*fci(J+K)&lt;br /&gt;
       BETA4(I,J,K,L)  =fac(I)*fac(J)*fac(K)*fac(L)*                     &amp;amp;&lt;br /&gt;
      &amp;amp;                 fci(I+J)*fci(J+K)*fci(K+L)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1002) I,J&lt;br /&gt;
  1002 format(/&amp;quot;BETA2(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA2(I,J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1003) I,J,K&lt;br /&gt;
  1003 format(/&amp;quot;BETA3(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA3(I,J,K))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1004) I,J,K,L&lt;br /&gt;
  1004 format(/&amp;quot;BETA4(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA4(I,J,K,L))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       stop&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
 # file HIST&lt;br /&gt;
 #&lt;br /&gt;
 # Set Nsz=12&lt;br /&gt;
 &lt;br /&gt;
         vi betax.f90&lt;br /&gt;
 &lt;br /&gt;
 and set Nsz=12 in file betax.f90&lt;br /&gt;
 &lt;br /&gt;
 # Compile (copy/paste the three lines)&lt;br /&gt;
 &lt;br /&gt;
 ifort betax.f90                                   \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
 &lt;br /&gt;
 # Execute code (it should work)&lt;br /&gt;
 &lt;br /&gt;
         ./a.out&lt;br /&gt;
 &lt;br /&gt;
 # Set Nsz=40&lt;br /&gt;
 &lt;br /&gt;
         vi betax.f90&lt;br /&gt;
 &lt;br /&gt;
 and set Nsz=40 in file betax.f90&lt;br /&gt;
 &lt;br /&gt;
 # Re-compile and look at file AOUT1&lt;br /&gt;
 &lt;br /&gt;
 ifort betax.f90                                   \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
 &lt;br /&gt;
 # File betay.f90 was copied from betax.f90 and modified as described earlier.&lt;br /&gt;
 &lt;br /&gt;
 # Compile betay.f90&lt;br /&gt;
 &lt;br /&gt;
 ifort betay.f90 -mcmodel medium -shared-intel \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT2&lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
 &lt;br /&gt;
 # The executable might require more than 2.0G of memory: &lt;br /&gt;
 &lt;br /&gt;
 # This will pruduce an error: &lt;br /&gt;
 &lt;br /&gt;
 sqsub -r 5m  --mpp=4.0G  -o OUTPUTFILE4 ./a.out&lt;br /&gt;
 &lt;br /&gt;
 # This should work:&lt;br /&gt;
 &lt;br /&gt;
 sqsub -r 5m  --mpp=8.0G  -o OUTPUTFILE8 ./a.out&lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MPFUN's TOOLKIT===&lt;br /&gt;
&lt;br /&gt;
This toolkit provides and extensive example of how the mpfun package can be used.  Read the header of files &lt;br /&gt;
 mathinit.f90 &lt;br /&gt;
     and &lt;br /&gt;
 mathtool.f90 &lt;br /&gt;
found under &lt;br /&gt;
 /opt/sharcnet/mpfun/current/toolkit &lt;br /&gt;
for an explanation what the package does.  The Makefile in this directory shows how the mpfun libraries were linked to compile this sample program pair.  The following steps shows the first initialization step followed by actually running the mathtool program to perform some examples such as performing an integration and displaying the value of pie.  Note that the displayed zero cputimes are due to a bug in the mpfun current build which will be fixed in future updates on the clusters.&lt;br /&gt;
&lt;br /&gt;
====Initializing Mathtool====&lt;br /&gt;
To run Mathtool you must first generate following two input files &lt;br /&gt;
 const.dat &lt;br /&gt;
   and &lt;br /&gt;
 quadts.dat &lt;br /&gt;
&lt;br /&gt;
which can be accomplished by running following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] /opt/sharcnet/mpfun/current/toolkit/mathinit&lt;br /&gt;
 mathinit: start&lt;br /&gt;
 const complete&lt;br /&gt;
 file const.dat written&lt;br /&gt;
 cpu time = 0.E+0&lt;br /&gt;
initqts: Tanh-sinh quadrature initialization&lt;br /&gt;
 0 18632&lt;br /&gt;
 1000 18632&lt;br /&gt;
 2000 18632&lt;br /&gt;
 3000 18632&lt;br /&gt;
 4000 18632&lt;br /&gt;
 5000 18632&lt;br /&gt;
 6000 18632&lt;br /&gt;
 7000 18632&lt;br /&gt;
 8000 18632&lt;br /&gt;
initqts: Table spaced used =    8177&lt;br /&gt;
 initqts complete&lt;br /&gt;
 file quadts.dat written&lt;br /&gt;
 cpu time = 0.E+0&lt;br /&gt;
 total cpu time = 0.E+0&lt;br /&gt;
&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] ls&lt;br /&gt;
const.dat  quadts.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Running Mathtool====&lt;br /&gt;
Use the files created in the previous section to run mathtool as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] /opt/sharcnet/mpfun/current/toolkit/mathtool&lt;br /&gt;
Welcome to the Experimental Mathematician's Toolkit&lt;br /&gt;
Initializing...&lt;br /&gt;
&lt;br /&gt;
Current settings:&lt;br /&gt;
Debug level =   2&lt;br /&gt;
Primary precision level =   100 digits&lt;br /&gt;
Secondary precision level =   200 digits&lt;br /&gt;
Primary epsilon = 10^  -100&lt;br /&gt;
Secondary epsilon = 10^  -200&lt;br /&gt;
PSLQ bound = 100&lt;br /&gt;
PSLQ level =   1&lt;br /&gt;
Quadrature level =   6&lt;br /&gt;
Quadrature type =   3  (Tanh-Sinh)&lt;br /&gt;
-- snip --&lt;br /&gt;
&lt;br /&gt;
TYPE: integrate[1/(1+x^2), {x, 0, 1}]   (hit enter)&lt;br /&gt;
quadts: Iteration  1 of  6; est error = 10^    0; approx value =&lt;br /&gt;
       7.853157298876894309110693190063938396203990510665917998384243e-1&lt;br /&gt;
quadts: Iteration  2 of  6; est error = 10^    0; approx value =&lt;br /&gt;
       7.853981605125528448099840689980111720633592558858121242731082e-1&lt;br /&gt;
quadts: Iteration  3 of  6; est error = 10^  -17; approx value =&lt;br /&gt;
       7.853981633974483082028533923930157568609007576776270726821597e-1&lt;br /&gt;
quadts: Iteration  4 of  6; est error = 10^  -36; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757190586422063114153956005278e-1&lt;br /&gt;
quadts: Iteration  5 of  6; est error = 10^  -71; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757210492923498437764552437361e-1&lt;br /&gt;
quadts: Iteration  6 of  6; est error = 10^ -101; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757210492923498437764552437361e-1&lt;br /&gt;
Result[  1] =&lt;br /&gt;
     7.85398163397448309615660845819875721049292349843776455243736148076954e-1&lt;br /&gt;
CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
TYPE: functions  (hit enter)&lt;br /&gt;
Abs              Arccos           Arcsin           Arctan          &lt;br /&gt;
Arctan2          Bessel           Besselexp        Binomial        &lt;br /&gt;
Cos              Erf              Exp              Factorial       &lt;br /&gt;
Gamma            Integrate        Log              Max             &lt;br /&gt;
Min              Polyroot         Pslq             Result          &lt;br /&gt;
Sin              Sqrt             Sum              Table           &lt;br /&gt;
Tan              Zeta             Zetap            Zetaz           &lt;br /&gt;
&lt;br /&gt;
TYPE: variables  (hit enter)&lt;br /&gt;
E                Log2             Log10            Pi              &lt;br /&gt;
Catalan          Eulergamma       Infinity         Arg1            &lt;br /&gt;
Arg2             Arg3             Arg4             Arg5            &lt;br /&gt;
Arg6             Arg7             Arg8             Arg9            &lt;br /&gt;
Debug            Digits           Digits2          Epsilon         &lt;br /&gt;
Epsilon2         Pslqbound        Pslqlevel        Quadlevel       &lt;br /&gt;
Quadtype         x                &lt;br /&gt;
&lt;br /&gt;
TYPE: Pi  (hit enter)&lt;br /&gt;
Result[  2] =&lt;br /&gt;
      3.14159265358979323846264338327950288419716939937510582097494459230781e0&lt;br /&gt;
CPU time =      0.0000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====More Mathtool commands====&lt;br /&gt;
To start mathtool (assuming you have issued the command /opt/sharcnet/mpfun/current/toolkit/mathinit and have these two files: const.dat  HIST  quadts.dat  - you type:&lt;br /&gt;
 &lt;br /&gt;
 /opt/sharcnet/mpfun/current/toolkit/mathtool&lt;br /&gt;
&lt;br /&gt;
Then try following commands:&lt;br /&gt;
 integrate[2*x,{x,0,1}]&lt;br /&gt;
 sqrt[1600]&lt;br /&gt;
 help  Binomial&lt;br /&gt;
 Binomial[3,2]&lt;br /&gt;
 hypo[x,y] = sqrt[x^2+y^2]&lt;br /&gt;
 z=hypo[3,4]&lt;br /&gt;
 z&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
This is what you should get from above commands:&lt;br /&gt;
&lt;br /&gt;
 integrate[2*x,{x,0,1}]&lt;br /&gt;
 quadts: Iteration  1 of  6; est error = 10^    0; approx  value =&lt;br /&gt;
         1.000003359570811224742398159504692881030640064061042259417294e0&lt;br /&gt;
 quadts: Iteration  2 of  6; est error = 10^    0; approx value =&lt;br /&gt;
          1.000000000000036584185557611216071731517571134591404403031033e0&lt;br /&gt;
 quadts: Iteration  3 of  6; est error = 10^  -27; approx  value =&lt;br /&gt;
         1.000000000000000000000000000001046972220803162709182580101627e0&lt;br /&gt;
 quadts: Iteration  4 of  6; est error = 10^  -60; approx value =&lt;br /&gt;
          1.000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 quadts: Iteration  5 of  6; est error = 10^ -101; approx  value =&lt;br /&gt;
       9.999999999999999999999999999999999999999999999999999999999999e-1&lt;br /&gt;
 Result[  1] =&lt;br /&gt;
     9.99999999999999999999999999999999999999999999999999999999999999999999e-1&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 sqrt[1600]&lt;br /&gt;
 Result[  2] =&lt;br /&gt;
       4.00000000000000000000000000000000000000000000000000000000000000000000e1&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 help  Binomial&lt;br /&gt;
 Binomial[m,n] computes the binomial coefficient of integers (m,n).&lt;br /&gt;
&lt;br /&gt;
 Binomial[3,2]&lt;br /&gt;
 Result[  3] =&lt;br /&gt;
      3.00000000000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 hypo[x,y] = sqrt[x^2+y^2]&lt;br /&gt;
 parse: new function name = hypo&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 z=hypo[3,4]&lt;br /&gt;
 parse: new variable name = z&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 z&lt;br /&gt;
 Result[  4] =&lt;br /&gt;
       5.00000000000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o High-Precision Software Directory&amp;lt;br&amp;gt;&lt;br /&gt;
http://crd.lbl.gov/~dhbailey/mpdist/index.html&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=MPFUN90&amp;diff=11970</id>
		<title>MPFUN90</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=MPFUN90&amp;diff=11970"/>
				<updated>2015-09-28T19:16:45Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: Copy of MPFUN page before significant editing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=MPFUN90&lt;br /&gt;
|package_description=A Fortran-90 arbitrary precision package&lt;br /&gt;
|package_idnumber=16&lt;br /&gt;
}}&lt;br /&gt;
===Introduction===&lt;br /&gt;
MPFUN90 is a Fortran-90 arbitrary precision package (i.e. user specifies the desired precision).  The library is written by David H. Bailey et. al from the Lawrence Berkeley National Laboratory. If 64 digits of precision are sufficient for an application then users should use QD instead of MPFUN which would run much faster.&lt;br /&gt;
&lt;br /&gt;
=== Version Selection ===&lt;br /&gt;
Only version 6.1.23 of MPFUN for the intel compiler is available.&lt;br /&gt;
&lt;br /&gt;
===Job Submission===&lt;br /&gt;
To compile an MPFUN job you need to have the intel module loaded. Then you use the following&lt;br /&gt;
command to compile an  MPFUN source file, my_mpfun.f90:&lt;br /&gt;
&lt;br /&gt;
 $FC my_mpfun.f90 -I/opt/sharcnet/mpfun/6.1.23/f90/include  \&lt;br /&gt;
                               -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp&lt;br /&gt;
To submit the job to the serial queue use:&lt;br /&gt;
  sqsub -r  10m --mpp=2G -n 1   -o OUTPUT_MY_MPFUN ./a.out &lt;br /&gt;
&lt;br /&gt;
===Testing the MPFUN90 functions===&lt;br /&gt;
This example shows how to compile the test program &amp;lt;I&amp;gt;testmp90.f90&amp;lt;/I&amp;gt; using the SHARCNET mpfun build.  This program is used to verify DHB's multiprecision computation package MPFUN.  It exercises most routines and verifies that they are working properly.  Note that MPFUN was compiled with the intel compiler on each cluster shown in the availability table therefore its necessary to also compile the below example with the appropriate compiler.  The environment variable $FC handles this automatically as follows:&lt;br /&gt;
&lt;br /&gt;
Following commands copy the testmp90.f90 file into a user subdirectory and run the test.&lt;br /&gt;
&lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] cp /opt/sharcnet/mpfun/6.1.23/f90/src/testmp90.f90 .&lt;br /&gt;
 &lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] $FC testmp90.f90  -I/opt/sharcnet/mpfun/6.1.23/f90/include   \&lt;br /&gt;
                                                         -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp&lt;br /&gt;
 &lt;br /&gt;
 [roberpj@hnd50:~/samples/mpfun] ./a.out&lt;br /&gt;
 Completed Test  1&lt;br /&gt;
 Completed Test  2&lt;br /&gt;
 etc&lt;br /&gt;
 Completed Test 60&lt;br /&gt;
 Completed Test 62&lt;br /&gt;
&lt;br /&gt;
===Simple MPFUN  example===&lt;br /&gt;
&lt;br /&gt;
Here is a simple MPFUN90 example and the commands required to compile and execute it:&lt;br /&gt;
&lt;br /&gt;
 ! file = factorial_100.f90&lt;br /&gt;
 &lt;br /&gt;
       program factorial_100_pgm&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       implicit none&lt;br /&gt;
       integer, parameter :: Nmx = 100&lt;br /&gt;
       integer            :: AllocateStatus&lt;br /&gt;
       integer            :: J&lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real), dimension (:), allocatable        :: fac&lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       allocate(fac(0:Nmx),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fac &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do J=1,Nmx&lt;br /&gt;
         fac(J)=fac(J-1)*J&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       J=4&lt;br /&gt;
       write(6,1001) J&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(J))&lt;br /&gt;
 &lt;br /&gt;
       J=100&lt;br /&gt;
       write(6,1001) J&lt;br /&gt;
       call mpwrite(6,fac(J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       end&lt;br /&gt;
 &lt;br /&gt;
Compile (copy/paste the three lines)&lt;br /&gt;
  &lt;br /&gt;
 $FC factorial_100.f90                             \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
&lt;br /&gt;
Execute code &lt;br /&gt;
&lt;br /&gt;
         ./a.out&lt;br /&gt;
 &lt;br /&gt;
 fac(004) =10 ^         1 x  2.4,&lt;br /&gt;
 &lt;br /&gt;
 fac(100) =10 ^       157 x  9.3326215443944152681699238856266700490715968264381621468592&lt;br /&gt;
 963895217599993229915608941463976156518286253697920827223758251185210916864,&lt;br /&gt;
 &lt;br /&gt;
 DONE&lt;br /&gt;
&lt;br /&gt;
===OpenMP with MPFUN and QD===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Multi Precision packages MPFUN90 and QD use &amp;quot;user defined data type&amp;quot; for their variables.&lt;br /&gt;
Since the OpenMP reduction clause cannot be used for &amp;quot;user defined data types&amp;quot; to run MPFUN90 or QD&lt;br /&gt;
with OpenMP the reduction must be done manually in a PARALLEL OpenMP region.&lt;br /&gt;
&lt;br /&gt;
Detailed documentation on how to use OpenMP with MPFUN90 and QD are presented in the following&lt;br /&gt;
document:&lt;br /&gt;
&lt;br /&gt;
https://www.sharcnet.ca/help/index.php/OpenMP_Reduction_for_User_Defined_Data_Types&lt;br /&gt;
&lt;br /&gt;
===Handling large arrays in an MPFUN program ===&lt;br /&gt;
&lt;br /&gt;
Declaring large arrays in an MPFUN program often leads to compile&lt;br /&gt;
errors like:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;relocation truncated to fit r_x86_64_pc32 against .bss&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Even with the flag '-mcmodel large' in the compile command the error&lt;br /&gt;
will persist, because there is a limit to the amount of data you can&lt;br /&gt;
have allocated in static arrays for x86_64 architecture. This data&lt;br /&gt;
segment is limited to 2GB. The data in COMMON plus any other&lt;br /&gt;
statically declared arrays PLUS your code must fit in 2GB.&lt;br /&gt;
&lt;br /&gt;
In order to overcome this problem use allocatable arrays declared in&lt;br /&gt;
a module together with a short subroutine which allocates the arrays.&lt;br /&gt;
&lt;br /&gt;
We illustrate these concepts by starting with a program 'betax.f90'&lt;br /&gt;
which work fine for values of parameter 'Nsz' less than 37. Thus, if&lt;br /&gt;
you compile it with&lt;br /&gt;
&lt;br /&gt;
       integer, parameter :: Nsz=36&lt;br /&gt;
&lt;br /&gt;
it works, but for any higher values it fails with error message:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;relocation truncated to fit: R_X86_64_PC32 against symbol '...'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To overcome this problem, we first copy program betax.f90 into a new file,&lt;br /&gt;
say, betay.f90, and write a module called 'mp_data' and a subroutine called&lt;br /&gt;
'allocate_arrays' at the top of the new file. We move all the declarations&lt;br /&gt;
of large arrays into the module, and declare them as 'allocatable'.&lt;br /&gt;
&lt;br /&gt;
In the subroutine 'allocate_arrays' we do the allocations and in the main&lt;br /&gt;
program we add the statements:&lt;br /&gt;
&lt;br /&gt;
      USE mp_data&lt;br /&gt;
      ...&lt;br /&gt;
      call allocate_arrays&lt;br /&gt;
      ...&lt;br /&gt;
&lt;br /&gt;
Below you will find the listings for the files 'betax.f90', 'betay.f90' and&lt;br /&gt;
the 'HIST' file containing the commands to compile these files and submit&lt;br /&gt;
jobs:&lt;br /&gt;
&lt;br /&gt;
 ! file betax.f90&lt;br /&gt;
 &lt;br /&gt;
       program BETAX&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       implicit none&lt;br /&gt;
 !     integer, parameter :: Nsz=12   ! compilation fails for 37&lt;br /&gt;
       integer, parameter :: Nsz=37&lt;br /&gt;
 &lt;br /&gt;
       INTEGER :: I,J,K,L&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) fac(0:Nsz),fci(0:Nsz)&lt;br /&gt;
       type(mp_real) BETA2(Nsz,Nsz)&lt;br /&gt;
       type(mp_real) BETA3(Nsz,Nsz,Nsz)&lt;br /&gt;
       type(mp_real) BETA4(Nsz,Nsz,Nsz,Nsz)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
       fci(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do j=1,Nsz&lt;br /&gt;
         fac(j)=fac(j-1)*j&lt;br /&gt;
         fci(j)=one/fac(j)&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       I=Nsz/2&lt;br /&gt;
       J=I-1&lt;br /&gt;
       K=J-1&lt;br /&gt;
       L=K-1&lt;br /&gt;
 &lt;br /&gt;
       write(6,1000) I,J,K,L&lt;br /&gt;
  1000 format(/&amp;quot;I,J,K,L = &amp;quot;,4i3)&lt;br /&gt;
  &lt;br /&gt;
       write(6,1001) I&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(I))&lt;br /&gt;
 &lt;br /&gt;
       BETA2(I,J)      =fac(I)*fac(J)*fci(I+J)&lt;br /&gt;
       BETA3(I,J,K)    =fac(I)*fac(J)*fac(K)*fci(I+J)*fci(J+K)&lt;br /&gt;
       BETA4(I,J,K,L)  =fac(I)*fac(J)*fac(K)*fac(L)*                     &amp;amp;&lt;br /&gt;
      &amp;amp;                 fci(I+J)*fci(J+K)*fci(K+L)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1002) I,J&lt;br /&gt;
  1002 format(/&amp;quot;BETA2(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA2(I,J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1003) I,J,K&lt;br /&gt;
  1003 format(/&amp;quot;BETA3(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA3(I,J,K))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1004) I,J,K,L&lt;br /&gt;
  1004 format(/&amp;quot;BETA4(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA4(I,J,K,L))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       stop&lt;br /&gt;
       end&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
 ! file betay.f90&lt;br /&gt;
 &lt;br /&gt;
       module mp_data&lt;br /&gt;
 &lt;br /&gt;
       use mpmodule&lt;br /&gt;
       use mpfunmod&lt;br /&gt;
 &lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       integer, parameter :: Nsz =48&lt;br /&gt;
 &lt;br /&gt;
       integer            :: AllocateStatus&lt;br /&gt;
 &lt;br /&gt;
 !     type(mp_real) zero, one&lt;br /&gt;
 !&lt;br /&gt;
 !     type(mp_real) fac(0:Nsz),fci(0:Nsz)&lt;br /&gt;
 !     type(mp_real) BETA2(Nsz,Nsz)&lt;br /&gt;
 !     type(mp_real) BETA3(Nsz,Nsz,Nsz)&lt;br /&gt;
 !     type(mp_real) BETA4(Nsz,Nsz,Nsz,Nsz)&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real) zero, one&lt;br /&gt;
 &lt;br /&gt;
       type(mp_real), dimension (:), allocatable        :: fac,fci&lt;br /&gt;
       type(mp_real), dimension (:,:), allocatable      :: BETA2&lt;br /&gt;
       type(mp_real), dimension (:,:,:), allocatable    :: BETA3&lt;br /&gt;
       type(mp_real), dimension (:,:,:,:), allocatable  :: BETA4&lt;br /&gt;
 &lt;br /&gt;
       end module mp_data&lt;br /&gt;
 &lt;br /&gt;
       subroutine allocate_arrays&lt;br /&gt;
 &lt;br /&gt;
       USE mp_data&lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       allocate(fac(0:Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fac &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(fci(0:Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for fci &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA2(Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA2&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA3(Nsz,Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA3&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       allocate(BETA4(Nsz,Nsz,Nsz,Nsz),STAT=AllocateStatus)&lt;br /&gt;
       IF (AllocateStatus /= 0) STOP &amp;quot;Not enough memory for BETA4&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       print *,&amp;quot;Done with allocations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
       return&lt;br /&gt;
       END&lt;br /&gt;
 &lt;br /&gt;
 ! ----------------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
       program BETAY&lt;br /&gt;
       USE mp_data&lt;br /&gt;
 &lt;br /&gt;
       implicit none&lt;br /&gt;
 &lt;br /&gt;
       INTEGER :: I,J,K,L&lt;br /&gt;
 &lt;br /&gt;
       call mpinit(800)&lt;br /&gt;
       call mpsetprec(800)&lt;br /&gt;
       call mpsetoutputprec(700)&lt;br /&gt;
 &lt;br /&gt;
       zero='0.'&lt;br /&gt;
       one ='1.'&lt;br /&gt;
 &lt;br /&gt;
       call allocate_arrays&lt;br /&gt;
 &lt;br /&gt;
       fac(0)=one&lt;br /&gt;
       fci(0)=one&lt;br /&gt;
 &lt;br /&gt;
       do j=1,Nsz&lt;br /&gt;
         fac(j)=fac(j-1)*j&lt;br /&gt;
         fci(j)=one/fac(j)&lt;br /&gt;
       end do&lt;br /&gt;
 &lt;br /&gt;
       I=Nsz/2&lt;br /&gt;
       J=I-1&lt;br /&gt;
       K=J-1&lt;br /&gt;
       L=K-1&lt;br /&gt;
 &lt;br /&gt;
       write(6,1000) I,J,K,L&lt;br /&gt;
  1000 format(/&amp;quot;I,J,K,L = &amp;quot;,4i3)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1001) I&lt;br /&gt;
  1001 format(/&amp;quot;fac(&amp;quot;,i3.3,&amp;quot;) =&amp;quot;,$)&lt;br /&gt;
       call mpwrite(6,fac(I))&lt;br /&gt;
 &lt;br /&gt;
       BETA2(I,J)      =fac(I)*fac(J)*fci(I+J)&lt;br /&gt;
       BETA3(I,J,K)    =fac(I)*fac(J)*fac(K)*fci(I+J)*fci(J+K)&lt;br /&gt;
       BETA4(I,J,K,L)  =fac(I)*fac(J)*fac(K)*fac(L)*                     &amp;amp;&lt;br /&gt;
      &amp;amp;                 fci(I+J)*fci(J+K)*fci(K+L)&lt;br /&gt;
 &lt;br /&gt;
       write(6,1002) I,J&lt;br /&gt;
  1002 format(/&amp;quot;BETA2(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA2(I,J))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1003) I,J,K&lt;br /&gt;
  1003 format(/&amp;quot;BETA3(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA3(I,J,K))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1004) I,J,K,L&lt;br /&gt;
  1004 format(/&amp;quot;BETA4(&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;,&amp;quot;,i3.3,&amp;quot;) =&amp;quot;)&lt;br /&gt;
       call mpwrite(6,BETA4(I,J,K,L))&lt;br /&gt;
 &lt;br /&gt;
       write(6,1005)&lt;br /&gt;
  1005 format(/&amp;quot;DONE&amp;quot;//)&lt;br /&gt;
 &lt;br /&gt;
       stop&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
 # file HIST&lt;br /&gt;
 #&lt;br /&gt;
 # Set Nsz=12&lt;br /&gt;
 &lt;br /&gt;
         vi betax.f90&lt;br /&gt;
 &lt;br /&gt;
 and set Nsz=12 in file betax.f90&lt;br /&gt;
 &lt;br /&gt;
 # Compile (copy/paste the three lines)&lt;br /&gt;
 &lt;br /&gt;
 ifort betax.f90                                   \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
 &lt;br /&gt;
 # Execute code (it should work)&lt;br /&gt;
 &lt;br /&gt;
         ./a.out&lt;br /&gt;
 &lt;br /&gt;
 # Set Nsz=40&lt;br /&gt;
 &lt;br /&gt;
         vi betax.f90&lt;br /&gt;
 &lt;br /&gt;
 and set Nsz=40 in file betax.f90&lt;br /&gt;
 &lt;br /&gt;
 # Re-compile and look at file AOUT1&lt;br /&gt;
 &lt;br /&gt;
 ifort betax.f90                                   \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT1&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
 &lt;br /&gt;
 # File betay.f90 was copied from betax.f90 and modified as described earlier.&lt;br /&gt;
 &lt;br /&gt;
 # Compile betay.f90&lt;br /&gt;
 &lt;br /&gt;
 ifort betay.f90 -mcmodel medium -shared-intel \&lt;br /&gt;
 -I/opt/sharcnet/mpfun/6.1.23/f90/include          \&lt;br /&gt;
 -L/opt/sharcnet/mpfun/6.1.23/f90/lib -lmp &amp;gt;&amp;amp; AOUT2&lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
 &lt;br /&gt;
 # The executable might require more than 2.0G of memory: &lt;br /&gt;
 &lt;br /&gt;
 # This will pruduce an error: &lt;br /&gt;
 &lt;br /&gt;
 sqsub -r 5m  --mpp=4.0G  -o OUTPUTFILE4 ./a.out&lt;br /&gt;
 &lt;br /&gt;
 # This should work:&lt;br /&gt;
 &lt;br /&gt;
 sqsub -r 5m  --mpp=8.0G  -o OUTPUTFILE8 ./a.out&lt;br /&gt;
 &lt;br /&gt;
 ============================================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MPFUN's TOOLKIT===&lt;br /&gt;
&lt;br /&gt;
This toolkit provides and extensive example of how the mpfun package can be used.  Read the header of files &lt;br /&gt;
 mathinit.f90 &lt;br /&gt;
     and &lt;br /&gt;
 mathtool.f90 &lt;br /&gt;
found under &lt;br /&gt;
 /opt/sharcnet/mpfun/current/toolkit &lt;br /&gt;
for an explanation what the package does.  The Makefile in this directory shows how the mpfun libraries were linked to compile this sample program pair.  The following steps shows the first initialization step followed by actually running the mathtool program to perform some examples such as performing an integration and displaying the value of pie.  Note that the displayed zero cputimes are due to a bug in the mpfun current build which will be fixed in future updates on the clusters.&lt;br /&gt;
&lt;br /&gt;
====Initializing Mathtool====&lt;br /&gt;
To run Mathtool you must first generate following two input files &lt;br /&gt;
 const.dat &lt;br /&gt;
   and &lt;br /&gt;
 quadts.dat &lt;br /&gt;
&lt;br /&gt;
which can be accomplished by running following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] /opt/sharcnet/mpfun/current/toolkit/mathinit&lt;br /&gt;
 mathinit: start&lt;br /&gt;
 const complete&lt;br /&gt;
 file const.dat written&lt;br /&gt;
 cpu time = 0.E+0&lt;br /&gt;
initqts: Tanh-sinh quadrature initialization&lt;br /&gt;
 0 18632&lt;br /&gt;
 1000 18632&lt;br /&gt;
 2000 18632&lt;br /&gt;
 3000 18632&lt;br /&gt;
 4000 18632&lt;br /&gt;
 5000 18632&lt;br /&gt;
 6000 18632&lt;br /&gt;
 7000 18632&lt;br /&gt;
 8000 18632&lt;br /&gt;
initqts: Table spaced used =    8177&lt;br /&gt;
 initqts complete&lt;br /&gt;
 file quadts.dat written&lt;br /&gt;
 cpu time = 0.E+0&lt;br /&gt;
 total cpu time = 0.E+0&lt;br /&gt;
&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] ls&lt;br /&gt;
const.dat  quadts.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Running Mathtool====&lt;br /&gt;
Use the files created in the previous section to run mathtool as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[roberpj@bal34:~/samples/mpfun] /opt/sharcnet/mpfun/current/toolkit/mathtool&lt;br /&gt;
Welcome to the Experimental Mathematician's Toolkit&lt;br /&gt;
Initializing...&lt;br /&gt;
&lt;br /&gt;
Current settings:&lt;br /&gt;
Debug level =   2&lt;br /&gt;
Primary precision level =   100 digits&lt;br /&gt;
Secondary precision level =   200 digits&lt;br /&gt;
Primary epsilon = 10^  -100&lt;br /&gt;
Secondary epsilon = 10^  -200&lt;br /&gt;
PSLQ bound = 100&lt;br /&gt;
PSLQ level =   1&lt;br /&gt;
Quadrature level =   6&lt;br /&gt;
Quadrature type =   3  (Tanh-Sinh)&lt;br /&gt;
-- snip --&lt;br /&gt;
&lt;br /&gt;
TYPE: integrate[1/(1+x^2), {x, 0, 1}]   (hit enter)&lt;br /&gt;
quadts: Iteration  1 of  6; est error = 10^    0; approx value =&lt;br /&gt;
       7.853157298876894309110693190063938396203990510665917998384243e-1&lt;br /&gt;
quadts: Iteration  2 of  6; est error = 10^    0; approx value =&lt;br /&gt;
       7.853981605125528448099840689980111720633592558858121242731082e-1&lt;br /&gt;
quadts: Iteration  3 of  6; est error = 10^  -17; approx value =&lt;br /&gt;
       7.853981633974483082028533923930157568609007576776270726821597e-1&lt;br /&gt;
quadts: Iteration  4 of  6; est error = 10^  -36; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757190586422063114153956005278e-1&lt;br /&gt;
quadts: Iteration  5 of  6; est error = 10^  -71; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757210492923498437764552437361e-1&lt;br /&gt;
quadts: Iteration  6 of  6; est error = 10^ -101; approx value =&lt;br /&gt;
       7.853981633974483096156608458198757210492923498437764552437361e-1&lt;br /&gt;
Result[  1] =&lt;br /&gt;
     7.85398163397448309615660845819875721049292349843776455243736148076954e-1&lt;br /&gt;
CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
TYPE: functions  (hit enter)&lt;br /&gt;
Abs              Arccos           Arcsin           Arctan          &lt;br /&gt;
Arctan2          Bessel           Besselexp        Binomial        &lt;br /&gt;
Cos              Erf              Exp              Factorial       &lt;br /&gt;
Gamma            Integrate        Log              Max             &lt;br /&gt;
Min              Polyroot         Pslq             Result          &lt;br /&gt;
Sin              Sqrt             Sum              Table           &lt;br /&gt;
Tan              Zeta             Zetap            Zetaz           &lt;br /&gt;
&lt;br /&gt;
TYPE: variables  (hit enter)&lt;br /&gt;
E                Log2             Log10            Pi              &lt;br /&gt;
Catalan          Eulergamma       Infinity         Arg1            &lt;br /&gt;
Arg2             Arg3             Arg4             Arg5            &lt;br /&gt;
Arg6             Arg7             Arg8             Arg9            &lt;br /&gt;
Debug            Digits           Digits2          Epsilon         &lt;br /&gt;
Epsilon2         Pslqbound        Pslqlevel        Quadlevel       &lt;br /&gt;
Quadtype         x                &lt;br /&gt;
&lt;br /&gt;
TYPE: Pi  (hit enter)&lt;br /&gt;
Result[  2] =&lt;br /&gt;
      3.14159265358979323846264338327950288419716939937510582097494459230781e0&lt;br /&gt;
CPU time =      0.0000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====More Mathtool commands====&lt;br /&gt;
To start mathtool (assuming you have issued the command /opt/sharcnet/mpfun/current/toolkit/mathinit and have these two files: const.dat  HIST  quadts.dat  - you type:&lt;br /&gt;
 &lt;br /&gt;
 /opt/sharcnet/mpfun/current/toolkit/mathtool&lt;br /&gt;
&lt;br /&gt;
Then try following commands:&lt;br /&gt;
 integrate[2*x,{x,0,1}]&lt;br /&gt;
 sqrt[1600]&lt;br /&gt;
 help  Binomial&lt;br /&gt;
 Binomial[3,2]&lt;br /&gt;
 hypo[x,y] = sqrt[x^2+y^2]&lt;br /&gt;
 z=hypo[3,4]&lt;br /&gt;
 z&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
This is what you should get from above commands:&lt;br /&gt;
&lt;br /&gt;
 integrate[2*x,{x,0,1}]&lt;br /&gt;
 quadts: Iteration  1 of  6; est error = 10^    0; approx  value =&lt;br /&gt;
         1.000003359570811224742398159504692881030640064061042259417294e0&lt;br /&gt;
 quadts: Iteration  2 of  6; est error = 10^    0; approx value =&lt;br /&gt;
          1.000000000000036584185557611216071731517571134591404403031033e0&lt;br /&gt;
 quadts: Iteration  3 of  6; est error = 10^  -27; approx  value =&lt;br /&gt;
         1.000000000000000000000000000001046972220803162709182580101627e0&lt;br /&gt;
 quadts: Iteration  4 of  6; est error = 10^  -60; approx value =&lt;br /&gt;
          1.000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 quadts: Iteration  5 of  6; est error = 10^ -101; approx  value =&lt;br /&gt;
       9.999999999999999999999999999999999999999999999999999999999999e-1&lt;br /&gt;
 Result[  1] =&lt;br /&gt;
     9.99999999999999999999999999999999999999999999999999999999999999999999e-1&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 sqrt[1600]&lt;br /&gt;
 Result[  2] =&lt;br /&gt;
       4.00000000000000000000000000000000000000000000000000000000000000000000e1&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 help  Binomial&lt;br /&gt;
 Binomial[m,n] computes the binomial coefficient of integers (m,n).&lt;br /&gt;
&lt;br /&gt;
 Binomial[3,2]&lt;br /&gt;
 Result[  3] =&lt;br /&gt;
      3.00000000000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 hypo[x,y] = sqrt[x^2+y^2]&lt;br /&gt;
 parse: new function name = hypo&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 z=hypo[3,4]&lt;br /&gt;
 parse: new variable name = z&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 z&lt;br /&gt;
 Result[  4] =&lt;br /&gt;
       5.00000000000000000000000000000000000000000000000000000000000000000000e0&lt;br /&gt;
 CPU time =      0.0000&lt;br /&gt;
&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o High-Precision Software Directory&amp;lt;br&amp;gt;&lt;br /&gt;
http://crd.lbl.gov/~dhbailey/mpdist/index.html&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=11181</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=11181"/>
				<updated>2015-04-07T21:28:07Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Using a Specific Version of Boost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
At the present time, when you look up the available boost modules you will see output such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.55.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.50.0, boost/gcc482-openmpi183/1.53.0, boost/gcc482-openmpi183/1.55.0, boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.50.0, boost/intel12-openmpi162/1.53.0, boost/intel12-openmpi162/1.55.0, boost/intel12-openmpi162/1.57.0&lt;br /&gt;
#* '''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
# Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the &amp;quot;noopenmpi&amp;quot; item).&lt;br /&gt;
#* i.e., boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
If you want to start with NO modules loaded, then you can do the same by purging first, loading ldwrapper, followed by what you need, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module purge&lt;br /&gt;
$ module load ldwrapper&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=11125</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=11125"/>
				<updated>2015-03-26T19:15:57Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
At the present time, when you look up the available boost modules you will see output such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.55.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.50.0, boost/gcc482-openmpi183/1.53.0, boost/gcc482-openmpi183/1.55.0, boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.50.0, boost/intel12-openmpi162/1.53.0, boost/intel12-openmpi162/1.55.0, boost/intel12-openmpi162/1.57.0&lt;br /&gt;
#* '''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
# Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the &amp;quot;noopenmpi&amp;quot; item).&lt;br /&gt;
#* i.e., boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $CXXFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also be aware that you must specify any Boost-required libraries for linking purposes using the -l option. You can see the actual available library names for any given Boost installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls $BLIBS` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $BLIBS is the directory you see with LDFLAGS in the module show output, thus, to see all libraries available with the gcc482-openmpi183/lib module, you would write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ for a in `ls /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib/libboost_*` ; do basename $a ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Using the -l option is important when using any non-header-only Boost library, e.g., MPI, serialization, program_options, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env(argc, argv);&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpic++ $CPPFLAGS $CXXFLAGS $LDFLAGS -lboost_mpi -lboost_serialization boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 2 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=10456</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=10456"/>
				<updated>2015-01-24T22:32:27Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
At the present time, when you look up the available boost modules you will see output such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.55.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.50.0, boost/gcc482-openmpi183/1.53.0, boost/gcc482-openmpi183/1.55.0, boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.50.0, boost/intel12-openmpi162/1.53.0, boost/intel12-openmpi162/1.55.0, boost/intel12-openmpi162/1.57.0&lt;br /&gt;
#* '''NOTE:''' You may experience problems compiling Boost codes with the Intel v12 compiler (e.g., some incompatible headers). If you do, try the GCC compiler to see if that works.&lt;br /&gt;
# Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the &amp;quot;noopenmpi&amp;quot; item).&lt;br /&gt;
#* i.e., boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ $CPPFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or manually specify the CPPFLAGS and LDFLAGS variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g++ -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building an Example Boost Program ==&lt;br /&gt;
&lt;br /&gt;
First create/write/copy your program somewhere suitable (this example is from the Boost.MPI documentation):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
$ mkdir boost-test&lt;br /&gt;
$ cat &amp;gt;boost-mpi-eg.cxx&lt;br /&gt;
#include &amp;lt;boost/mpi.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/serialization/string.hpp&amp;gt;&lt;br /&gt;
namespace mpi = boost::mpi;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
  mpi::environment env;&lt;br /&gt;
  mpi::communicator world;&lt;br /&gt;
&lt;br /&gt;
  if (world.rank() == 0) {&lt;br /&gt;
    world.send(1, 0, std::string(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(1, 1, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;!&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  } else {&lt;br /&gt;
    std::string msg;&lt;br /&gt;
    world.recv(0, 0, msg);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; msg &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout.flush();&lt;br /&gt;
    world.send(0, 1, std::string(&amp;quot;world&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compile it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ export OMPI_CXXFLAGS=$CPPFLAGS&lt;br /&gt;
$ export OMPI_LDFLAGS=&amp;quot;$LDFLAGS $(for p in $(echo $LD_RUN_PATH | tr ':' ' '); do echo -n &amp;quot;-L$p &amp;quot; ; done)&amp;quot;&lt;br /&gt;
$ mpic++ boost-mpi-eg.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and run it (as it is very fast and short, sqsub is not used here):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -np 4 ./a.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=10455</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=10455"/>
				<updated>2015-01-24T21:18:57Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Which Versions of Boost are Available? ==&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
At the present time, when you look up the available boost modules you will see output such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.55.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
#* i.e., boost/gcc482-openmpi183/1.50.0, boost/gcc482-openmpi183/1.53.0, boost/gcc482-openmpi183/1.55.0, boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
#* i.e., boost/intel12-openmpi162/1.50.0, boost/intel12-openmpi162/1.53.0, boost/intel12-openmpi162/1.55.0, boost/intel12-openmpi162/1.57.0&lt;br /&gt;
# Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the &amp;quot;noopenmpi&amp;quot; item).&lt;br /&gt;
#* i.e., boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
== Using a Specific Version of Boost ==&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
== If Special Compiler Options are Required ==&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i.e., for Boost 1.57.0 (flavour gcc482-openmpi183) you could explicitly invoke the compiler with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cxx $CPPFLAGS $LDFLAGS yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or manually specify the CPPFLAGS and LDFLAGS variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cxx -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib yoursourcecode.cxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=10454</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=10454"/>
				<updated>2015-01-24T20:22:40Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SHARCNET-Provided Boost Modules ==&lt;br /&gt;
&lt;br /&gt;
=== Which Versions of Boost are Available? ===&lt;br /&gt;
&lt;br /&gt;
SHARCNET has a number of Boost versions available as special modules. The available versions can be viewed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module avail boost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and/or by viewing the [https://www.sharcnet.ca/my/software/show/137 BOOST software page in the web portal].&lt;br /&gt;
&lt;br /&gt;
At the present time, when you look up the available boost modules you will see output such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module avail boost&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.55.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
&lt;br /&gt;
------------------------------------ /opt/sharcnet/modules -------------------------------------&lt;br /&gt;
boost/gcc482-openmpi183/1.50.0  boost/intel12-openmpi162/1.50.0&lt;br /&gt;
boost/gcc482-openmpi183/1.53.0  boost/intel12-openmpi162/1.53.0&lt;br /&gt;
boost/gcc482-openmpi183/1.55.0  boost/intel12-openmpi162/1.55.0&lt;br /&gt;
boost/gcc482-openmpi183/1.57.0  boost/intel12-openmpi162/1.57.0&lt;br /&gt;
boost/intel/1.55.0              boost/intel15-noopenmpi/1.57.0&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i.e., the following versions of Boost are available:&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for GCC v4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
# Boost versions 1.50, 1.53, 1.55, and 1.57 for Intel v12 and OpenMPI v1.6.2&lt;br /&gt;
# Boost version 1.57 for Intel v15 without OpenMPI features (i.e., the &amp;quot;noopenmpi&amp;quot; item).&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using a Specific Version of Boost ===&lt;br /&gt;
&lt;br /&gt;
To use a specific version of Boost, do the following:&lt;br /&gt;
* Unload any loaded OpenMPI modules that will conflict.&lt;br /&gt;
* Unload any loaded C++ compiler modules that will conflict.&lt;br /&gt;
* Load any required C++ and OpenMPI modules.&lt;br /&gt;
* Load the required version of Boost.&lt;br /&gt;
e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module list                                 # View which modules are currently loaded&lt;br /&gt;
$ module unload openmpi/intel/1.6.2           # Unload the OpenMPI (for Intel)&lt;br /&gt;
$ module unload intel/12.1.3                  # Unload the Intel C++ compiler&lt;br /&gt;
$ module load gcc/4.8.2                       # Load GCC v4.8.2&lt;br /&gt;
$ module load openmpi/gcc/1.8.3               # Load OpenMPI (for GCC)&lt;br /&gt;
$ module load boost/gcc482-openmpi183/1.57.0  # Load Boost v1.57 for GCC 4.8.2 and OpenMPI v1.8.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you may use Boost (e.g., write #include &amp;lt;boost/filesystem.hpp&amp;gt; in your code, etc.). No special compiler options will be required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== If Special Compiler Options are Required ===&lt;br /&gt;
&lt;br /&gt;
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.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module show boost/gcc482-openmpi183/1.57.0&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
/opt/sharcnet/modules/boost/gcc482-openmpi183/1.57.0:&lt;br /&gt;
&lt;br /&gt;
module-whatis    Provides boost 1.57.0 (flavor gcc482-openmpi183) built using gcc/4.8.2, openmpi/gcc/1.8.3 on centos64.&lt;br /&gt;
conflict         intel&lt;br /&gt;
conflict         pgi&lt;br /&gt;
conflict         python&lt;br /&gt;
prereq   gcc/4.8.2&lt;br /&gt;
prereq   openmpi/gcc/1.8.3&lt;br /&gt;
prepend-path     --delim   CPPFLAGS -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
prepend-path     --delim   LDFLAGS -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
prepend-path     LD_RUN_PATH /opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
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:&lt;br /&gt;
* -I/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/include&lt;br /&gt;
* -L/opt/sharcnet/boost/1.57.0/gcc482-openmpi183/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8756</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8756"/>
				<updated>2014-07-08T19:11:31Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: /* Compiling Your Own Version Of Boost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
The version of boost and boost-devel packages installed are provided with the native operating system and not provided by a SHARCNET module hence they are available by default.&lt;br /&gt;
&lt;br /&gt;
To get the latest version information about the packages do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a listing of files for each package do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -ql boost&lt;br /&gt;
rpm -ql boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compiling Your Own Version Of Boost ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the operating system-installed version of the Boost libraries are usually out of date and programs relying on boost libraries may require a later version. Please check the documentation of the package you are trying to link to boost libraries to see which version is the minimum required.  If this minimum is later than the native system libraries, you will have to install the newer boost libraries on your own.&lt;br /&gt;
&lt;br /&gt;
=== Manually Building Boost ===&lt;br /&gt;
&lt;br /&gt;
The following are the steps to manually build Boost from the command-line.&lt;br /&gt;
&lt;br /&gt;
# Download Boost from http://www.boost.org&lt;br /&gt;
# Extract the file downloaded into an empty directory using one of these commands:&lt;br /&gt;
#* &amp;lt;code&amp;gt;unzip boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvzf boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvjf boost_VERSION.tar.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
#* '''NOTE:''' This top directory holding the uncompressed Boost files will be called &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Decide on which C++ compiler you are going to use (e.g., GCC, Intel, PGI). Once that is done, use SHARCNET's module system to unload any previous compiler and load the one you need:&lt;br /&gt;
#* Unload C++ compiler modules: &amp;lt;code&amp;gt;module unload gcc intel pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load the GCC v4.8.2 module example: &amp;lt;code&amp;gt;module load gcc/4.8.2&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on whether or not you want MPI support (and load the one suitable for the compiler you've chosen):&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload openmpi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load MPI for GCC example: &amp;lt;code&amp;gt;module load openmpi/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need MPI.)'''&lt;br /&gt;
# Decide whether or not you need Python support (and load the one suitable for the compiler you've chosen).&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload python&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load Python for GCC module: &amp;lt;code&amp;gt;module load python/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need Python.)'''&lt;br /&gt;
#* '''NOTE:''' Boost will use the system's Python if you don't load the module which is okay if you don't need Python.&lt;br /&gt;
# Change the directory to &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd $BOOST_SRC&amp;lt;/code&amp;gt;&lt;br /&gt;
# '''NOTE:''' Because SHARCNET has many compilers and tools available, avoid using the shortcut method to building Boost --build Boost's &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; program instead.&lt;br /&gt;
# Change the directory to build bjam:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd tools/build/v2&amp;lt;/code&amp;gt;&lt;br /&gt;
# For the aforementioned selected C++ compiler, determine the correct &amp;lt;code&amp;gt;--with-toolset&amp;lt;/code&amp;gt; option for &amp;lt;code&amp;gt;bootstrap.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=help&amp;lt;/code&amp;gt; '''(This command is designed to fail.)'''&lt;br /&gt;
#* &amp;lt;code&amp;gt;less booststrap.log&amp;lt;/code&amp;gt;&lt;br /&gt;
# Replace TOOLSET_NAME_FROM_FILE with the appropriate toolset mentioned in the &amp;lt;code&amp;gt;bootstrap.log&amp;lt;/code&amp;gt; file and the run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=TOOLSET_NAME_FROM_LOG_FILE&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=gcc&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=intel-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on a directory you want to install Boost build into.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./b2 install --prefix=$BUILD_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add &amp;lt;code&amp;gt;$BUILD_DIR/bin&amp;lt;/code&amp;gt; to your PATH (in your shell):&lt;br /&gt;
#* PATH=$BUILD_DIR/bin:$PATH&lt;br /&gt;
#* export PATH&lt;br /&gt;
# If you need Boost MPI, then add the following text to a line of its own in &amp;lt;code&amp;gt;user-config.jam&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;using mpi ;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Go back up to the &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd ../../..&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on an empty directory where you want to install the Boost libraries.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$INSTALL_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# If you would like Boost to build its libraries in parallel, decide on the number of parallel processes.&lt;br /&gt;
#* This number will be referred to as &amp;lt;code&amp;gt;$NUM_PROCS&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Although it is usually the same as the above, determine the toolset (referred to as $TOOLSET below) you need from the Boost documentation:&lt;br /&gt;
#* Version 1.55.0: http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.54.0: http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.53.0: http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.52.0: http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* etc.&lt;br /&gt;
# Build the Boost libraries by running:&lt;br /&gt;
#* Normal sequential build: &amp;lt;code&amp;gt;b2 --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Parallel build: &amp;lt;code&amp;gt;b2 -j$NUM_PROCS --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
# If all of the above went well, you're done building Boost!&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; and the code in &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; is only needed to build Boost. You can delete &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; after Boost has been built by running &amp;lt;code&amp;gt;rm -rf $BOOST_DIR&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Compiling and Linking to the Boost Libraries + Running Executables ===&lt;br /&gt;
&lt;br /&gt;
Please note the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;BOOST_HOME=$INSTALL_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* The INCLUDE directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/include&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The LIBRARY directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To build programs use the -I, -L, and -l options to specify the top include file directory, the top library directory and any specific libraries that must be linked in to your program, e.g.,&lt;br /&gt;
* A program that uses header-only libraries: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include program1.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* A program that uses the Boost regex library: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include -L $BOOST_HOME/lib -lboost_regex program2.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
If your &amp;lt;code&amp;gt;$BOOST_HOME&amp;lt;/code&amp;gt; is not in a system-wide library directory, your compile program won't run. You can ensure it does run by adding &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;LD_LIBRARY_PATH&amp;lt;/code&amp;gt; (once per shell) as follows:&lt;br /&gt;
* &amp;lt;code&amp;gt;LD_LIBRARY_PATH=$BOOST_HOME/lib:$LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
and now you will be able to sucessfully run your programs.&lt;br /&gt;
&lt;br /&gt;
Finally remember to BEFORE running your programs you will ALWAYS need to &amp;quot;module unload&amp;quot; and &amp;quot;module load&amp;quot; the settings for any new shells you create. This can be a nuisance --you might prefer to place those unload and load commands at the bottom of your ~/.bashrc file.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8755</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8755"/>
				<updated>2014-07-08T19:11:04Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
The version of boost and boost-devel packages installed are provided with the native operating system and not provided by a SHARCNET module hence they are available by default.&lt;br /&gt;
&lt;br /&gt;
To get the latest version information about the packages do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a listing of files for each package do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -ql boost&lt;br /&gt;
rpm -ql boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compiling Your Own Version Of Boost ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the operating system-installed version of the Boost libraries are usually out of date and programs relying on boost libraries may require a later version. Please check the documentation of the package you are trying to link to boost libraries to see which version is the minimum required.  If this minimum is later than the native system libraries, you will have to install the newer boost libraries on your own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Manually Building Boost ===&lt;br /&gt;
&lt;br /&gt;
The following are the steps to manually build Boost from the command-line.&lt;br /&gt;
&lt;br /&gt;
# Download Boost from http://www.boost.org&lt;br /&gt;
# Extract the file downloaded into an empty directory using one of these commands:&lt;br /&gt;
#* &amp;lt;code&amp;gt;unzip boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvzf boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvjf boost_VERSION.tar.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
#* '''NOTE:''' This top directory holding the uncompressed Boost files will be called &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Decide on which C++ compiler you are going to use (e.g., GCC, Intel, PGI). Once that is done, use SHARCNET's module system to unload any previous compiler and load the one you need:&lt;br /&gt;
#* Unload C++ compiler modules: &amp;lt;code&amp;gt;module unload gcc intel pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load the GCC v4.8.2 module example: &amp;lt;code&amp;gt;module load gcc/4.8.2&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on whether or not you want MPI support (and load the one suitable for the compiler you've chosen):&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload openmpi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load MPI for GCC example: &amp;lt;code&amp;gt;module load openmpi/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need MPI.)'''&lt;br /&gt;
# Decide whether or not you need Python support (and load the one suitable for the compiler you've chosen).&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload python&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load Python for GCC module: &amp;lt;code&amp;gt;module load python/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need Python.)'''&lt;br /&gt;
#* '''NOTE:''' Boost will use the system's Python if you don't load the module which is okay if you don't need Python.&lt;br /&gt;
# Change the directory to &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd $BOOST_SRC&amp;lt;/code&amp;gt;&lt;br /&gt;
# '''NOTE:''' Because SHARCNET has many compilers and tools available, avoid using the shortcut method to building Boost --build Boost's &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; program instead.&lt;br /&gt;
# Change the directory to build bjam:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd tools/build/v2&amp;lt;/code&amp;gt;&lt;br /&gt;
# For the aforementioned selected C++ compiler, determine the correct &amp;lt;code&amp;gt;--with-toolset&amp;lt;/code&amp;gt; option for &amp;lt;code&amp;gt;bootstrap.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=help&amp;lt;/code&amp;gt; '''(This command is designed to fail.)'''&lt;br /&gt;
#* &amp;lt;code&amp;gt;less booststrap.log&amp;lt;/code&amp;gt;&lt;br /&gt;
# Replace TOOLSET_NAME_FROM_FILE with the appropriate toolset mentioned in the &amp;lt;code&amp;gt;bootstrap.log&amp;lt;/code&amp;gt; file and the run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=TOOLSET_NAME_FROM_LOG_FILE&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=gcc&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=intel-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on a directory you want to install Boost build into.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./b2 install --prefix=$BUILD_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add &amp;lt;code&amp;gt;$BUILD_DIR/bin&amp;lt;/code&amp;gt; to your PATH (in your shell):&lt;br /&gt;
#* PATH=$BUILD_DIR/bin:$PATH&lt;br /&gt;
#* export PATH&lt;br /&gt;
# If you need Boost MPI, then add the following text to a line of its own in &amp;lt;code&amp;gt;user-config.jam&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;using mpi ;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Go back up to the &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd ../../..&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on an empty directory where you want to install the Boost libraries.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$INSTALL_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# If you would like Boost to build its libraries in parallel, decide on the number of parallel processes.&lt;br /&gt;
#* This number will be referred to as &amp;lt;code&amp;gt;$NUM_PROCS&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Although it is usually the same as the above, determine the toolset (referred to as $TOOLSET below) you need from the Boost documentation:&lt;br /&gt;
#* Version 1.55.0: http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.54.0: http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.53.0: http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.52.0: http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* etc.&lt;br /&gt;
# Build the Boost libraries by running:&lt;br /&gt;
#* Normal sequential build: &amp;lt;code&amp;gt;b2 --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Parallel build: &amp;lt;code&amp;gt;b2 -j$NUM_PROCS --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
# If all of the above went well, you're done building Boost!&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; and the code in &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; is only needed to build Boost. You can delete &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; after Boost has been built by running &amp;lt;code&amp;gt;rm -rf $BOOST_DIR&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Compiling and Linking to the Boost Libraries + Running Executables ===&lt;br /&gt;
&lt;br /&gt;
Please note the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;BOOST_HOME=$INSTALL_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* The INCLUDE directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/include&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The LIBRARY directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To build programs use the -I, -L, and -l options to specify the top include file directory, the top library directory and any specific libraries that must be linked in to your program, e.g.,&lt;br /&gt;
* A program that uses header-only libraries: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include program1.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* A program that uses the Boost regex library: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include -L $BOOST_HOME/lib -lboost_regex program2.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
If your &amp;lt;code&amp;gt;$BOOST_HOME&amp;lt;/code&amp;gt; is not in a system-wide library directory, your compile program won't run. You can ensure it does run by adding &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;LD_LIBRARY_PATH&amp;lt;/code&amp;gt; (once per shell) as follows:&lt;br /&gt;
* &amp;lt;code&amp;gt;LD_LIBRARY_PATH=$BOOST_HOME/lib:$LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
and now you will be able to sucessfully run your programs.&lt;br /&gt;
&lt;br /&gt;
Finally remember to BEFORE running your programs you will ALWAYS need to &amp;quot;module unload&amp;quot; and &amp;quot;module load&amp;quot; the settings for any new shells you create. This can be a nuisance --you might prefer to place those unload and load commands at the bottom of your ~/.bashrc file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8754</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8754"/>
				<updated>2014-07-08T19:10:20Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: Mention about removing $BOOST_DIR when done building Boost.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
The version of boost and boost-devel packages installed are provided with the native operating system and not provided by a SHARCNET module hence they are available by default.&lt;br /&gt;
&lt;br /&gt;
To get the latest version information about the packages do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a listing of files for each package do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -ql boost&lt;br /&gt;
rpm -ql boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compiling Your Own Version Of Boost ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the operating system-installed version of the Boost libraries are usually out of date and programs relying on boost libraries may require a later version. Please check the documentation of the package you are trying to link to boost libraries to see which version is the minimum required.  If this minimum is later than the native system libraries, you will have to install the newer boost libraries on your own.&lt;br /&gt;
&lt;br /&gt;
=== Manually Building Boost ===&lt;br /&gt;
&lt;br /&gt;
The following are the steps to manually build Boost from the command-line.&lt;br /&gt;
&lt;br /&gt;
# Download Boost from http://www.boost.org&lt;br /&gt;
# Extract the file downloaded into an empty directory using one of these commands:&lt;br /&gt;
#* &amp;lt;code&amp;gt;unzip boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvzf boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvjf boost_VERSION.tar.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
#* '''NOTE:''' This top directory holding the uncompressed Boost files will be called &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Decide on which C++ compiler you are going to use (e.g., GCC, Intel, PGI). Once that is done, use SHARCNET's module system to unload any previous compiler and load the one you need:&lt;br /&gt;
#* Unload C++ compiler modules: &amp;lt;code&amp;gt;module unload gcc intel pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load the GCC v4.8.2 module example: &amp;lt;code&amp;gt;module load gcc/4.8.2&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on whether or not you want MPI support (and load the one suitable for the compiler you've chosen):&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload openmpi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load MPI for GCC example: &amp;lt;code&amp;gt;module load openmpi/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need MPI.)'''&lt;br /&gt;
# Decide whether or not you need Python support (and load the one suitable for the compiler you've chosen).&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload python&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load Python for GCC module: &amp;lt;code&amp;gt;module load python/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need Python.)'''&lt;br /&gt;
#* '''NOTE:''' Boost will use the system's Python if you don't load the module which is okay if you don't need Python.&lt;br /&gt;
# Change the directory to &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd $BOOST_SRC&amp;lt;/code&amp;gt;&lt;br /&gt;
# '''NOTE:''' Because SHARCNET has many compilers and tools available, avoid using the shortcut method to building Boost --build Boost's &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; program instead.&lt;br /&gt;
# Change the directory to build bjam:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd tools/build/v2&amp;lt;/code&amp;gt;&lt;br /&gt;
# For the aforementioned selected C++ compiler, determine the correct &amp;lt;code&amp;gt;--with-toolset&amp;lt;/code&amp;gt; option for &amp;lt;code&amp;gt;bootstrap.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=help&amp;lt;/code&amp;gt; '''(This command is designed to fail.)'''&lt;br /&gt;
#* &amp;lt;code&amp;gt;less booststrap.log&amp;lt;/code&amp;gt;&lt;br /&gt;
# Replace TOOLSET_NAME_FROM_FILE with the appropriate toolset mentioned in the &amp;lt;code&amp;gt;bootstrap.log&amp;lt;/code&amp;gt; file and the run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=TOOLSET_NAME_FROM_LOG_FILE&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=gcc&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=intel-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on a directory you want to install Boost build into.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./b2 install --prefix=$BUILD_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add &amp;lt;code&amp;gt;$BUILD_DIR/bin&amp;lt;/code&amp;gt; to your PATH (in your shell):&lt;br /&gt;
#* PATH=$BUILD_DIR/bin:$PATH&lt;br /&gt;
#* export PATH&lt;br /&gt;
# If you need Boost MPI, then add the following text to a line of its own in &amp;lt;code&amp;gt;user-config.jam&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;using mpi ;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Go back up to the &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd ../../..&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on an empty directory where you want to install the Boost libraries.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$INSTALL_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# If you would like Boost to build its libraries in parallel, decide on the number of parallel processes.&lt;br /&gt;
#* This number will be referred to as &amp;lt;code&amp;gt;$NUM_PROCS&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Although it is usually the same as the above, determine the toolset (referred to as $TOOLSET below) you need from the Boost documentation:&lt;br /&gt;
#* Version 1.55.0: http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.54.0: http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.53.0: http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.52.0: http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* etc.&lt;br /&gt;
# Build the Boost libraries by running:&lt;br /&gt;
#* Normal sequential build: &amp;lt;code&amp;gt;b2 --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Parallel build: &amp;lt;code&amp;gt;b2 -j$NUM_PROCS --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
# If all of the above went well, you're done building Boost!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; and the code in &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; is only needed to build Boost. You can delete &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; after Boost has been built by running &amp;lt;code&amp;gt;rm -rf $BOOST_DIR&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Compiling and Linking to the Boost Libraries + Running Executables ===&lt;br /&gt;
&lt;br /&gt;
Please note the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;BOOST_HOME=$INSTALL_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* The INCLUDE directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/include&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The LIBRARY directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To build programs use the -I, -L, and -l options to specify the top include file directory, the top library directory and any specific libraries that must be linked in to your program, e.g.,&lt;br /&gt;
* A program that uses header-only libraries: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include program1.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* A program that uses the Boost regex library: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include -L $BOOST_HOME/lib -lboost_regex program2.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
If your &amp;lt;code&amp;gt;$BOOST_HOME&amp;lt;/code&amp;gt; is not in a system-wide library directory, your compile program won't run. You can ensure it does run by adding &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;LD_LIBRARY_PATH&amp;lt;/code&amp;gt; (once per shell) as follows:&lt;br /&gt;
* &amp;lt;code&amp;gt;LD_LIBRARY_PATH=$BOOST_HOME/lib:$LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
and now you will be able to sucessfully run your programs.&lt;br /&gt;
&lt;br /&gt;
Finally remember to BEFORE running your programs you will ALWAYS need to &amp;quot;module unload&amp;quot; and &amp;quot;module load&amp;quot; the settings for any new shells you create. This can be a nuisance --you might prefer to place those unload and load commands at the bottom of your ~/.bashrc file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8753</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8753"/>
				<updated>2014-07-08T19:07:50Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: Added information about LD_LIBRARY_PATH&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
The version of boost and boost-devel packages installed are provided with the native operating system and not provided by a SHARCNET module hence they are available by default.&lt;br /&gt;
&lt;br /&gt;
To get the latest version information about the packages do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a listing of files for each package do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -ql boost&lt;br /&gt;
rpm -ql boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compiling Your Own Version Of Boost ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the operating system-installed version of the Boost libraries are usually out of date and programs relying on boost libraries may require a later version. Please check the documentation of the package you are trying to link to boost libraries to see which version is the minimum required.  If this minimum is later than the native system libraries, you will have to install the newer boost libraries on your own.&lt;br /&gt;
&lt;br /&gt;
=== Manually Building Boost ===&lt;br /&gt;
&lt;br /&gt;
The following are the steps to manually build Boost from the command-line.&lt;br /&gt;
&lt;br /&gt;
# Download Boost from http://www.boost.org&lt;br /&gt;
# Extract the file downloaded into an empty directory using one of these commands:&lt;br /&gt;
#* &amp;lt;code&amp;gt;unzip boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvzf boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvjf boost_VERSION.tar.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
#* '''NOTE:''' This top directory holding the uncompressed Boost files will be called &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Decide on which C++ compiler you are going to use (e.g., GCC, Intel, PGI). Once that is done, use SHARCNET's module system to unload any previous compiler and load the one you need:&lt;br /&gt;
#* Unload C++ compiler modules: &amp;lt;code&amp;gt;module unload gcc intel pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load the GCC v4.8.2 module example: &amp;lt;code&amp;gt;module load gcc/4.8.2&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on whether or not you want MPI support (and load the one suitable for the compiler you've chosen):&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload openmpi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load MPI for GCC example: &amp;lt;code&amp;gt;module load openmpi/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need MPI.)'''&lt;br /&gt;
# Decide whether or not you need Python support (and load the one suitable for the compiler you've chosen).&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload python&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load Python for GCC module: &amp;lt;code&amp;gt;module load python/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need Python.)'''&lt;br /&gt;
#* '''NOTE:''' Boost will use the system's Python if you don't load the module which is okay if you don't need Python.&lt;br /&gt;
# Change the directory to &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd $BOOST_SRC&amp;lt;/code&amp;gt;&lt;br /&gt;
# '''NOTE:''' Because SHARCNET has many compilers and tools available, avoid using the shortcut method to building Boost --build Boost's &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; program instead.&lt;br /&gt;
# Change the directory to build bjam:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd tools/build/v2&amp;lt;/code&amp;gt;&lt;br /&gt;
# For the aforementioned selected C++ compiler, determine the correct &amp;lt;code&amp;gt;--with-toolset&amp;lt;/code&amp;gt; option for &amp;lt;code&amp;gt;bootstrap.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=help&amp;lt;/code&amp;gt; '''(This command is designed to fail.)'''&lt;br /&gt;
#* &amp;lt;code&amp;gt;less booststrap.log&amp;lt;/code&amp;gt;&lt;br /&gt;
# Replace TOOLSET_NAME_FROM_FILE with the appropriate toolset mentioned in the &amp;lt;code&amp;gt;bootstrap.log&amp;lt;/code&amp;gt; file and the run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=TOOLSET_NAME_FROM_LOG_FILE&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=gcc&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=intel-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on a directory you want to install Boost build into.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./b2 install --prefix=$BUILD_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add &amp;lt;code&amp;gt;$BUILD_DIR/bin&amp;lt;/code&amp;gt; to your PATH (in your shell):&lt;br /&gt;
#* PATH=$BUILD_DIR/bin:$PATH&lt;br /&gt;
#* export PATH&lt;br /&gt;
# If you need Boost MPI, then add the following text to a line of its own in &amp;lt;code&amp;gt;user-config.jam&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;using mpi ;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Go back up to the &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd ../../..&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on an empty directory where you want to install the Boost libraries.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$INSTALL_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# If you would like Boost to build its libraries in parallel, decide on the number of parallel processes.&lt;br /&gt;
#* This number will be referred to as &amp;lt;code&amp;gt;$NUM_PROCS&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Although it is usually the same as the above, determine the toolset (referred to as $TOOLSET below) you need from the Boost documentation:&lt;br /&gt;
#* Version 1.55.0: http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.54.0: http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.53.0: http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.52.0: http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* etc.&lt;br /&gt;
# Build the Boost libraries by running:&lt;br /&gt;
#* Normal sequential build: &amp;lt;code&amp;gt;b2 --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Parallel build: &amp;lt;code&amp;gt;b2 -j$NUM_PROCS --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
# If all of the above went well, you're done building Boost!&lt;br /&gt;
&lt;br /&gt;
=== Compiling and Linking to the Boost Libraries + Running Executables ===&lt;br /&gt;
&lt;br /&gt;
Please note the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;BOOST_HOME=$INSTALL_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* The INCLUDE directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/include&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The LIBRARY directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To build programs use the -I, -L, and -l options to specify the top include file directory, the top library directory and any specific libraries that must be linked in to your program, e.g.,&lt;br /&gt;
* A program that uses header-only libraries: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include program1.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* A program that uses the Boost regex library: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include -L $BOOST_HOME/lib -lboost_regex program2.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
If your &amp;lt;code&amp;gt;$BOOST_HOME&amp;lt;/code&amp;gt; is not in a system-wide library directory, your compile program won't run. You can ensure it does run by adding &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;LD_LIBRARY_PATH&amp;lt;/code&amp;gt; (once per shell) as follows:&lt;br /&gt;
* &amp;lt;code&amp;gt;LD_LIBRARY_PATH=$BOOST_HOME/lib:$LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export LD_LIBRARY_PATH&amp;lt;/code&amp;gt;&lt;br /&gt;
and now you will be able to sucessfully run your programs.&lt;br /&gt;
&lt;br /&gt;
Finally remember to BEFORE running your programs you will ALWAYS need to &amp;quot;module unload&amp;quot; and &amp;quot;module load&amp;quot; the settings for any new shells you create. This can be a nuisance --you might prefer to place those unload and load commands at the bottom of your ~/.bashrc file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	<entry>
		<id>https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8752</id>
		<title>BOOST</title>
		<link rel="alternate" type="text/html" href="https://www.sharcnet.ca/help/index.php?title=BOOST&amp;diff=8752"/>
				<updated>2014-07-08T18:53:04Z</updated>
		
		<summary type="html">&lt;p&gt;Preney: Updated page to detail how to install Boost.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|package_name=BOOST&lt;br /&gt;
|package_description=free peer-reviewed portable C++ source libraries&lt;br /&gt;
|package_idnumber=137&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating System Installed Boost ==&lt;br /&gt;
The version of boost and boost-devel packages installed are provided with the native operating system and not provided by a SHARCNET module hence they are available by default.&lt;br /&gt;
&lt;br /&gt;
To get the latest version information about the packages do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -qi boost&lt;br /&gt;
rpm -qi boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a listing of files for each package do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -ql boost&lt;br /&gt;
rpm -ql boost-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compiling Your Own Version Of Boost ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the operating system-installed version of the Boost libraries are usually out of date and programs relying on boost libraries may require a later version. Please check the documentation of the package you are trying to link to boost libraries to see which version is the minimum required.  If this minimum is later than the native system libraries, you will have to install the newer boost libraries on your own.&lt;br /&gt;
&lt;br /&gt;
=== Manually Building Boost ===&lt;br /&gt;
&lt;br /&gt;
The following are the steps to manually build Boost from the command-line.&lt;br /&gt;
&lt;br /&gt;
# Download Boost from http://www.boost.org&lt;br /&gt;
# Extract the file downloaded into an empty directory using one of these commands:&lt;br /&gt;
#* &amp;lt;code&amp;gt;unzip boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvzf boost_VERSION.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;tar xvjf boost_VERSION.tar.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
#* '''NOTE:''' This top directory holding the uncompressed Boost files will be called &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Decide on which C++ compiler you are going to use (e.g., GCC, Intel, PGI). Once that is done, use SHARCNET's module system to unload any previous compiler and load the one you need:&lt;br /&gt;
#* Unload C++ compiler modules: &amp;lt;code&amp;gt;module unload gcc intel pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load the GCC v4.8.2 module example: &amp;lt;code&amp;gt;module load gcc/4.8.2&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on whether or not you want MPI support (and load the one suitable for the compiler you've chosen):&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload openmpi&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load MPI for GCC example: &amp;lt;code&amp;gt;module load openmpi/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need MPI.)'''&lt;br /&gt;
# Decide whether or not you need Python support (and load the one suitable for the compiler you've chosen).&lt;br /&gt;
#* Unload the module: &amp;lt;code&amp;gt;module unload python&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Load Python for GCC module: &amp;lt;code&amp;gt;module load python/gcc&amp;lt;/code&amp;gt; '''(Omit this line if you don't need Python.)'''&lt;br /&gt;
#* '''NOTE:''' Boost will use the system's Python if you don't load the module which is okay if you don't need Python.&lt;br /&gt;
# Change the directory to &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd $BOOST_SRC&amp;lt;/code&amp;gt;&lt;br /&gt;
# '''NOTE:''' Because SHARCNET has many compilers and tools available, avoid using the shortcut method to building Boost --build Boost's &amp;lt;code&amp;gt;b2&amp;lt;/code&amp;gt; program instead.&lt;br /&gt;
# Change the directory to build bjam:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd tools/build/v2&amp;lt;/code&amp;gt;&lt;br /&gt;
# For the aforementioned selected C++ compiler, determine the correct &amp;lt;code&amp;gt;--with-toolset&amp;lt;/code&amp;gt; option for &amp;lt;code&amp;gt;bootstrap.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=help&amp;lt;/code&amp;gt; '''(This command is designed to fail.)'''&lt;br /&gt;
#* &amp;lt;code&amp;gt;less booststrap.log&amp;lt;/code&amp;gt;&lt;br /&gt;
# Replace TOOLSET_NAME_FROM_FILE with the appropriate toolset mentioned in the &amp;lt;code&amp;gt;bootstrap.log&amp;lt;/code&amp;gt; file and the run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=TOOLSET_NAME_FROM_LOG_FILE&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=gcc&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=intel-linux&amp;lt;/code&amp;gt;&lt;br /&gt;
#* e.g., &amp;lt;code&amp;gt;./bootstrap.sh --with-toolset=pgi&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on a directory you want to install Boost build into.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$BUILD_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Run:&lt;br /&gt;
#* &amp;lt;code&amp;gt;./b2 install --prefix=$BUILD_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add &amp;lt;code&amp;gt;$BUILD_DIR/bin&amp;lt;/code&amp;gt; to your PATH (in your shell):&lt;br /&gt;
#* PATH=$BUILD_DIR/bin:$PATH&lt;br /&gt;
#* export PATH&lt;br /&gt;
# If you need Boost MPI, then add the following text to a line of its own in &amp;lt;code&amp;gt;user-config.jam&amp;lt;/code&amp;gt;:&lt;br /&gt;
#* &amp;lt;code&amp;gt;using mpi ;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Go back up to the &amp;lt;code&amp;gt;$BOOST_SRC&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
#* &amp;lt;code&amp;gt;cd ../../..&amp;lt;/code&amp;gt;&lt;br /&gt;
# Decide on an empty directory where you want to install the Boost libraries.&lt;br /&gt;
#* This directory will be referred to as &amp;lt;code&amp;gt;$INSTALL_DIR&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# If you would like Boost to build its libraries in parallel, decide on the number of parallel processes.&lt;br /&gt;
#* This number will be referred to as &amp;lt;code&amp;gt;$NUM_PROCS&amp;lt;/code&amp;gt; below.&lt;br /&gt;
# Although it is usually the same as the above, determine the toolset (referred to as $TOOLSET below) you need from the Boost documentation:&lt;br /&gt;
#* Version 1.55.0: http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.54.0: http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.53.0: http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* Version 1.52.0: http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html#toolset&lt;br /&gt;
#* etc.&lt;br /&gt;
# Build the Boost libraries by running:&lt;br /&gt;
#* Normal sequential build: &amp;lt;code&amp;gt;b2 --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Parallel build: &amp;lt;code&amp;gt;b2 -j$NUM_PROCS --prefix=$INSTALL_DIR --build-dir=$BUILD_DIR toolset=$TOOLSET install&amp;lt;/code&amp;gt;&lt;br /&gt;
# If all of the above went well, you're done building Boost!&lt;br /&gt;
&lt;br /&gt;
Please note the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;BOOST_HOME=$INSTALL_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* The INCLUDE directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/include&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The LIBRARY directory for Boost is &amp;lt;code&amp;gt;$BOOST_HOME/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To build programs use the -I, -L, and -l options to specify the top include file directory, the top library directory and any specific libraries that must be linked in to your program, e.g.,&lt;br /&gt;
* A program that uses header-only libraries: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include program1.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* A program that uses the Boost regex library: &amp;lt;code&amp;gt;$CXX -I $BOOST_HOME/include -L $BOOST_HOME/lib -lboost_regex program2.cxx&amp;lt;/code&amp;gt;&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
Finally remember to BEFORE running your programs you will ALWAYS need to &amp;quot;module unload&amp;quot; and &amp;quot;module load&amp;quot; the settings for any new shells you create. This can be a nuisance --you might prefer to place those unload and load commands at the bottom of your ~/.bashrc file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
o Boost Homepage&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.boost.org/&lt;/div&gt;</summary>
		<author><name>Preney</name></author>	</entry>

	</feed>