Installation by users: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
m (<source> to <pre> to fix code blocks)
 
(3 intermediate revisions by 2 users not shown)
Line 20: Line 20:
The first step is to create a 'root' bwa directory, where multiple module files, one for each version, can be created.
The first step is to create a 'root' bwa directory, where multiple module files, one for each version, can be created.


<source lang='bash'>
<pre>
mkdir /cm/shared/apps/WUR/ABGC/modulefiles/bwa
mkdir /cm/shared/apps/WUR/ABGC/modulefiles/bwa
</source>
</pre>


note that this may already have been done by somebody else; pay attention not to remove existing module files.
note that this may already have been done by somebody else; pay attention not to remove existing module files.
Line 28: Line 28:
The next step involves making a small TCL-based script. The name of the script is the version of the software that the module pertains. In this case 0.5.9.
The next step involves making a small TCL-based script. The name of the script is the version of the software that the module pertains. In this case 0.5.9.


<source lang='bash'>
<pre>
vi  /cm/shared/apps/WUR/ABGC/modulefiles/bwa/0.5.9
vi  /cm/shared/apps/WUR/ABGC/modulefiles/bwa/0.5.9
</source>
</pre>


A basic module script may look like this:
A basic module script may look like this:
<source lang='tcl'>
<pre>
#%Module1.0#######################################################################
#%Module1.0#######################################################################
## bwa 0.5.9 modulefile
## bwa 0.5.9 modulefile
Line 48: Line 48:
prepend-path    PATH            $bwa_059_root
prepend-path    PATH            $bwa_059_root


</source>
</pre>


=== Adding a custom module directory to your environment ===
=== Adding a custom module directory to your environment ===
To allow the <code>module</code> program to find the custom module directory, the location of that directory has to be added to <code>MODULEPATH</code> variable.  
To allow the <code>module</code> program to find the custom module directory, the location of that directory has to be added to <code>MODULEPATH</code> variable.  


<source lang='bash'>
<pre>
export MODULEPATH=$MODULEPATH:/cm/shared/apps/WUR/ABGC/modulefiles
export MODULEPATH=$MODULEPATH:/cm/shared/apps/WUR/ABGC/modulefiles
</source>
</pre>
This can be made permanent by adding this line of code to the <code>.bash_profile</code> file in the root of your home folder. To then load the modified <code>MODULEPATH</code> variable you have to load  <code>.bash_profile</code> again:
This can be made permanent by adding this line of code to the <code>.bash_profile</code> file in the root of your home folder. To then load the modified <code>MODULEPATH</code> variable you have to load  <code>.bash_profile</code> again:
<source lang='bash'>
<pre>
source .bash_profile
source .bash_profile
</source>
</pre>
This needs to be done only once. Next time you login, <code>.bash_profile</code> will be loaded automatically.
This needs to be done only once. Next time you login, <code>.bash_profile</code> will be loaded automatically.


You can check if the modules are found.
You can check if the modules are found.
<source lang='bash'>
<pre>
module avail
module avail
</source>
</pre>
This should give output that includes something similar to this:
This should give output that includes something similar to this:


Line 72: Line 72:


== See also ==
== See also ==
* [[B4F_cluster | B4F Cluster]]
* [[Anunna | Anunna]]
* [[Lx6_and_Lx7_compute_nodes | Lx6 and Lx7 compute nodes]]
* [[Environment_Modules | Environment Modules]]
* [[Environment_Modules | Environment Modules]]
* [[Control_R_environment_using_modules | Control R environment using modules]]
* [[Control_R_environment_using_modules | Control R environment using modules]]
* [[Create_shortcut_log-in_command | Create a shortcut for the ssh log-in command]]
* [[Create_shortcut_log-in_command | Create a shortcut for the ssh log-in command]]
* [[Installing_R_packages_locally | Installing R packages locally]]
* [[Installing_R_packages_locally | Installing R packages locally]]
* [[ABGC_modules | ABGC specific modules]]


== External links ==
== External links ==
* http://modules.sourceforge.net
* http://modules.sourceforge.net
* http://www.admin-magazine.com/HPC/Articles/Environment-Modules
* http://www.admin-magazine.com/HPC/Articles/Environment-Modules

Latest revision as of 15:39, 15 June 2023

Domain specific folders for executables and libraries

Many packages and applications can be installed locally in the $HOME directory. Users of each of the groups (e.g. 'WUR/ABGC') can deposit a map with executables or library files that can be of interest to multiple users

 /cm/shared/apps/WUR/ABGC/

Preparing modules for local or domain specific use

Example of making a very simple module that would load a specific version of the short-read aligner bwa to your environment. Simple example, but demonstrates the principle. The example assumes that the executable file(s) are in:

 /cm/shared/apps/WUR/ABGC/bwa/bwa-0.5.9/

create a module file

All users can store executable or library files in:

 /cm/shared/apps/WUR/ABGC/

Within that folder, a modules folder was created where modules can be stored.

 /cm/shared/apps/WUR/ABGC/modules

In the case of bwa, there are quite a few versions, and users may have a preference for a newer or older version, depending on your pipeline.

The first step is to create a 'root' bwa directory, where multiple module files, one for each version, can be created.

mkdir /cm/shared/apps/WUR/ABGC/modulefiles/bwa

note that this may already have been done by somebody else; pay attention not to remove existing module files.

The next step involves making a small TCL-based script. The name of the script is the version of the software that the module pertains. In this case 0.5.9.

vi  /cm/shared/apps/WUR/ABGC/modulefiles/bwa/0.5.9

A basic module script may look like this:

#%Module1.0#######################################################################
## bwa 0.5.9 modulefile
##
proc ModulesHelp { } {

        puts stderr "\tAdds bwa v0.5.9 to your environment"
}

module-whatis   "Adds bwa v0.5.9 to your environment"

set             bwa_059_root        /cm/shared/apps/WUR/ABGC/bwa/bwa-0.5.9/

prepend-path     PATH             $bwa_059_root

Adding a custom module directory to your environment

To allow the module program to find the custom module directory, the location of that directory has to be added to MODULEPATH variable.

export MODULEPATH=$MODULEPATH:/cm/shared/apps/WUR/ABGC/modulefiles

This can be made permanent by adding this line of code to the .bash_profile file in the root of your home folder. To then load the modified MODULEPATH variable you have to load .bash_profile again:

source .bash_profile

This needs to be done only once. Next time you login, .bash_profile will be loaded automatically.

You can check if the modules are found.

module avail

This should give output that includes something similar to this:

 ----------------------------------- /cm/shared/apps/WUR/ABGC/modulefiles -----------------------------------
 bwa/0.5.9  bwa/0.7.5a

See also

External links