Skip to content

Commit 3b2aa24

Browse files
committed
R with a selection of packages for parallel computing.
1 parent 6d64b4b commit 3b2aa24

File tree

1 file changed

+386
-0
lines changed

1 file changed

+386
-0
lines changed
Lines changed: 386 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,386 @@
1+
#DOC This EasyConfig provides R compiled with the multithreaded LibSci libraries (hence the -OpenMP suffix)
2+
#DOC and with packages for parallel computing and other packages offered by Cray-R already installed.
3+
#DOC It also contains some packages for benchmarking.
4+
name = 'R'
5+
version = '4.5.1'
6+
versionsuffix = '-OpenMP'
7+
8+
local_bzip2_version = '1.0.8' # http://www.bzip.org/downloads.html
9+
local_cairo_version = '1.18.4' # https://www.cairographics.org/
10+
local_cURL_version = '8.11.1' # https://curl.haxx.se/download/
11+
local_gzip_version = '1.14' # https://ftp.gnu.org/gnu/gzip/
12+
local_libjpegturbo_version = '3.1.0' # https://github.com/libjpeg-turbo/libjpeg-turbo/releases
13+
local_libpng_version = '1.6.47' # http://www.libpng.org/pub/png/libpng.html (Not yet in EB 2025a when checking)
14+
local_libreadline_version = '8.2.13' # https://ftp.gnu.org/pub/gnu/readline/, also look at the patches
15+
local_libtiff_version = '4.7.0' # https://download.osgeo.org/libtiff/
16+
local_ncurses_version = '6.5' # https://ftp.gnu.org/pub/gnu/ncurses/
17+
local_Pango_version = '1.56.3' # http://ftp.gnome.org/pub/GNOME/sources/pango/
18+
local_PCRE2_version = '10.45' # https://github.com/PCRE2Project/pcre2/releases # Not yet in EB 2025a when checked for installation
19+
local_Tk_version = '8.6.16' # https://tcl.tk/
20+
local_XZ_version = '5.6.3' # https://tukaani.org/xz/
21+
local_zlib_version = '1.3.1' # https://zlib.net/
22+
23+
local_cURL_version = '8.11.1' # https://curl.haxx.se/download/
24+
25+
local_Zip_version = '3.0' # https://infozip.sourceforge.net/Zip.html
26+
local_UnZip_version = '6.0' # https://infozip.sourceforge.net/UnZip.html
27+
28+
homepage = 'https://www.r-project.org/'
29+
30+
whatis = [
31+
"Description: R is a free software environment for statistical computing and graphics."
32+
]
33+
34+
description = """
35+
This module provides a base R package, without many bells and whistles.
36+
A fully-featured R has many dependencies that do not all make sense on
37+
the compute nodes of LUMI, in particular when it comes to graphics.
38+
39+
Similarly, the build process as-is will not find a web browser nor
40+
PDF viewer as these are not currently available on regular compute
41+
nodes of LUMI.
42+
43+
This version of R links with the multithreaded version of
44+
Cray LibSci, so its linear algebra routines support multithreading
45+
by setting OMP_NUM_THREADS.
46+
47+
We have observed crashes in the linear algebra libraries when running
48+
multithreaded. It appears that setting OMP_STACKSIZE=256M,
49+
which is now done in the module, reduces those crashes.
50+
Using ulimit -s 300000 may also help. The problem has been discussed with
51+
HPE Cray, but a solution will come at the earliest with 25.03.
52+
"""
53+
54+
toolchain = {'name': 'cpeGNU', 'version': '25.03'}
55+
toolchainopts = {'openmp': True}
56+
57+
source_urls = ['https://cloud.r-project.org/src/base/R-%(version_major)s']
58+
sources = [SOURCE_TAR_GZ]
59+
checksums = [
60+
'b42a7921400386645b10105b91c68728787db5c4c83c9f6c30acdce632e1bb70', # R-4.4.1.tar.gz
61+
]
62+
# Note: R will not be able to tell which BLAS library was used as it is linked
63+
# in automatically and does not appear in BLAS_LIBS so that the code in the
64+
# configure script cannot figure out which BLAS is being used and set
65+
# r_blas properly.
66+
67+
builddependencies = [
68+
('buildtools', '%(toolchain_version)s', '', SYSTEM),
69+
]
70+
71+
dependencies = [
72+
# Base R
73+
('ncurses', local_ncurses_version),
74+
('libreadline', local_libreadline_version),
75+
('zlib', local_zlib_version),
76+
('bzip2', local_bzip2_version),
77+
('gzip', local_gzip_version),
78+
('XZ', local_XZ_version),
79+
('Info-ZIP', f'{local_Zip_version}-{local_UnZip_version}'), # Not really needed as anything in this module is also in the system-installed versions.
80+
# TODO: Add a zip/unzip command, though the system one might be OK as it only uses the commands.
81+
('PCRE2', local_PCRE2_version),
82+
('cURL', local_cURL_version), # for RCurl but also used by the base R package
83+
('X11', '%(toolchain_version)s'),
84+
('Tk', local_Tk_version), # for tcltk (base package)
85+
('libpng', local_libpng_version), # for plotting in R
86+
('libjpeg-turbo', local_libjpegturbo_version), # for plottting in R
87+
('LibTIFF', local_libtiff_version),
88+
('cairo', local_cairo_version),
89+
('Pango', local_Pango_version),
90+
# For extra packages
91+
('cURL', local_cURL_version),
92+
]
93+
94+
# Some R extensions (mclust, quantreg, waveslim for example) require the math library (-lm) to avoid undefined symbols.
95+
# Adding it to FLIBS makes sure it is present when needed.
96+
preconfigopts = 'export FLIBS="$FLIBS -lm" && '
97+
# We also need to ensure a single Cray LibSci library is used. It looks like R compiles
98+
# some files with OpenMP if it figures out that the compiler supports OpenMP, but does
99+
# not add the flag to the link options, resulting in problems with Cray LibSci. Hence
100+
# we enforce OpenMP and manually add it to the linker flags as that is not done by
101+
# the build process.
102+
preconfigopts += 'export LDFLAGS="-fopenmp $LDFLAGS" && '
103+
104+
configopts = "--with-pic --enable-threads --enable-R-shlib"
105+
# some recommended packages may fail in a parallel build (e.g. Matrix), and
106+
# we're installing them anyway below
107+
configopts += " --with-recommended-packages=no"
108+
109+
# specify that at least EasyBuild v3.5.0 is required,
110+
# since we rely on the updated easyblock for R to configure correctly w.r.t. BLAS/LAPACK
111+
easybuild_version = '3.5.0'
112+
113+
exts_default_options = {
114+
'source_urls': [
115+
'https://cran.r-project.org/src/contrib/Archive/%(name)s', # package archive
116+
'https://cran.r-project.org/src/contrib/', # current version of packages
117+
'https://cran.freestatistics.org/src/contrib', # mirror alternative for current packages
118+
],
119+
'source_tmpl': '%(name)s_%(version)s.tar.gz',
120+
}
121+
122+
# !! order of packages is important !!
123+
# packages updated on 4th January 2024
124+
exts_list = [
125+
# include packages that are part of the base installation of R,
126+
# both to make sure they are available (via sanity check),
127+
# and to be able to pass the check for required dependencies when installing extensions in parallel
128+
'base',
129+
'compiler',
130+
'datasets',
131+
'graphics',
132+
'grDevices',
133+
'grid',
134+
'methods',
135+
'parallel',
136+
'splines',
137+
'stats',
138+
'stats4',
139+
'tcltk',
140+
'tools',
141+
'utils',
142+
#
143+
# Do Rmpi first because of potential problems
144+
#
145+
#
146+
# Parallel compputing packages
147+
#
148+
('Rmpi', '0.7-3.3', {
149+
'easyblock': 'RPackage',
150+
'patches': ['Rmpi-%(version)s_Cray.patch'],
151+
'installopts': '--configure-args="--with-Rmpi-type=CRAY --with-Rmpi-include=$CRAY_MPICH_DIR/include --with-Rmpi-libpath=$CRAY_MPICH_DIR/lib" ',
152+
'checksums': ['bcce08e2a66092f55dfce318b83486e955cc081a2956feb22cc2f51f32fd3f1e'],
153+
}),
154+
('Rcpp', '1.1.0', {
155+
'checksums': ['84211c2520ba68c839b2e75761e97afc90baeebccbaf216ac8534fa2076cfb4d'],
156+
}),
157+
('codetools', '0.2-20', {
158+
'checksums': ['3be6f375ec178723ddfd559d1e8e85bfeee04a5fbaf9f53f2f844e1669fea863'],
159+
}),
160+
('RUnit', '0.4.33.1', {
161+
'checksums': ['8528fa3ba8d04a6e71783f01ba3e1163b5900c6b3c2bc81bad2349e220197f05'],
162+
}),
163+
('tinytest', '1.4.1', {
164+
'checksums': ['f6fc13887d096ba444fb722ef34cc88e079fc18be9668ffead1ba586a30b1c74'],
165+
}),
166+
('backports', '1.5.0', {
167+
'checksums': ['0d3ed9db8f1505e88967f48d669b2a257e0c6b7e6320ea64b946c1bd40897ca2'],
168+
}),
169+
('rlang', '1.1.6', {
170+
'checksums': ['18544c876f4e18ec554edecc308362a52fbc7e0805c4794cf59bcc4d0b57f330'],
171+
}),
172+
('parallelly', '1.45.1', {
173+
'checksums': ['6b5d3c0487fd8f9b05d98077c08919dc282bc9046c305efe49b34487ffbf485d'],
174+
}),
175+
('iterators', '1.0.14', {
176+
'checksums': ['cef3075a0930e1408c764e4da56bbadd4f7d14315809df8f38dd51f80ccc677b'],
177+
}),
178+
('foreach', '1.5.2', {
179+
'checksums': ['56338d8753f9f68f262cf532fd8a6d0fe25a71a2ff0107f3ce378feb926bafe4'],
180+
}),
181+
('doParallel', '1.0.17', {
182+
'checksums': ['b96a25ad105a654d70c7b4ca27290dc9967bc47f4668b2763927a886b178abd7'],
183+
}),
184+
('doMPI', '0.2.2', {
185+
'checksums': ['68a45715690f50ebb121ee868634ff269e8f9636599b8dd8f601bf714fa81c2a'],
186+
}),
187+
('snow', '0.4-4', {
188+
'checksums': ['84587f46f222a96f3e2fde10ad6ec6ddbd878f4e917cd926d632f61a87db13c9'],
189+
}),
190+
('snowfall', '1.84-6.3', {
191+
'checksums': ['2641932b01041e34b7afb1261f649755b4c8d6560080e0e2ee549ffdf3b8b143'],
192+
}),
193+
('doSNOW', '1.0.20', {
194+
'checksums': ['917cabed166aa2d1ec291691c17e1e3d344e858543e1682e3a442cc0c504bbb8'],
195+
}),
196+
('base64url', '1.4', {
197+
'checksums': ['1d058f138660e9155ebb331d7a2561e2541ee3321b8da90f6c41fd8dcc122c58'],
198+
}),
199+
('brew', '1.0-10', {
200+
'checksums': ['4181f7334e032ae0775c5dec49d6137eb25d5430ca3792d321793307b3dda38f'],
201+
}),
202+
('checkmate', '2.3.2', {
203+
'checksums': ['7255732d6c2da51204128a910e8c0d05246324a0402fca4d0d99433af40a88e3'],
204+
}),
205+
('data.table', '1.17.8', {
206+
'checksums': ['17f24496d548914fdac2b8ed00c7272f2e191ee32eb6bb8336f9beb6691330e0'],
207+
}),
208+
('fs', '1.6.6', {
209+
'checksums': ['57d3a0844e2fec28e6fe9901d18e07d32a437dfe43c4b547757eb07360f5850a'],
210+
}),
211+
('cli', '3.6.5', {
212+
'checksums': ['8ebe3146e66a285d8ad6ddcff87e2a9790ea7c9cdfce7fdd8bf13095fa459679'],
213+
}),
214+
('glue', '1.8.0', {
215+
'checksums': ['c86f364ba899b8662f5da3e1a75f43ae081ab04e0d51171d052356e7ee4b72a0'],
216+
}),
217+
('lifecycle', '1.0.4', {
218+
'checksums': ['ada4d3c7e84b0c93105e888647c5754219a8334f6e1f82d5afaf83d4855b91cc'],
219+
}),
220+
('pkgconfig', '2.0.3', {
221+
'checksums': ['330fef440ffeb842a7dcfffc8303743f1feae83e8d6131078b5a44ff11bc3850'],
222+
}),
223+
('vctrs', '0.6.5', {
224+
'checksums': ['43167d2248fd699594044b5c8f1dbb7ed163f2d64761e08ba805b04e7ec8e402'],
225+
}),
226+
('hms', '1.1.3', {
227+
'checksums': ['e626f4c60af46efd53ea631b316a103e089470d8fd63c0e0c0efb99364990282'],
228+
}),
229+
('prettyunits', '1.2.0', {
230+
'checksums': ['f059f27e2a5c82e351fe05b87ad712f7afc273c651450453f59d99af5deeacea'],
231+
}),
232+
('R6', '2.6.1', {
233+
'checksums': ['59c6eba8b1b912eb7e104f65053235604be853425ee67c152ac4e86a1f2073b4'],
234+
}),
235+
('crayon', '1.5.3', {
236+
'checksums': ['3e74a0685541efb5ea763b92cfd5c859df71c46b0605967a0b5dbb7326e9da69'],
237+
}),
238+
('progress', '1.2.3', {
239+
'checksums': ['ea2b079b894de85c3ab12088c9c52aec06432245047a961d5b4b8aa6889f9276'],
240+
}),
241+
('rappdirs', '0.3.3', {
242+
'checksums': ['49959f65b45b0b189a2792d6c1339bef59674ecae92f8c2ed9f26ff9e488c184'],
243+
}),
244+
('stringi', '1.8.7', {
245+
'checksums': ['0526decdcd41b7c42278aca96945394c2cb66ba6fdd47fd917b5d3d38ed5c8c6'],
246+
}),
247+
('withr', '3.0.2', {
248+
'checksums': ['0a3a05f493d275cca4bf13c8c1b95a1a4eed7f83b2493f41fde02ce3fc92c1a3'],
249+
}),
250+
('digest', '0.6.37', {
251+
'checksums': ['82c4d149994b8a4a9af930f5a8e47420829935abed41f3f9030e94b6a48f0321'],
252+
}),
253+
('batchtools', '0.9.17', {
254+
'checksums': ['b6e1dd54e8b70c2bf38d2ad1884f6b60fc74c1100f910f46724aa723c0749be6'],
255+
}),
256+
('globals', '0.18.0', {
257+
'checksums': ['8fa3bdafff38cc5997f9e7235c8f8359825ed8f9a0ec06c6fe75c9f798ed9fec'],
258+
}),
259+
('listenv', '0.9.1', {
260+
'checksums': ['422aaf487b91c6512b83c05536f8dac255db79b16ee85254acc59a3fda8c1c3b'],
261+
}),
262+
('future', '1.67.0', {
263+
'checksums': ['f8cb84095c5b5eaf0d2e33ba513982ba3d4b3a95928c3b353bd3be00ef569497'],
264+
}),
265+
('future.apply', '1.20.0', {
266+
'checksums': ['f8cee7e7a7d61aaad9cfecc12a38e8673b1899cd789f274224f2d40c3fbfaa1e'],
267+
}),
268+
('future.batchtools', '0.12.2', {
269+
'checksums': ['0b5adeaecc6636038afddf7d4c6edd5ffa54c4ce396f7f2b48db6b23483a94b1'],
270+
}),
271+
#
272+
# Some other popular packages available in Cray-R
273+
#
274+
('lattice', '0.22-7', { # Dependency for Matrix and others
275+
'checksums': ['400fa62b95e90410d52a36cee2ddeb025dd49695e55fe3db709fe60886bff9f7'],
276+
}),
277+
('Matrix', '1.7-3', { # Also dependency for survival
278+
'checksums': ['6642e9db8cddf32a051972fd5a634bf7edbdc925c5c2d139bf71e92df00fb44e'],
279+
}),
280+
('MASS', '7.3-65', { # Dependency for class
281+
'checksums': ['b07ef1e3c364ce56269b4a8a7759cc9f87c876554f91293437bb578cfe38172f'],
282+
}),
283+
('class', '7.3-23', {
284+
'checksums': ['4d1adb12eae045f15641516d795177dd1d3074c0a86ac633000507c4822891f1'],
285+
}),
286+
('foreign', '0.8-90', {
287+
'checksums': ['1dc6798002a50b9014227a2d20c0c2450fe6feb991a4a0b3bee36c0ee779a196'],
288+
}),
289+
('KernSmooth', '2.23-26', {
290+
'checksums': ['b465bdac197f7faa787e625412ae03d1b7c2c134b1c924cfeb775faf9c4da73e'],
291+
}),
292+
('nlme', '3.1-168', { # Dependency for mgcv
293+
'checksums': ['23b78468344cb6775dee5e0d9c8133032d64f08ebaba20776508a0443a897362'],
294+
}),
295+
('mgcv', '1.9-3', { # Needs nlme
296+
'checksums': ['43f0ccdba176890a1d7bbe9a0a0859222e1fbcc97064c6e6ad7a3f545fd82f1d'],
297+
}),
298+
('nnet', '7.3-20', {
299+
'checksums': ['8f33e17e0eb161cfbc1bfee4875baa23c66fcdba8215a64a63402b099db2b555'],
300+
}),
301+
('rpart', '4.1.24', {
302+
'checksums': ['4ab169a764d9857d299313aae0e7764bcea9220576e537cf165d4f8117e72f29'],
303+
}),
304+
('spatial', '7.3-18', {
305+
'checksums': ['cc46693d69745af8ec95b557e7a8ee4e1865df69dc0d25723629fd8e9ea43055'],
306+
}),
307+
('survival', '3.8-3', { # Needs Matrix
308+
'checksums': ['dcab05a57d37a561c7426f6213d49852dc4f462180dd28b5325ff4b6a5e59915'],
309+
}),
310+
#
311+
# Some benchmarking packages and their dependencies not yet included above.
312+
#
313+
('fansi', '1.0.6', { # Dependency for bench
314+
'checksums': ['ea9dc690dfe50a7fad7c5eb863c157d70385512173574c56f4253b6dfe431863'],
315+
}),
316+
('utf8', '1.2.6', { # Dependency for bench
317+
'checksums': ['4589f8b72291329e70b7f3a8c20f2feb4e7764eebad2e6976bc9a3eee7686ce9'],
318+
}),
319+
('pillar', '1.11.0', { # Dependency for bench
320+
'checksums': ['33451d2e5bee4ef327ae97df87259b67fc8174299d8030805c1fb01fbd0e5a11'],
321+
}),
322+
('profmem', '0.7.0', { # Dependency for bench
323+
'checksums': ['16efc5f13f4b78919c9d51c07acf62c051e0e3830ae3cc32c596f8daf569c3cb'],
324+
}),
325+
('magrittr', '2.0.3', { # Dependency for bench
326+
'checksums': ['a2bff83f792a1acb801bfe6330bb62724c74d5308832f2cb6a6178336ace55d2'],
327+
}),
328+
('tibble', '3.3.0', { # Dependency for bench, benchmarkme
329+
'checksums': ['7f4c439f11b1aca4a45923d8d76f90fbab4e01acf0ba7ad0c38c3a7f22fee192'],
330+
}),
331+
('bench', '1.1.4', {
332+
'checksums': ['b822f5b7648deecc6b516dcca4e932ce92e65eb166b997b04355218aceb1d083'],
333+
}),
334+
('microbenchmark', '1.5.0', {
335+
'checksums': ['3d1e92a9206811ad128b28795d20a0d31da5f0c29ea7f1caaf1194ed3e49765f'],
336+
}),
337+
('SuppDists', '1.1-9.9', { # Random number generators used by the commonly used R-benchmark-25.R script
338+
'checksums': ['7fbc0881948841bed1915cd5b998164167b1a265da6d955a8e85a1fcb3dea926'],
339+
}),
340+
('generics', '0.1.4', { # Dependency for bemchmarkme via dplyr
341+
'checksums': ['bbe95a097792d38fc3b7e677738af1b95b66ea5e5017e33b8beac6a6088d0801'],
342+
}),
343+
('tidyselect', '1.2.1', { # Dependency for bemchmarkme via dplyr
344+
'checksums': ['169e97ba0bbfbcdf4a80534322751f87a04370310c40e27f04aac6525d45903c'],
345+
}),
346+
('dplyr', '1.1.4', { # Dependency for bemchmarkme
347+
'checksums': ['cf730414d5d4ab387b4e9890a4b1df9d17a3903488e8da8df1cf2e11e44558cb'],
348+
}),
349+
('curl', '6.4.0', { # Dependency for bemchmarkme via httr
350+
'checksums': ['3bb4dbf892d2c3b4449d67553f2b3b31d9fa23c71fa6af0a287930ae8377ecdb'],
351+
}),
352+
('jsonlite', '2.0.0', { # Dependency for bemchmarkme via httr
353+
'checksums': ['75eb910c82b350ec33f094779da0f87bff154c232e4ae39c9896a9b89f3ac82d'],
354+
}),
355+
('mime', '0.13', { # Dependency for bemchmarkme via httr
356+
'checksums': ['7132834cf3c3388eff12bad376d69fbcf8275acc37d36c290e59174fe3c7f3eb'],
357+
}),
358+
('sys', '3.4.3', { # Dependency for bemchmarkme via askpass via openssl via httr
359+
'checksums': ['051e7332e3074db826efef9059067721864f9d70adc55bbcae3a72e5ae83913a'],
360+
}),
361+
('askpass', '1.2.1', { # Dependency for bemchmarkme via openssl via httr
362+
'checksums': ['6c2106a74c44a748f2cea795d9686e27a0058a90debcfd8558b62b06aec0c7dd'],
363+
}),
364+
('openssl', '2.3.3', { # Dependency for bemchmarkme via httr
365+
'checksums': ['b6b709a98dc3de47ec59adc234d8f0864c4f5b31c5e65478ec5e49c80ba7bf59'],
366+
}),
367+
('httr', '1.4.7', { # Dependency for bemchmarkme
368+
'checksums': ['1555e6c2fb67bd38ff11b479f74aa287b2d93f4add487aec53b836ff07de3a3a'],
369+
}),
370+
('stringr', '1.5.1', { # Dependency for bemchmarkme
371+
'checksums': ['a4adec51bb3f04214b1d8ef40d3a58949f21b1497cbeaf2ba552e0891eef45de'],
372+
}),
373+
('benchmarkmeData', '1.0.4', { # Dependency for bemchmarkme
374+
'checksums': ['6e0768db1c783d2fa84d5214f3d8024dc9c69c7cc4d108059fa652fcd4949bd8'],
375+
}),
376+
('benchmarkme', '1.0.8', {
377+
'checksums': ['1d7100e001a355afc83815b1b698466135f4512c53528c324d13013b3c475f61'],
378+
}),
379+
]
380+
381+
# Set OMP_STACKSIZE to avoid crashes in LibSci
382+
modextravars = {
383+
'OMP_STACKSIZE': '256M',
384+
}
385+
386+
moduleclass = 'lang'

0 commit comments

Comments
 (0)