Skip to content

Commit 211ac5f

Browse files
committed
Updating the first section of the second part of the tutorial.
1 parent 6a07631 commit 211ac5f

File tree

1 file changed

+60
-43
lines changed

1 file changed

+60
-43
lines changed

docs/2025-LUST/2_Using/2_01_troubleshooting.md

Lines changed: 60 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ The `make` command tripped over the compilation of `core.cpp` that failed becaus
6666

6767
OK fine, but now what? Can you spot something suspicious here?
6868
Wait a minute... Why is `make` using `/usr/bin/g++` for the compilation?!
69-
That's not where our toolchain compiler is installed,
70-
that's somewhere under `/opt/cray/pe/gcc`.
69+
Aren't we using `g++-13` these days?
70+
(Or before the `gcc-native` modules: That's not where our toolchain compiler is installed,
71+
that's somewhere under `/opt/cray/pe/gcc`.)
7172

7273
Let's see what `/usr/bin/g++` is:
7374

@@ -82,7 +83,7 @@ the base version, 7.1, is really from May 2, 2017, long before the Zen2 architec
8283
That could definitely explain why it doesn't know about the Zen2 architecture yet...
8384

8485
Your next step in this case should probably be figuring
85-
out why `/usr/bin/g++` is being used rather than just `g++`, which would
86+
out why `/usr/bin/g++` is being used rather than the `CC` compiler wrapper, which would
8687
result in using the right compiler version because EasyBuild sets up the build
8788
environment carefully.
8889

@@ -126,13 +127,13 @@ directory for successful installation, into the `easybuild` subdirectory.
126127
For example:
127128

128129
```
129-
/appl/lumi/SW/LUMI-21.12/L/EB/ncurses/6.2-cpeGNU-21.12/easybuild/easybuild-ncurses-6.2-20220302.110244.log
130+
/appl/lumi/SW/LUMI-24.03/L/EB/ncurses/6.4-cpeGNU-24.03/easybuild/easybuild-ncurses-6.4-20240912.211604.log
130131
```
131132

132133
### Last log
133134

134135
The `eb` command supports a handy little option that prints the location
135-
to the most recently updated build log. You can leverage this to quickly
136+
to the most recently updated build log: `--last-log`. You can leverage this to quickly
136137
open the build log of the last ***failed*** EasyBuild session in an editor:
137138

138139
```
@@ -232,15 +233,15 @@ version = '2.0.1'
232233
homepage = 'http://subread.sourceforge.net'
233234
description = "High performance read alignment, quantification and mutation discovery"
234235

235-
toolchain = {'name': 'PrgEnv-gnu', 'version': '21.10'}
236+
toolchain = {'name': 'PrgEnv-gnu', 'version': '24.02'}
236237

237238
# download from https://download.sourceforge.net/subread/subread-2.0.1-source.tar.gz
238239
sources = ['subread-%(version)s-source.tar.gz']
239240
checksums = ['d808eb5b1823c572cb45a97c95a3c5acb3d8e29aa47ec74e3ca1eb345787c17b']
240241

241242
start_dir = 'src'
242243

243-
# -fcommon is required to compile Subread 2.0.1 with GCC 10/11,
244+
# -fcommon is required to compile Subread 2.0.1 from GCC 10 onwards,
244245
# which uses -fno-common by default (see https://www.gnu.org/software/gcc/gcc-10/porting_to.html)
245246
buildopts = '-f Makefile.Linux CFLAGS="-fast -fcommon"'
246247

@@ -269,14 +270,14 @@ and that the EasyBuild-user module is loaded (unless you installed EasyBuild
269270
yourself):
270271

271272
```
272-
module load LUMI/21.12
273+
module load LUMI/24.03
273274
module load EasyBuild-user
274275
```
275276

276277
This will configure EasyBuild correctly for this exercise, though if you already have
277278
an existing EasyBuild user installation you may want to work in a different one
278279
by pointing `$EBU_USER_PREFIX` to the desired work directory before loading
279-
`LUMI/21.12`.
280+
`LUMI/24.03`.
280281

281282
Check your configuration via `eb --show-config`.
282283

@@ -305,8 +306,8 @@ the toolchain here...
305306
```
306307
$ eb subread.eb
307308
...
308-
ERROR: Failed to process easyconfig /pfs/lustrep3/users/kurtlust/easybuild-tutorial/Troubleshooting/subread.eb: Toolchain PrgEnv-gnu not found,
309-
available toolchains: ...
309+
ERROR: Failed to process easyconfig /pfs/lustrep4/users/kulust/easybuild-tutorial/subread.eb:
310+
Toolchain PrgEnv-gnu not found, available toolchains: ...
310311
...
311312
```
312313

@@ -330,6 +331,12 @@ the toolchain here...
330331
also built for the LUMI toolchains. Those are called `cpeCray`, `cpeGNU`, `cpeAOCC` and `cpeAMD`
331332
and are maintained by LUST and available via the LUMI repositories.
332333

334+
In this example, we should have used `cpeGNU` as the toolchain and not `PrgEnv-gnu`:
335+
336+
```python
337+
toolchain = {'name': 'cpeGNU', 'version': '24.02'}
338+
```
339+
333340
Note: Depending on how you use EasyBuild you may now first run into the problem of Exercise T.2 or
334341
first run into the problem covered by Exercise T.3.
335342

@@ -352,9 +359,10 @@ the easyconfig file?
352359
```
353360
$ eb subread.eb
354361
...
355-
== FAILED: Installation ended unsuccessfully (build directory: /run/user/XXXXXXXX/easybuild/build/Subread/2.0.1/cpeGNU-21.12): build failed (first 300 chars):
356-
Couldn't find file subread-2.0.1-source.tar.gz anywhere, and downloading it didn't work either...
357-
Paths attempted (in order): ...
362+
== FAILED: Installation ended unsuccessfully (build directory:
363+
/run/user/327000143/easybuild/build/Subread/2.0.1/cpeGNU-24.03): build failed
364+
(first 300 chars): Couldn't find file subread-2.0.1-source.tar.gz anywhere,
365+
and downloading it didn't work either... Paths attempted (in order): ...
358366
```
359367

360368
In this case, the problem is that the easyconfig file does not specify
@@ -377,7 +385,10 @@ the easyconfig file?
377385
(assuming you have set `EBU_USER_PREFIX`, otherwise replace `$EBU_USER_PREFIX` with
378386
`$HOME/EasyBuild`).
379387

380-
Or, we can change the easyconfig file to specify the location where
388+
The problem with this approach is that everybody who wants to use this EasyBuild recipe,
389+
would have to do that (unless we place the source file in the system source file repository).
390+
Of course it should be possible to do better.
391+
We can change the easyconfig file to specify the location where
381392
the easyconfig file can be downloaded from:
382393
```python
383394
source_urls = ['https://download.sourceforge.net/subread/']
@@ -393,7 +404,7 @@ the easyconfig file?
393404
```shell
394405
$ ls -lh $EBU_USER_PREFIX/sources/s/Subread
395406
total 23M
396-
-rw-rw-r-- 1 XXXXXXXX XXXXXXXX 23M Mar 30 16:08 subread-2.0.1-source.tar.gz
407+
-rw-rw-r-- 1 XXXXXXXX XXXXXXXX 23M May 5 19:24 subread-2.0.1-source.tar.gz
397408
```
398409

399410
---
@@ -411,32 +422,34 @@ the toolchain here...
411422

412423
??? success "(click to show solution)"
413424

414-
The installation fails because the easyconfig specifies that `PrgEnv-gnu/21.12`
425+
The installation fails because the easyconfig specifies that `cpeGNU/23.10`
415426
should be used as toolchain:
416427

417428
```shell
418429
$ eb subread.eb
419430
...
420431
ERROR: Build of /pfs/lustrep3/users/kurtlust/easybuild-tutorial/Troubleshooting/subread.eb failed (err: 'build failed (first 300 chars):
421-
No module found for toolchain: cpeGNU/21.10')
432+
No module found for toolchain: cpeGNU/23.10')
422433
...
423434
```
424435

425-
We don't have this `cpeGNU` version installed, but we do have `cpeGNU/21.12`:
436+
We don't have this `cpeGNU` version installed, but we do have `cpeGNU/24.03`:
426437

427438
```shell
428-
$ module avail cpeGNU/
429-
----- Infrastructure modules for the software stack LUMI/21.12 on LUMI-L -----
430-
cpeGNU/21.12
439+
$ module spider cpeGNU/
440+
----- Infrastructure modules for the software stack LUMI/24.03 on LUMI-L -----
441+
cpeGNU/24.03
431442
...
432443
```
433444

445+
(and obviously we should have known since we are installing in `LUMI/24.03`.)
446+
434447
So let's try using that instead.
435448

436449
Edit the easyconfig file so it contains this:
437450

438451
```python
439-
toolchain = {'name': 'cpeGNU', 'version': '21.12'}
452+
toolchain = {'name': 'cpeGNU', 'version': '24.03'}
440453
```
441454

442455
---
@@ -452,10 +465,12 @@ Can you fix the next problem you run into?
452465
The compilation fails, but the error message we see is incomplete due to
453466
EasyBuild truncating the command output (only the 300 first characters of the output are shown):
454467
```
455-
== FAILED: Installation ended unsuccessfully (build directory: /run/user/10012026/easybuild/build/Subread/2.0.1/cpeGNU-21.12): build failed
456-
(first 300 chars): cmd " make -j 256 -f Makefile.Linux CFLAGS="-fast -fcommon"" exited with exit code 2 and output:
457-
gcc -mtune=core2 -O3 -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\""2.0.1"\" -D_FILE_OFFSET_BITS=64 -fmessage-length=0
458-
-ggdb -fast -fcommon -I/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86 (took 4 secs)
468+
== FAILED: Installation ended unsuccessfully (build directory:
469+
/run/user/327000143/easybuild/build/Subread/2.0.1/cpeGNU-24.03): build failed (first 300 chars):
470+
cmd "make -j 16 -f Makefile.Linux CFLAGS="-fast -fcommon"" exited with exit code 2 and output:
471+
gcc -mtune=core2 -O3 -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\""2.0.1"\"
472+
-D_FILE_OFFSET_BITS=64 -fmessage-length=0 -ggdb -fast -fcommon
473+
-I/opt/cray/pe/libsci/24.03.0/GNU/12.3/x86_6 (took 5 secs)
459474
```
460475

461476
If you open the log file (e.g., with `view $(eb --last-log)`) and scroll to the end,
@@ -467,7 +482,7 @@ Can you fix the next problem you run into?
467482

468483
The easyconfig file hard specifies the `-fast` compiler flag via the `CFLAGS` argument to the build command:
469484
```python
470-
# -fcommon is required to compile Subread 2.0.1 with GCC 10,
485+
# -fcommon is required to compile Subread 2.0.1 from GCC 10 onwards,
471486
# which uses -fno-common by default (see https://www.gnu.org/software/gcc/gcc-10/porting_to.html)
472487
buildopts = '-f Makefile.Linux CFLAGS="-fast -fcommon"'
473488
```
@@ -476,7 +491,7 @@ Can you fix the next problem you run into?
476491
to hard specify compiler flags (certainly not incorrect ones).
477492
The comment above the `buildopts` definition makes it clear that the `-fcommon`
478493
flag *is* required though, because GCC 10 became a bit stricter by
479-
using `-fno-common` by default (and we're using GCC 11 in `cpeGNU/21.12`).
494+
using `-fno-common` by default (and we're using GCC 13 in `cpeGNU/24.03`).
480495
Note that we are using `-fcommon`
481496
as an escape mechanism here: it would be better to fix the source code
482497
and create a patch file instead.
@@ -502,20 +517,20 @@ Can you fix the next problem you run into?
502517

503518
Defining build environment...
504519

505-
export BLAS_INC_DIR='/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/include'
520+
export BLAS_INC_DIR='/opt/cray/pe/libsci/24.03.0/GNU/12.3/x86_64/include'
506521
...
507522
export CC='cc'
508523
export CFLAGS='-O2 -ftree-vectorize -fno-math-errno'
509524
...
510525
[build_step method]
511-
running command "make -j 256 -f Makefile.Linux CFLAGS="$CFLAGS -fcommon""
512-
(in /run/user/10012026/easybuild/build/Subread/2.0.1/cpeGNU-21.12/Subread-2.0.1/src)
526+
running command "make -j 16 -f Makefile.Linux CFLAGS="$CFLAGS -fcommon""
527+
(in /rXXXX/build/Subread/2.0.1/cpeGNU-24.03/Subread-2.0.1/src)
513528
...
514529
```
515530

516531
EasyBuild will launch the command
517532
```
518-
make -j 256 -f Makefile.Linux CFLAGS="$CFLAGS -fcommon"
533+
make -j 16 -f Makefile.Linux CFLAGS="$CFLAGS -fcommon"
519534
```
520535
in a shell where `CFLAGS` is defined and set to an appropriate value (determined by
521536
defaults in EasyBuild, settings in the EasyBuild configuration and settings in the
@@ -534,12 +549,14 @@ Don't give up now, try one last time and fix the last problem that occurs...
534549

535550
Now the installation itself works but the sanity check fails,
536551
and hence the module file does not get generated:
552+
537553
```
538554
$ eb subread.eb
539555
...
540-
== FAILED: Installation ended unsuccessfully (build directory: /run/user/10012026/easybuild/build/Subread/2.0.1/cpeGNU-21.12):
541-
build failed (first 300 chars): Sanity check failed: sanity check command featureCounts --version exited with code 255
542-
(output: featureCounts: unrecognized option '--version'
556+
== FAILED: Installation ended unsuccessfully (build directory:
557+
/run/user/327000143/easybuild/build/Subread/2.0.1/cpeGNU-24.03): build failed (first 300 chars):
558+
Sanity check failed: sanity check command featureCounts --version exited with code 255 (output:
559+
featureCounts: unrecognized option '--version'
543560
...
544561
...
545562
```
@@ -566,14 +583,14 @@ Don't give up now, try one last time and fix the last problem that occurs...
566583

567584
***Exercise T.6**** - Post-install check of the log file*
568585

569-
In the end, you should be able to install Subread 2.0.1 with the cpeGNU 21.12 toolchain by
586+
In the end, you should be able to install Subread 2.0.1 with the cpeGNU 24.03 toolchain by
570587
fixing the problems with the `subread.eb` easyconfig file.
571588

572589
Check your work by manually loading the module and checking the version
573590
via the `featureCounts` command, which should look like this:
574591

575592
```shell
576-
$ module load Subread/2.0.1-cpeGNU-21.12
593+
$ module load Subread/2.0.1-cpeGNU-24.03
577594
...
578595
$ featureCounts -v
579596
featureCounts v2.0.1
@@ -602,8 +619,8 @@ eb subread.eb -f
602619

603620
(the last line to force a rebuild).
604621

605-
Now go to the `$EBU_USER_PREFIX/SW/LUMI-21.12/L/Subread/2.0.1-cpeGNU-21.12/easybuild`
606-
(or `$HOME/EasyBuild/SW/LUMI-21.12/L/Subread/2.0.1-cpeGNU-21.12/easybuild`, depending on your configuration,) directory and open
622+
Now go to the `$EBU_USER_PREFIX/SW/LUMI-24.03/L/Subread/2.0.1-cpeGNU-24.03/easybuild`
623+
(or `$HOME/EasyBuild/SW/LUMI-24.03/L/Subread/2.0.1-cpeGNU-24.03/easybuild`, depending on your configuration,) directory and open
607624
the log file in your favourite editor. Search for the build step by searching for the string
608625
`INFO Starting build` and look carefully at how the program was actually build...
609626

@@ -632,7 +649,7 @@ the tutorial, but try to figure out what could be wrong first though...
632649
run into (yours may differ since this is a parallel build) is
633650

634651
```
635-
gcc -mtune=core2 -O3 -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\""2.0.1"\" -D_FILE_OFFSET_BITS=64 -fmessage-length=0 -ggdb -O2 -ftree-vectorize -fno-math-errno -fcommon -I/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/include -c -o core.o core.c
652+
gcc -mtune=core2 -O3 -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\""2.0.1"\" -D_FILE_OFFSET_BITS=64 -fmessage-length=0 -ggdb -O2 -ftree-vectorize -fno-math-errno -fcommon -I/opt/cray/pe/libsci/24.03.0/GNU/12.3/x86_64/include -c -o core.o core.c
636653
```
637654

638655
The flags that we added via `CFLAGS` are in there but only after some other flags.
@@ -658,7 +675,7 @@ the tutorial, but try to figure out what could be wrong first though...
658675
a regular way.
659676

660677
```
661-
pushd $EASYBUILD_BUILDPATH/Subread/2.0.1/cpeGNU-21.12
678+
pushd $EASYBUILD_BUILDPATH/Subread/2.0.1/cpeGNU-24.03
662679
cd subread-2.0.1-source
663680
cd src
664681
```
@@ -741,7 +758,7 @@ the tutorial, but try to figure out what could be wrong first though...
741758
directory) and check what happened now during the build step.
742759

743760
As we scroll through the output of the build step, we still see a few lines mentioning
744-
`gcc`... It turns out there is a second Makefile hidden in the subdirectory `longread-one` so we
761+
`-mtune=core2 -O3 -Wall`... It turns out there is a second Makefile hidden in the subdirectory `longread-one` so we
745762
need to edit that one too... So following the second approach we can do this with
746763

747764
```python

0 commit comments

Comments
 (0)