Difference between revisions of "Load modules"
From ALICE Documentation
(→Load modules) (Tag: Visual edit) |
(→Load modules) (Tag: Visual edit) |
||
Line 3: | Line 3: | ||
<br />Initially, Python 3 is not loaded. We can test this by using the command <code>which</code> that looks for programs the same way that Bash does. We can use it to tell us where a particular piece of software is stored. | <br />Initially, Python 3 is not loaded. We can test this by using the command <code>which</code> that looks for programs the same way that Bash does. We can use it to tell us where a particular piece of software is stored. | ||
− | + | [me@nodelogin01~]$ which python3 | |
− | + | /usr/bin/which: no python3 in (/cm/shared/apps/slurm/18.08.4/sbin:/cm/shared/apps/slurm/18.08.4/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/me/.local/bin:/home/me/bin) | |
<br />We can load the <code>python3</code> command with <code>module load</code>: | <br />We can load the <code>python3</code> command with <code>module load</code>: | ||
− | + | [me@nodelogin01 ~]$ module load Python/3.7.2-GCCcore-8.2.0 | |
− | + | [me@nodelogin01 ~]$ which python3 | |
− | + | /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin/python3 | |
<br />So what just happened? To understand the output, first we need to understand the nature of the <code>$PATH</code> environment variable. <code>$PATH</code> is a special environment variable that controls where a Linux ''operating system'' (OS) looks for software. Specifically <code>$PATH</code> is a list of directories (separated by <code>:</code>) that the OS searches through for a command. As with all environment variables, we can print it using <code>echo</code>. | <br />So what just happened? To understand the output, first we need to understand the nature of the <code>$PATH</code> environment variable. <code>$PATH</code> is a special environment variable that controls where a Linux ''operating system'' (OS) looks for software. Specifically <code>$PATH</code> is a list of directories (separated by <code>:</code>) that the OS searches through for a command. As with all environment variables, we can print it using <code>echo</code>. | ||
− | + | [me@nodelogin01 ~]$ echo $PATH | |
− | + | /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/XZ/5.2.4-GCCcore- 8.2.0/bin:/cm/shared/easybuild/software/SQLite/3.27.2-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/Tcl/8.6.9-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/libreadline/8.0-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/ncurses/6.1-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/bzip2/1.0.6- GCCcore-8.2.0/bin:/cm/shared/easybuild/software/GCCcore/8.2.0/bin:/cm/shared/apps/slurm/19.05.1/sbin:/cm/shared/apps/slurm/19.05.1/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/me/.local/bin:/home/me/bin | |
− | You’ll notice a similarity to the output of the <code>which</code> command. In this case, there’s only one difference: the <code>/cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin</code> directory at the beginning. When we used <code>module load Python/3.7.2-GCCcore-8.2.0</code>, it added this directory to the beginning of our <code>$PATH</code>. Let’s examine what is there: | + | You’ll notice a similarity to the output of the <code>which</code> command. In this case, there’s only one difference: the <code>/cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin</code> directory at the beginning. When we used <code>module load Python/3.7.2-GCCcore-8.2.0</code>, it added this directory to the beginning of our <code>$PATH</code>. Let’s examine what is there: |
[me@nodelogin01 ~]$ \ls /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin | [me@nodelogin01 ~]$ \ls /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin |
Revision as of 08:38, 9 April 2020
Load modules
To load a software module, use module load
. In the example below, we will use Python 3.
Initially, Python 3 is not loaded. We can test this by using the command which
that looks for programs the same way that Bash does. We can use it to tell us where a particular piece of software is stored.
[me@nodelogin01~]$ which python3 /usr/bin/which: no python3 in (/cm/shared/apps/slurm/18.08.4/sbin:/cm/shared/apps/slurm/18.08.4/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/me/.local/bin:/home/me/bin)
We can load the python3
command with module load
:
[me@nodelogin01 ~]$ module load Python/3.7.2-GCCcore-8.2.0 [me@nodelogin01 ~]$ which python3 /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin/python3
So what just happened? To understand the output, first we need to understand the nature of the $PATH
environment variable. $PATH
is a special environment variable that controls where a Linux operating system (OS) looks for software. Specifically $PATH
is a list of directories (separated by :
) that the OS searches through for a command. As with all environment variables, we can print it using echo
.
[me@nodelogin01 ~]$ echo $PATH
/cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/XZ/5.2.4-GCCcore- 8.2.0/bin:/cm/shared/easybuild/software/SQLite/3.27.2-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/Tcl/8.6.9-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/libreadline/8.0-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/ncurses/6.1-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/bzip2/1.0.6- GCCcore-8.2.0/bin:/cm/shared/easybuild/software/GCCcore/8.2.0/bin:/cm/shared/apps/slurm/19.05.1/sbin:/cm/shared/apps/slurm/19.05.1/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/me/.local/bin:/home/me/bin
You’ll notice a similarity to the output of the which
command. In this case, there’s only one difference: the /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin
directory at the beginning. When we used module load Python/3.7.2-GCCcore-8.2.0
, it added this directory to the beginning of our $PATH
. Let’s examine what is there:
[me@nodelogin01 ~]$ \ls /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin 2to3 futurize pip pytest python3-config rst2odt_prepstyles.py sphinx-apidoc 2to3-3.7 idle3 pip3 py.test pyvenv rst2odt.py sphinx-autogen chardetect idle3.7 pip3.7 python pyvenv-3.7 rst2pseudoxml.py sphinx-build cygdb netaddr pybabel python3 rst2html4.py rst2s5.py sphinx-quickstart cython nosetests __pycache__ python3.7 rst2html5.py rst2xetex.py tabulate cythonize nosetests-3.7 pydoc3 python3.7-config rst2html.py rst2xml.py virtualenv easy_install pasteurize pydoc3.7 python3.7m rst2latex.py rstpep2html.py wheel easy_install-3.7 pbr pygmentize python3.7m-config rst2man.py runxlrd.py
Taking this to its conclusion, module load
adds software to your $PATH
. It “loads” software. A special note on this, depending on which version of the module
program that is installed at your site, module load
may also load required software dependencies.
[me@nodelogin01 ~]$ module list Currently Loaded Modules: 1) shared 5) GCCcore/8.2.0 9) libreadline/8.0-GCCcore-8.2.0 13) GMP/6.1.2-GCCcore-8.2.0 2) DefaultModules 6) bzip2/1.0.6-GCCcore-8.2.0 10) Tcl/8.6.9-GCCcore-8.2.0 14) libffi/3.2.1-GCCcore-8.2.0 3) gcc/8.2.0 7) zlib/1.2.11-GCCcore-8.2.0 11) SQLite/3.27.2-GCCcore-8.2.0 15) Python/3.7.2-GCCcore-8.2.0 4) slurm/19.05.1 8) ncurses/6.1-GCCcore-8.2.0 12) XZ/5.2.4-GCCcore-8.2.0