forked from NOAA-EPIC/miniconda3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
miniconda3template.lua
52 lines (42 loc) · 1.51 KB
/
miniconda3template.lua
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
help([[
This module initializes and loads conda
]])
local pkgName = myModuleName()
local pkgVersion = myModuleVersion()
local pkgNameVer = myModuleFullName()
local shell=myShellType()
-- Uncomment a line below if myShellType() produces errors
-- local shell="sh"
family("python")
conflict(pkgName)
conflict("python")
conflict("intelpython")
local prefix = pathJoin("/lustre/",pkgName)
local base = pathJoin(prefix,pkgVersion)
local conda_file=pathJoin(base,"etc", "profile.d", "conda." .. shell)
local command="source " .. conda_file
local mpath = pathJoin(prefix,"modulefiles")
setenv("CONDA_ROOT", base)
setenv("CONDA_EXE", pathJoin(base,"condabin"))
setenv("CONDA_ENVS_DIRS", pathJoin(base,"envs"))
setenv("CONDA_PKGS_DIRS", pathJoin(base,"pkgs"))
setenv("CONDARC", pathJoin(base,".condarc"))
prepend_path("PATH", pathJoin(base, "bin"))
prepend_path("PATH", pathJoin(base, "condabin"))
prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib"))
prepend_path("MANPATH", pathJoin(base, "share", "man"))
prepend_path("MODULEPATH", mpath)
if mode() == "load" then
execute{cmd=command, modeA={"load"}}
elseif mode() == "unload" then
if shell == "csh" then
execute{cmd="unalias conda", modeA={"unload"}}
end
remove_path("PATH", pathJoin(base, "condabin"))
remove_path("PATH", pathJoin(base, "bin"))
remove_path("MANPATH", pathJoin(base, "share", "man"))
end
whatis("Name: ".. pkgName)
whatis("Version: " .. pkgVersion)
whatis("Category: Python")
whatis("Description: Miniconda3 Family")