Skip to content
itkovian edited this page Apr 19, 2012 · 14 revisions

Getting started with EasyBuild is almost trivial: just follow these simple steps and you can start building and deploying software with EasyBuild yourself.


## Step 1: Configure EasyBuild

The first step consists of configuring EasyBuild: see Configuration for full details if you haven't done this yet.

Do make sure you also extend the MODULEPATH environment variables with <installPath>/modules/all before continuing to make sure that EasyBuild is able to resolve dependencies.

## Step 2: Test your configuration

Once you have EasyBuild configured, you can test your configuration by installing a simple software package.

A good example is the open-source software package gzip.

Follow these steps to build your first software package using EasyBuild:

Step 2.1: Create specification file

Create a .eb specification file named gzip.eb, with contents as shown below, anywhere on your system (for example, in your home directory):

name = 'gzip'
version = '1.4'

homepage = 'http://www.gnu.org/software/gzip/'
description = "gzip (GNU zip) is a popular data compression program as a replacement for compress"

# dummy toolkit, rely on system C compiler
toolkit = {'name':'dummy','version':'dummy'}

# source tarball filename
sources = ['%s-%s.tar.gz'%(name,version)]

# download location for source files
sourceURLs = ['http://ftpmirror.gnu.org/gzip']

# make sure the gzip and gunzip binaries are available after installation
sanityCheckPaths = { 'files':["bin/gunzip", "bin/gzip"], 'dirs':[] }

EasyBuild will try and download the gzip source tarball to the source path you configured EasyBuild with, in a subdirectory named g/gzip, if it's not available yet.

Note that the specification file is basically just Python code.

Step 2.2: Install with EasyBuild

Run EasyBuild, and specify the location of the gzip.eb files you created in step 2.2:

<path>/easybuild/easybuild.sh gzip.eb
## Step 3: Set up a compiler toolkit

EasyBuild uses compiler toolkits to build software. These consist a (set of) compiler(s) to build software, and a set of libraries to provide extra functionality (e.g., MPI support, BLAS and/or LAPACK routines, etc.).

In the previous step, a dummy compiler toolkit was used. Therefore, EasyBuild depended on the compilers and libraries provided by the system. For various reasons, this is not the best possible scenario. First, if system updates are performed (either by you or a system administrator), then the compiler and its assorted libraries may be upgraded, potentially breaking existing software builds. Second, reproducing a build with the exact same compiler and library versions of installed software packages may become quite difficult if you rely on the system compiler and system libraries for building.

Therefore, the first time you use EasyBuild, you should start by constructing your preferred compiler toolkit(s). Note that there is no problem using several toolkits next to each other.

For more details, we refer to the compiler toolkits wiki page and the step-by-step demo.

## Step 4: Build a software package using a compiler toolkit

After putting together your own compiler toolkit, you can try installing gzip using that toolkit.

Note that EasyBuild will install a whole new build of gzip when doing this, without removing or overwriting the previous build using the dummy toolkit.

To build and install gzip using your freshly installed toolkit, simply adjust the toolkit variable in the gzip.eb specification file, detailing the name and version of your toolkit. For example:

toolkit = {'name':'myToolkit','version':'1.2.3'}
## Step 5: Load the module, and use the built software

You can now load the module created by EasyBuild to start using gzip built with your own compiler toolkit:

module load gzip/1.4-myToolkit-1.2.3

Congratulations!

Congratulations, you've just mastered the basics of EasyBuild!

You can now start using EasyBuild to build your favorite set of software packages.

For a detailed example of setting up a compiler toolkit and using it, see the step-by-step demo.

More advanced topics include:

Clone this wiki locally