Skip to content

[lumi-CrayPath] [package list]

lumi-CrayPath/0.1 (lumi-CrayPath-0.1.eb)

To access module help and find out for which stacks and partitions the module is installed, use module spider lumi-CrayPath/0.1.

EasyConfig:

easyblock = 'Bundle'

name =    'lumi-CrayPath'
version = '0.1'

homepage = 'https://docs.lumi-supercomputer.eu/'

whatis = [
    'Description: lumi-CrayPath adds the current CRAY_LD_LIBRARY_PATH to the front of LD_LIBRARY_PATH'
]

description = """
lumi-CrayPath adds the current CRAY_LD_LIBRARY_PATH to the front of LD_LIBRARY_PATH.

The module is not very sophisticated at this moment and will fail to properly
remove directories again when unloaded if directories appear in both
CRAY_LD_LIBRARYPATH and the unmodified LD_LIBRARY_PATH, but this does not seem
to happen in all current releases of the HPE Cray PE.

This module sets the environment variable _CRAYPATH_STORED_CRAY_LD_LIBRARY_PATH.
Tampering with that variable will cause silent failures of the module unload. It 
will fail to properly reset LD_LIBRARY_PATH.
"""

toolchain = SYSTEM

modluafooter = """

function split(pString, pPattern)
   local Table = {}  -- NOTE: use {n = 0} in Lua-5.0
   local fpat = "(.-)" .. pPattern
   local last_end = 1
   local s, e, cap = pString:find(fpat, 1)
   while s do
      if s ~= 1 or cap ~= "" then
     table.insert(Table,cap)
      end
      last_end = e+1
      s, e, cap = pString:find(fpat, last_end)
   end
   if last_end <= #pString then
      cap = pString:sub(last_end)
      table.insert(Table, cap)
   end
   return Table
end

if  mode() == 'load' or mode() == 'show' then

    local craypath = os.getenv( 'CRAY_LD_LIBRARY_PATH' ) or ''
    local craypath_table = split( craypath, ':' )

    -- Make sure the order is preserved.
    for counter = #craypath_table, 1, -1 do
        prepend_path( 'LD_LIBRARY_PATH', craypath_table[counter] )
    end

    setenv( '_CRAYPATH_STORED_CRAY_LD_LIBRARY_PATH', craypath )

elseif mode() == 'unload' then

    local craypath = os.getenv( '_CRAYPATH_STORED_CRAY_LD_LIBRARY_PATH' ) or ''
    local craypath_table = split( craypath, ':' )

    for counter, directory in ipairs( craypath_table )do
        prepend_path( 'LD_LIBRARY_PATH', directory )
    end

    setenv( '_CRAYPATH_STORED_CRAY_LD_LIBRARY_PATH', craypath )

end


"""


# this bundle serves as a compiler-only toolchain, so it should be marked as compiler (important for HMNS)
moduleclass = 'compiler'

[lumi-CrayPath] [package list]