Skip to content

Commit 4d60913

Browse files
committed
Merge branch 'develop'
2 parents 4afdd37 + 38276d4 commit 4d60913

File tree

2 files changed

+91
-14
lines changed

2 files changed

+91
-14
lines changed

docs/installing-environment-modules-without-root-permissions.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Mac OS X system, together with Tcl on which it depends.
77
## Tcl
88

99
1. Go to <https://www.tcl-lang.org> and download the latest Tcl sources. At
10-
the time of writing, the latest available Tcl version was 8.6.14,
10+
the time of writing, the latest available Tcl version was 8.6.16,
1111
which can be downloaded from
12-
[here](https://prdownloads.sourceforge.net/tcl/tcl8.6.14-src.tar.gz).
13-
The remainder of these commands will assume Tcl v8.6.14 is being
12+
[here](https://prdownloads.sourceforge.net/tcl/tcl8.6.16-src.tar.gz).
13+
The remainder of these commands will assume Tcl v8.6.16 is being
1414
installed, you may need to adjust them accordingly.
1515

1616
1. Unpack the Tcl source tarball:
1717

1818
``` shell
19-
tar xfvz tcl8.6.14-src.tar.gz
19+
tar xfvz tcl8.6.16-src.tar.gz
2020
```
2121

2222
1. Pick a location where you will install Tcl. It should be a directory
@@ -27,12 +27,12 @@ Mac OS X system, together with Tcl on which it depends.
2727
the `configure` script using the `--prefix` option:
2828

2929
``` shell
30-
cd tcl8.6.14/unix
30+
cd tcl8.6.16/unix
3131
./configure --prefix=$HOME/.local/Tcl
3232
```
3333

3434
If you're building Tcl and Environment Modules on Mac, you should
35-
run `configure` in the `tcl8.6.14/macosx` directory instead.
35+
run `configure` in the `tcl8.6.16/macosx` directory instead.
3636
3737
1. Next, build Tcl using the `make` command. If the system you are
3838
building on has multiple cores, running make in parallel will speed
@@ -57,14 +57,14 @@ package, which requires Tcl.
5757
## Environment Modules
5858
5959
1. Download the latest source tarball for the Environment Modules tools
60-
from <https://modules.sourceforge.net>. At the time of writing, the
61-
latest available version is 5.4.0 which can be downloaded [from
62-
here](https://prdownloads.sourceforge.net/modules/modules-5.4.0.tar.gz).
60+
from <https://envmodules.github.io/modules/>. At the time of writing, the
61+
latest available version is 5.6.0 which can be downloaded [from
62+
here](https://github.com/envmodules/modules/releases/download/v5.6.0/modules-5.6.0.tar.gz).
6363
6464
1. Unpack the downloaded source tarball:
6565
6666
``` shell
67-
tar xfvz modules-5.4.0.tar.gz
67+
tar xfvz modules-5.6.0.tar.gz
6868
```
6969
7070
1. Configure the build, again use `--prefix` to specify where to
@@ -74,8 +74,8 @@ package, which requires Tcl.
7474
option:
7575

7676
``` shell
77-
cd modules-5.4.0
78-
./configure --prefix=$HOME/.local/environment-modules --with-tcl=$HOME/.local/Tcl/lib
77+
cd modules-5.6.0
78+
./configure --prefix=$HOME/.local/environment-modules --with-tcl=$HOME/.local/Tcl/lib --with-tclsh=$HOME/.local/Tcl/bin/tclsh8.6
7979
```
8080

8181
1. Build with `make`:
@@ -110,3 +110,8 @@ source $HOME/.local/environment-modules/init/bash
110110
!!! tip
111111
Add these three lines in your `.bashrc` file, that way they'll
112112
be executed every time you log in.
113+
114+
You may look at Environment Modules installation guide to learn how to [enable
115+
it in other shells](https://modules.readthedocs.io/en/stable/INSTALL.html#enable-modules-in-shells)
116+
or [adapt the configuration](https://modules.readthedocs.io/en/stable/INSTALL.html#configuration)
117+
to fit your needs.
Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,76 @@
11
# Interactive debugging of failing shell commands via `env.sh` and `cmd.sh` scripts
22

3-
!!! note
4-
*New in EasyBuild v5.0, more info soon...*
3+
When a build fails, EasyBuild provides a method of entering an interactive shell environment of the build to help debug the failure.
4+
5+
## Example
6+
7+
In the following demo, `bzip2-1.0.8.eb` is being built on an Ubuntu 25.04 (Plucky Puffin) system.
8+
This build uses the `SYSTEM` toolchain, which means that the OS default compiler is used - in this case `gcc` v13.3.0.
9+
The failure is because of an incompatibility between the older `binutils` (v2.37, as defined in the easyconfig) and the newer `gcc`.
10+
11+
```sh
12+
$ eb bzip2-1.0.8.eb --disable-trace
13+
== Temporary log file in case of crash /tmp/eb-lm7cwh0o/easybuild-1ujtoy7x.log
14+
== processing EasyBuild easyconfig /home/eb/easybuild-easyconfigs/easybuild/easyconfigs/b/bzip2/bzip2-1.0.8.eb
15+
== building and installing bzip2/1.0.8...
16+
== fetching files and verifying checksums...
17+
== creating build dir, resetting environment...
18+
== unpacking...
19+
== patching...
20+
== preparing...
21+
== configuring...
22+
== building...
23+
∙∙∙ Installing bzip2/1.0.8: building (6 out of 17 steps done) ━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━ 0:00:02
24+
25+
ERROR: Shell command failed!
26+
full command -> make -j 12 CC=gcc CFLAGS='-Wall -Winline -O3 -fPIC -g $(BIGFILES)'
27+
exit code -> 2
28+
called from -> 'build_step' function in /home/eb/easybuild-easyblocks/easybuild/easyblocks/generic/configuremake.py (line 382)
29+
working directory -> /dev/shm/eb/bzip2/1.0.8/system-system/bzip2-1.0.8
30+
output (stdout + stderr) -> /tmp/eb-lm7cwh0o/run-shell-cmd-output/make-f4_mwpk1/out.txt
31+
interactive shell script -> /tmp/eb-lm7cwh0o/run-shell-cmd-output/make-f4_mwpk1/cmd.sh
32+
33+
== ... (took 2 secs)
34+
== FAILED: Installation ended unsuccessfully: shell command 'make ...' failed with exit code 2 in build step for bzip2-1.0.8.eb (took 2 secs)
35+
== Results of the build can be found in the log file(s) /tmp/eb-lm7cwh0o/easybuild-bzip2-1.0.8-20250811.134024.IRIIQ.log
36+
== Summary:
37+
* [FAILED] bzip2/1.0.8
38+
39+
ERROR: Installation of bzip2-1.0.8.eb failed: "shell command 'make ...' failed with exit code 2 in build step for bzip2-1.0.8.eb
40+
```
41+
42+
In the output of the failed build we see:
43+
44+
* We see the full command being run when the failure occurred: `full command -> make -j 12 CC=gcc CFLAGS='-Wall -Winline -O3 -fPIC -g $(BIGFILES)'`
45+
* A link to a file containing the output of just the command being run: `output (stdout + stderr) -> /tmp/eb-lm7cwh0o/run-shell-cmd-output/make-f4_mwpk1/out.txt`
46+
* A link to the file that allows access to the interactive shell environment to debug the failure: `interactive shell script -> /tmp/eb-lm7cwh0o/run-shell-cmd-output/make-f4_mwpk1/cmd.sh`
47+
48+
The interactive shell can be entered by running the script mentioned.
49+
This will place you in an environment where you can debug the failed build:
50+
51+
* The previous command in the shell history (e.g. via arrow-up key) should be the failing command.
52+
* You can also explore the environment, such as checking environment variables or loaded modules.
53+
* You can repeat the last command to see the failure.
54+
55+
```sh
56+
$ /tmp/eb-lm7cwh0o/run-shell-cmd-output/make-f4_mwpk1/cmd.sh
57+
# Shell for the command: 'make -j 12 CC=gcc CFLAGS='-Wall -Winline -O3 -fPIC -g $(BIGFILES)''
58+
# Use command history, exit to stop
59+
eb-shell>
60+
```
61+
62+
Once you have finished debugging then exiting the shell will return you to your previous environment.
63+
64+
### `env.sh`
65+
66+
This file will contain the details of your environment:
67+
68+
1. Environment variables that were set.
69+
1. `bash` functions that were available.
70+
71+
This file will also contain the commands required to change to the working directory for the failed command and set the history and `PS1` for the session.
72+
73+
### `cmd.sh`
74+
75+
This file is run to enter the interactive environment.
76+
This will use the `env.sh` file to setup the environment.

0 commit comments

Comments
 (0)