Repository navigation
Expand file tree
/
Copy pathfml-1.0.eb_auto_prebuild
More file actions
94 lines (81 loc) · 4.34 KB
/
Copy pathfml-1.0.eb_auto_prebuild
File metadata and controls
94 lines (81 loc) · 4.34 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
82
83
84
85
86
87
88
89
90
91
92
93
94
easyblock = 'Tarball'
name = 'fml'
version = '1.0'
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'
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': ['.'],
}
# Sanity check code below could be used to build default fast modules- unfortunately
# the results reflect a different user environment (EB sanity environment)
# and so fml will detect changes and automatically rebuild them in the user environment.
# # 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])
#
# 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" + \
# "echo $MODULEPATH &>> %(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" + \
# " module reset\n" + \
# " echo $mod >> %(installdir)s/prebuild_log.out\n" + \
#
# " # Get the full module name from the default labelled by '(D)'\n" + \
# " # fullmod=$(module -t --redirect --default avail $mod 2>&1 | grep -v ':')\n" + \
# " echo noo &>> %(installdir)s/prebuild_log.out\n" + \
# " module -t --redirect --default avail $mod &>> %(installdir)s/prebuild_log.out\n" + \
# " echo nee&>> %(installdir)s/prebuild_log.out\n" + \
# " module -t --redirect --default avail $mod 2>&1 | grep -v ':' &>> %(installdir)s/prebuild_log.out\n" + \
# " echo na&>> %(installdir)s/prebuild_log.out\n" + \
# " fullmod=$(module -t --redirect --default avail $mod 2>&1 | grep -v ':')\n" + \
# " echo module --lmod load $fullmod &>> %(installdir)s/prebuild_log.out\n" + \
# " module --lmod load $fullmod &>> %(installdir)s/prebuild_log.out\n" + \
# " echo fml --global &>> %(installdir)s/prebuild_log.out\n" + \
# " fml --global &>> %(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'