EasyBuild: Difference between revisions
No edit summary |
|||
(15 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:2--> | <!--T:2--> | ||
Line 11: | Line 8: | ||
= EasyBuild and modules = <!--T:3--> | = EasyBuild and modules = <!--T:3--> | ||
One of the key features of EasyBuild is that it automatically generates environment [[Utiliser_des_modules/en|modules]] which can be used to make a software package available in your session. In addition to defining standard Linux environment variables such as < | One of the key features of EasyBuild is that it automatically generates environment [[Utiliser_des_modules/en|modules]] which can be used to make a software package available in your session. In addition to defining standard Linux environment variables such as <code>PATH</code>, <code>CPATH</code> and <code>LIBRARY_PATH</code>, EasyBuild also defines some environment variables specific to EasyBuild, two of which may be particularly interesting to users: | ||
* < | * <code>EBROOT<name></code>: Contains the full path to the location where the software <code><name></code> is installed. | ||
* < | * <code>EBVERSION<name></code>: Contains the full version of the software <code><name></code> loaded by this module. | ||
For example, the module < | <!--T:15--> | ||
* < | For example, the module <code>python/3.10.2</code> on Narval defines: | ||
* < | * <code>EBROOTPYTHON</code>: <code>/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Core/python/3.10.2</code> | ||
* <code>EBVERSIONPYTHON</code>: <code>3.10.2</code> | |||
You can see the environment variables defined by the < | <!--T:16--> | ||
You can see the environment variables defined by the <code>python/3.10.2</code> module using: | |||
{{Command|module show python/3.10.2 {{!}} grep EB}} | {{Command|module show python/3.10.2 {{!}} grep EB}} | ||
= Installation recipes and logs = | = Installation recipes and logs = <!--T:17--> | ||
EasyBuild keeps a copy of the recipe used to install each software package, as well as a detailed log inside | EasyBuild keeps a copy of the recipe used to install each software package, as well as a detailed log inside the installation directory. This is accessible in the directory <code>$EBROOT<name>/easybuild</code>. For example, for the <code>python/3.10.2</code> module, the installation directory contains, amongst other things: | ||
* < | * <code>$EBROOTPYTHON/easybuild/Python-3.10.2.eb</code> | ||
* < | * <code>$EBROOTPYTHON/easybuild/easybuild-Python-3.10.2-*.log</code> | ||
= Using EasyBuild in your own account = <!--T:6--> | = Using EasyBuild in your own account = <!--T:6--> | ||
EasyBuild can be used to install software packages in your own account. However, in most cases, it is preferable to ask our [[ | EasyBuild can be used to install software packages in your own account. However, in most cases, it is preferable to ask our [[technical support]] to install the software centrally for you. This is because that will ensure that the software package is available on all of our clusters. It will also avoid using your quota, and it will avoid causing undue load on the parallel filesystems. | ||
<!--T:18--> | |||
{{Warning|title=When to use or not use EasyBuild to install software in your home | {{Warning|title=When to use or not use EasyBuild to install software in your home | ||
|content=There are a few use cases in which you may want to use EasyBuild to install software in your own space: | |content=There are a few use cases in which you may want to use EasyBuild to install software in your own space: | ||
Line 36: | Line 36: | ||
* if we are not allowed to install the package centrally for licensing reasons, such as some commercial software packages ([[VASP]] and [[Materials Studio]] in particular) | * if we are not allowed to install the package centrally for licensing reasons, such as some commercial software packages ([[VASP]] and [[Materials Studio]] in particular) | ||
On the contrary, you | <!--T:19--> | ||
On the contrary, you <b>should not</b> install software packages in your own space for the following reasons: | |||
* if you need a different release version | * if you need a different release version | ||
* if you need a software package built using a different compiler, MPI or CUDA implementation | * if you need a software package built using a different compiler, MPI or CUDA implementation | ||
When in doubt, please ask our [[ | <!--T:20--> | ||
When in doubt, please ask our [[technical support]] for advice. }} | |||
== What is a recipe == | == What is a recipe == <!--T:21--> | ||
{{Note|Writing a recipe from scratch will not be discussed here; you can find more about this in the [https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html EasyBuild documentation]. Modifying a recipe for your particular situation is easier, and it is easier still to find a suitable recipe and use it unmodified.}} | {{Note|Writing a recipe from scratch will not be discussed here; you can find more about this in the [https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html EasyBuild documentation]. Modifying a recipe for your particular situation is easier, and it is easier still to find a suitable recipe and use it unmodified.}} | ||
<!--T:22--> | |||
Recipes, also known as EasyConfig files are text files containing the information EasyBuild needs to build a particular piece of software in a particular environment. They are named following a convention: | Recipes, also known as EasyConfig files are text files containing the information EasyBuild needs to build a particular piece of software in a particular environment. They are named following a convention: | ||
* < | * <code><name>-<version>-<toolchain name>-<toolchain version>.eb</code> | ||
where < | where <code><name></code> is the name of the package, <code><version></code> is its version, <code><toolchain name></code> is the name of the toolchain and <code><toolchain version></code> is its version. More on toolchains later. | ||
== Finding a recipe == | == Finding a recipe == <!--T:23--> | ||
EasyBuild contains a lot of recipes which may or may not compile with the toolchains we have. The surest way to get a recipe that works is to start from one of the recipes which we have installed. These can be found either in the installation folder, as mentioned above, or in the < | EasyBuild contains a lot of recipes which may or may not compile with the toolchains we have. The surest way to get a recipe that works is to start from one of the recipes which we have installed. These can be found either in the installation folder, as mentioned above, or in the <code>/cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO</code> folder. | ||
<!--T:24--> | |||
{{Callout|title=What is in a toolchain? | {{Callout|title=What is in a toolchain? | ||
|content=Toolchains are a combination of compiler, MPI implementation, CUDA version, and mathematical libraries, which are used to compile the software package. They usually hold a rather obscure name such as < | |content=Toolchains are a combination of compiler, MPI implementation, CUDA version, and mathematical libraries, which are used to compile the software package. They usually hold a rather obscure name such as <code>gofbc</code> which, in this case, means it is a combination of GCC, OpenMPI, FlexiBlas and CUDA. However, you do not need to remember this naming, since toolchains themselves have recipes, which are also available in the <code>/cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO</code> directory. For example, the <code>gofbc</code> toolchain, version <code>2020.1.403.114</code> contains, as per <code>/cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO/gofbc/gofbc-2020.1.403.114.eb</code>: | ||
<pre> | <pre> | ||
local_gccver = '9.3.0' | local_gccver = '9.3.0' | ||
<!--T:25--> | |||
# specify subtoolchains as builddependencies | # specify subtoolchains as builddependencies | ||
# this way they will be considered as subtoolchains but | # this way they will be considered as subtoolchains but | ||
Line 66: | Line 71: | ||
] | ] | ||
<!--T:26--> | |||
dependencies = [ | dependencies = [ | ||
('GCC', local_gccver), # part of gcccuda | ('GCC', local_gccver), # part of gcccuda | ||
Line 74: | Line 80: | ||
</pre> | </pre> | ||
which means that it contains GCC version 9.3.0, OpenMPI 4.0.3, CUDA 11.4, and FlexiBLAS 3.0.4. The < | <!--T:27--> | ||
which means that it contains GCC version 9.3.0, OpenMPI 4.0.3, CUDA 11.4, and FlexiBLAS 3.0.4. The <code>builddependencies</code> part means that the <code>gofbc</code> toolchain is a superset of the <code>gompic</code> and the <code>gccflexiblascuda</code> toolchains. When a toolchain is a superset of other toolchains, it allows software packages built with the former to have dependencies on software packages built with the latter, i.e. software packages built with <code>gofbc</code> can depend on software packages built with <code>gompic</code>, but not the other way around. | |||
}} | }} | ||
== Installing a software with EasyBuild == | == Installing a software with EasyBuild == <!--T:28--> | ||
Once you have found a recipe matching your needs, copy its recipe from the < | Once you have found a recipe matching your needs, copy its recipe from the <code>/cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO</code> folder, and modify it as needed. Then, run | ||
{{Command|eb <recipe.eb>}} | {{Command|eb <recipe.eb>}} | ||
to install it. This will install the software inside of your home directory, in < | to install it. This will install the software inside of your home directory, in <code>$HOME/.local/easybuild</code>. After the installation is completed, exit your session and reconnect to the cluster, and it should be available to load as a module. | ||
=== Reinstalling an existing version === <!--T:29--> | |||
If you are reinstalling the exact same version as one we have installed centrally, but with modified parameters, you need to use | |||
{{Command|eb <recipe.eb> --force}} | |||
to install a local version in your home. | |||
=== Installing in a different location === <!--T:30--> | |||
You may want to install the software package in a different location than your home directory, for example in a project directory. To do so, use the following: | |||
{{Command|eb <recipe.eb> --installpath /path/to/your/project/easybuild}} | |||
Then, to get these modules available in your sessions, run | |||
{{Command|export RSNT_LOCAL_MODULEPATHS{{=}}/path/to/your/project/easybuild/modules}} | |||
If you want to have this available by default in your sessions, you can add this command to your <code>.bashrc</code> file in your home. | |||
= Additional resources = <!--T:13--> | = Additional resources = <!--T:13--> | ||
<!--T:14--> | <!--T:14--> | ||
* | * Webinar [https://westgrid.github.io/trainingMaterials/getting-started/#building-software-with-easybuild <i>Building software on Compute Canada clusters using EasyBuild</i>] (recording and slides) | ||
* Our staff-facing documentation [https://github.com/ComputeCanada/software-stack/blob/main/doc/easybuild.md is available here]. | * Our staff-facing documentation [https://github.com/ComputeCanada/software-stack/blob/main/doc/easybuild.md is available here]. | ||
* Many [https://easybuild.io/tutorial/ tutorials] on EasyBuild are available | * Many [https://easybuild.io/tutorial/ tutorials] on EasyBuild are available | ||
</translate> | </translate> |
Latest revision as of 16:11, 14 September 2023
EasyBuild is a tool for building, installing, and maintaining software on high-performance computing systems.
We use it to build almost everything in our software repository, CVMFS.
EasyBuild and modules[edit]
One of the key features of EasyBuild is that it automatically generates environment modules which can be used to make a software package available in your session. In addition to defining standard Linux environment variables such as PATH
, CPATH
and LIBRARY_PATH
, EasyBuild also defines some environment variables specific to EasyBuild, two of which may be particularly interesting to users:
EBROOT<name>
: Contains the full path to the location where the software<name>
is installed.EBVERSION<name>
: Contains the full version of the software<name>
loaded by this module.
For example, the module python/3.10.2
on Narval defines:
EBROOTPYTHON
:/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Core/python/3.10.2
EBVERSIONPYTHON
:3.10.2
You can see the environment variables defined by the python/3.10.2
module using:
[name@server ~]$ module show python/3.10.2 | grep EB
Installation recipes and logs[edit]
EasyBuild keeps a copy of the recipe used to install each software package, as well as a detailed log inside the installation directory. This is accessible in the directory $EBROOT<name>/easybuild
. For example, for the python/3.10.2
module, the installation directory contains, amongst other things:
$EBROOTPYTHON/easybuild/Python-3.10.2.eb
$EBROOTPYTHON/easybuild/easybuild-Python-3.10.2-*.log
Using EasyBuild in your own account[edit]
EasyBuild can be used to install software packages in your own account. However, in most cases, it is preferable to ask our technical support to install the software centrally for you. This is because that will ensure that the software package is available on all of our clusters. It will also avoid using your quota, and it will avoid causing undue load on the parallel filesystems.
There are a few use cases in which you may want to use EasyBuild to install software in your own space:
- if you need a custom or modified build
- if you need to install a nightly build, or a version of a software which does not have a release number
- if we are not allowed to install the package centrally for licensing reasons, such as some commercial software packages (VASP and Materials Studio in particular)
On the contrary, you should not install software packages in your own space for the following reasons:
- if you need a different release version
- if you need a software package built using a different compiler, MPI or CUDA implementation
When in doubt, please ask our technical support for advice.
What is a recipe[edit]
Writing a recipe from scratch will not be discussed here; you can find more about this in the EasyBuild documentation. Modifying a recipe for your particular situation is easier, and it is easier still to find a suitable recipe and use it unmodified. |
Recipes, also known as EasyConfig files are text files containing the information EasyBuild needs to build a particular piece of software in a particular environment. They are named following a convention:
<name>-<version>-<toolchain name>-<toolchain version>.eb
where <name>
is the name of the package, <version>
is its version, <toolchain name>
is the name of the toolchain and <toolchain version>
is its version. More on toolchains later.
Finding a recipe[edit]
EasyBuild contains a lot of recipes which may or may not compile with the toolchains we have. The surest way to get a recipe that works is to start from one of the recipes which we have installed. These can be found either in the installation folder, as mentioned above, or in the /cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO
folder.
Toolchains are a combination of compiler, MPI implementation, CUDA version, and mathematical libraries, which are used to compile the software package. They usually hold a rather obscure name such as gofbc
which, in this case, means it is a combination of GCC, OpenMPI, FlexiBlas and CUDA. However, you do not need to remember this naming, since toolchains themselves have recipes, which are also available in the /cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO
directory. For example, the gofbc
toolchain, version 2020.1.403.114
contains, as per /cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO/gofbc/gofbc-2020.1.403.114.eb
:
local_gccver = '9.3.0' # specify subtoolchains as builddependencies # this way they will be considered as subtoolchains but # are not loaded in the modulefile or software compiled # with this toolchain builddependencies = [ ('gccflexiblascuda', '2020.1.114'), ('gompic', version), ] dependencies = [ ('GCC', local_gccver), # part of gcccuda ('CUDA', '11.4', '', ('GCC', local_gccver)), # part of gcccuda ('OpenMPI', '4.0.3', '', ('gcccuda', '2020.1.114')), ('FlexiBLAS', '3.0.4'), ]
which means that it contains GCC version 9.3.0, OpenMPI 4.0.3, CUDA 11.4, and FlexiBLAS 3.0.4. The builddependencies
part means that the gofbc
toolchain is a superset of the gompic
and the gccflexiblascuda
toolchains. When a toolchain is a superset of other toolchains, it allows software packages built with the former to have dependencies on software packages built with the latter, i.e. software packages built with gofbc
can depend on software packages built with gompic
, but not the other way around.
Installing a software with EasyBuild[edit]
Once you have found a recipe matching your needs, copy its recipe from the /cvmfs/soft.computecanada.ca/easybuild/ebfiles_repo/$EBVERSIONGENTOO
folder, and modify it as needed. Then, run
[name@server ~]$ eb <recipe.eb>
to install it. This will install the software inside of your home directory, in $HOME/.local/easybuild
. After the installation is completed, exit your session and reconnect to the cluster, and it should be available to load as a module.
Reinstalling an existing version[edit]
If you are reinstalling the exact same version as one we have installed centrally, but with modified parameters, you need to use
[name@server ~]$ eb <recipe.eb> --force
to install a local version in your home.
Installing in a different location[edit]
You may want to install the software package in a different location than your home directory, for example in a project directory. To do so, use the following:
[name@server ~]$ eb <recipe.eb> --installpath /path/to/your/project/easybuild
Then, to get these modules available in your sessions, run
[name@server ~]$ export RSNT_LOCAL_MODULEPATHS=/path/to/your/project/easybuild/modules
If you want to have this available by default in your sessions, you can add this command to your .bashrc
file in your home.
Additional resources[edit]
- Webinar Building software on Compute Canada clusters using EasyBuild (recording and slides)
- Our staff-facing documentation is available here.
- Many tutorials on EasyBuild are available