-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfml-1.0beta.eb
More file actions
81 lines (63 loc) · 3.24 KB
/
Copy pathfml-1.0beta.eb
File metadata and controls
81 lines (63 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
easyblock = 'Tarball'
name = 'fml'
version = '1.0beta2'
homepage = 'https://github.com/cvsindelar/FastModLoad'
description = 'Fast Module Loader for Lmod-Based HPC Software Stacks'
toolchain = SYSTEM
source_urls = ['https://github.com/cvsindelar/FastModLoad/archive/refs/tags/']
sources = ['v%(version)s.tar.gz']
start_dir = 'FastModLoad-%(version)s'
# Modules for which we will pre-generate fast modules for global use:
_global_fast_mods = [
('R','4.4.1'),
('RELION','4.0.2'),
('RELION','5.0.0'),
]
# Pre-format _global_fast_mods into a string bash can understand
# Extract just the names from the (name, version) tuples in _global_fast_mods
_global_fast_mods_list = " ".join(["%s/%s" % (d[0], d[1]) for d in _global_fast_mods])
postinstallcmds = [
"type -t module || echo 'MODULE FUNCTION NOT FOUND'", # Diagnostic
##############################3
# Make sure the new file/folder group permissions are inherited
# so that fellow group members may also create global fast modules:
##############################3
"mkdir %(installdir)s/fml_prebuilds",
"chmod g+s %(installdir)s/fml_prebuilds",
]
sanity_check_paths = {
'files': ['fml.sh'],
'dirs': ['.'],
}
# This sanity check is also functional - it builds our default fast modules:
sanity_check_commands = [
##############################
# Now use 'fml' to build the list of global Fast Modules, above
# Note, global_mods only exists for the duration of the following single command string:
##############################
"printf '' > %(installdir)s/prebuild_log.out\n" + \
"global_mods=( %s )\n" % _global_fast_mods_list + \
"module --force unload fml\n" + \
"module reset\n" + \
"module list &>> %(installdir)s/prebuild_log.out\n" + \
"# Manually finish loading the fml module, since EasyBuild doesn't do it:\n" + \
"eval \"$( bash %(installdir)s/fml.sh - init )\" &>> %(installdir)s/prebuild_log.out\n" + \
"for mod in ${global_mods[@]} ; do\n" + \
" echo $mod >> %(installdir)s/prebuild_log.out\n" + \
" # Get the full module name from the default labelled by '(D)'\n" + \
" fullmod=$(module --redirect avail $mod 2>&1 | awk \"/\\(D\\)/ {print \\$(NF-1); exit}\")\n" + \
" echo fml --global $fullmod &>> %(installdir)s/prebuild_log.out\n" + \
" fml --global $fullmod &>> %(installdir)s/prebuild_log.out\n" + \
" module unload $fullmod &>> %(installdir)s/prebuild_log.out\n" + \
"done\n",
]
modluafooter = '''
local script = pathJoin(root, "fml.sh")
if myShellType() == "sh" then
execute {cmd=[[ eval "$(bash ]] .. script .. [[ ]] .. myFileName() .. [[ init)" ]], modeA={"load"}}
execute {cmd=[[ eval "$(bash ]] .. script .. [[ ]] .. myFileName() .. [[ exit)" ]], modeA={"unload"}}
else
execute {cmd="echo 'FML: sorry, this is not implemented for shell type ".. myShellType() .. "' >&2", modeA={"load"}}
end
'''
moduleclass = 'tools'