Install Class Software
When teaching a course, you may have some software packages that the students will need to use. Rather than having each student install the software in their own directories, follow this guide to install software in one central location, then share that software with everyone in the course using modulefiles.
Choose the Right Install Location
Software should be installed in your work directory. Navigate to your work space and make a new folder for software:
$ cd $STOCKYARD
$ mkdir class-software/
$ cd class-software/
$ pwd
/work/01234/username/class-software/
Please note: your work directory will be a slightly different path - please substitute in the path of your work directory when following the guide below.
Download and Install Software
The installation process differs for each software package, and a comprehensive guide for installing software will not be included here. Please check the user guides for whichever machine you are installing on for general installation help.
It is good practice to organize installed software by package name and version. This will also help later when building modulefiles. As an example, this guide will show the process to install a tool called bedtools2, a toolset for genome arithmetic, on Lonestar6:
# Load a recent gcc module, required for bedtools2
$ module load gcc
# Download and unpack the tool
$ wget https://github.com/arq5x/bedtools2/archive/refs/tags/v2.29.2.tar.gz
$ tar -xvzf v2.29.2.tar.gz
$ cd bedtools2-2.29.2/
# Compile the software
$ make
# Copy the binaries into a standard location
$ DESTDIR="/work/01234/username/class-software/" prefix="bedtools2/2.29.2" make install
The steps above will put the binaries in the folder:
/work/01234/username/class-software/bedtools2/2.29.2/bin
Please remember, these steps will vary from package to package and will likely only work as described for this specific package. If you choose, it is now safe to remove the source folder and tar ball downloaded from GitHub.
Write the Modulefile
Modules are a simple way to dynamically modify a user's environment such that
specific software packages can be used. For the example above, we only need the
user to load a gcc module first, then add the bedtools2 bin/
folder to their
path:
# Create a modulefiles directory where all modulefiles will go
$ mkdir -p /work/01234/username/class-software/modulefiles/
$ cd /work/01234/username/class-software/modulefiles/
$ pwd
/work/01234/username/class-software/modulefiles/
# Create a subdirectory and lua file for bedtools2, version 2.29.2
$ mkdir bedtools2/
$ touch bedtools2/2.29.2.lua
All modulefiles will go in the modulefiles
directory under a subfolder named
after the package. Modulefiles have the extension .lua
and are named after the
software version. Multiple .lua
files can exist in the same package
subdirectory, enabling the support of multiple versions of the same package.
The contents of 2.29.2.lua
could include:
local help_message = [[
This modulefile was prepared for the students taking A Class 101. Load this
modulefile to gain access to the bedtools2/2.29.2 package. Please note that
gcc is a prerequisite and must be loaded first.
Documentation: https://github.com/arq5x/bedtools2
Version 2.29.2
]]
help(help_message,"\n")
whatis("Name: bedtools2")
whatis("Version: 2.29.2")
whatis("Description: A powerful toolset for genome arithmetic")
whatis("URL: https://github.com/arq5x/bedtools2")
prepend_path("PATH", "/work/01234/username/class-software/bedtools2/2.29.2/bin")
prereq("gcc")
Don't forget to replace the PATH
near the end of that file with your work
directory. Please browse the /opt/apps/modulefiles/
directory on your TACC
system of choice to see many other examples of modulefiles, or read the
lmod documentation.
Change Permissions
Next, recursively adjust Linux permissions in the class-software/
folder so
that students with the same Unix group can see and access the software.
$ chmod g=u-w /work/01234/username/
$ chmod -R g=u-w /work/01234/username/class-software/
If you happen to be part of multiple Linux groups, you may also need to change
the group on the software folder to match to instructional allocation. The
group ID can be found in the
Portal by clicking on
the instructional allocation / project. For example, if the Unix group is
G-876543
:
$ chgrp G-876543 /work/01234/username/
$ chgrp -R G-876543 /work/01234/username/class-software/
Instructions to Use Class Modules
Finally, the following steps can be used to access and load the new modulefile, and use the installed bedtools2 software. These steps apply to both the instructor who built the software, as well as the students:
# Add the modulefile location to your modulepath:
$ module use /work/01234/username/class-software/modulefiles
# Save that modification so it only has to be done once
$ module save
# Print modulefile help text
$ module help bedtools2/2.29.2
# Load the new module
$ module load gcc
$ module load bedtools2/2.29.2
$ which bedtools
/work/01234/username/class-software/bedtools2/2.29.2/bin/bedtools
If you need help installing software or writing modulefiles, please submit a ticket through the TACC User Portal.
Return to the Overview