EESSI / software-layer

Software layer of the EESSI project
https://eessi.github.io/docs/software_layer
GNU General Public License v2.0
24 stars 49 forks source link

installing Lmod #6

Closed boegel closed 4 years ago

boegel commented 4 years ago

One of the first hurdles we have to take to get the software layer going on top of the compatibility layer is get Lmod installed. That sounds trivial, but it's a bit hairier than I though it would be...

Lmod is not packaged for Gentoo yet. One option is to contribute support for installing Lmod to Gentoo (which is probably the best thing long term, but probably not the easiest option).

We can install Lmod ourselves of course, probably as a part of the software layer, for example in a dedicated Lmod/ subdirectory (where we could also park Lmod caches, I guess).

I gave that a quick try, but hit a wall pretty quickly after doing the following:

# install lua-posix and Tcl (for tcl.h)
$ emerge dev-lua/luaposix
$ emerge dev-lang/tcl
$ curl -OL https://github.com/TACC/Lmod/archive/8.3.17.tar.gz
$ tar xfvz 8.3.17.tar.gz
$ cd Lmod-8.3.17/
$ ./configure --prefix /tmp/$USER/Lmod-test
...
checking for luac... /shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/bin/luac
checking for lua... /shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/bin/lua
checking for valid Lua version... 5.1
checking for lua modules: posix

Error: The follow lua module(s) are missing:  posix

You can not run Lmod without:  posix

ComputeCanada took a very different approach: they installed Lua & Lmod manually outside of Gentoo Prefix, but mainly to have a single Lmod installation they can share between the Nix & Gentoo Prefix based software stacks, which is not really relevant to us... See https://github.com/ComputeCanada/software-stack/issues/6 for more details.

boegel commented 4 years ago

The Lmod check for lua-posix fails because of this:

$ lua luaModuleAvailable posix
lua: .../gentoo-prefix-test/usr/share/lua/5.1/posix/init.lua:17: module 'bit32' not found:
        no field package.preload['bit32']
        no file './bit32.lua'
        no file '/shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/share/lua/5.1/bit32.lua'
        no file '/shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/share/lua/5.1/bit32/init.lua'
        no file '/shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/lib64/lua/5.1/bit32.lua'
        no file '/shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/lib64/lua/5.1/bit32/init.lua'
        no file '/usr/share/lua/5.1/bit32.lua'
        no file '/usr/share/lua/5.1/bit32/init.lua'
        no file './bit32.so'
        no file '/shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/lib64/lua/5.1/bit32.so'
        no file '/usr/lib64/lua/5.1/bit32.so'
        no file '/shared/maintainers/EESSI-pilot/gentoo-prefix-test/usr/lib64/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        .../gentoo-prefix-test/usr/share/lua/5.1/posix/init.lua:17: in main chunk
        [C]: in function 'require'
        luaModuleAvailable:3: in function 'main'
        luaModuleAvailable:10: in main chunk
        [C]: ?

That smells like a packaging problem in Gentoo to me...

@rtmclay Any thoughts on this?

boegel commented 4 years ago

Apparently it's a known issue, since a while...

https://bugs.gentoo.org/603812

ocaisa commented 4 years ago

Would bumping the lua version fix the problem, you could use lua 5.4 with a couple of patches, https://github.com/TACC/Lmod/issues/459

boegel commented 4 years ago

@ocaisa Gentoo defaults to Lua 5.1. Using 5.2 or 5.3 would definitely help for Lmod (bits32 is a builtin starting with Lua 5.2), but the Gentoo board for Lua doesn't look too promising to jump to 5.2 or newer, see https://packages.gentoo.org/packages/dev-lang/lua .

Easiest way out for now is probably to install Lua ourselves from source, using the tarball provided by Lmod (the lua-5.1.4.9.tar.bz2 from https://sourceforge.net/projects/lmod/files/)

wpoely86 commented 4 years ago

Do we need to have Lmod installed like this?

Having Lmod locally (with our own customization etc) makes more sense to me?

boegel commented 4 years ago

@wpoely86 That puts a bigger burden on sites who want to start using the software stack...

I think we can make the use of the Lmod installation we provide in the software layer optional though, and you should be able to leverage a local Lmod installation as long as it's sufficiently recent (which implies we should have a script that checks for compatibility). The init script we'll provide to set up your environment for EESSI could have a way of opting out of using the shipped Lmod installation, and could do a compatibility check of the local Lmod installation instead.

I haven't made up my mind yet whether we should use Tcl or Lua syntax for the module files we generate... Using Tcl could make sense to also let people who have a local Tmod installation to opt in easily, but it has the downside that Lmod needs to translate from Tcl to Lua internally (although that's low impact with Lmod 8.x). We could also consider generating module files with both Tcl & Lua of course, which would make Lmod totally ignore the Tcl modules.

wpoely86 commented 4 years ago

Yes, but I think most (if not all) distros that are used in a HPC space do have Lmod packaged? We can offer a Lmod preshipped but make sure we can use our own Lmod.

And in any case, I want to be able to have a custom SitePackage.lua locally.

I'm rooting for Lua modules but we can easily ship both?

ocaisa commented 4 years ago

I agree, we can do both and even place them in separate trees.

Regarding Lmod itself, we can bootstrap it in with EB (using https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/l/Lmod/Lmod-7.3.eb or an updated version of that) and make the init script clever enough to know if it needs it or not (since we already have all the required logic for that in our own bootstrap script).

Alan

On Fri, 3 Jul 2020 at 09:22, wpoely86 notifications@github.com<mailto:notifications@github.com> wrote:

Yes, but I think most (if not all) distros that are used in a HPC space do have Lmod packaged? We can offer a Lmod preshipped but make sure we can use our own Lmod.

And in any case, I want to be able to have a custom SitePackage.lua locally.

I'm rooting for Lua modules but we can easily ship both?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/EESSI/software-layer/issues/6#issuecomment-653395302, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA5JTNN5O5TGKVJTSRWEW7DRZWBLVANCNFSM4OPGT2IA.

-- Dr. Alan O'Cais E-CAM Software Manager Juelich Supercomputing Centre Forschungszentrum Juelich GmbH 52425 Juelich, Germany

Phone: +49 2461 61 5213 Fax: +49 2461 61 6656 E-mail: a.ocais@fz-juelich.demailto:a.ocais@fz-juelich.de WWW: http://www.fz-juelich.de/ias/jsc/EN



Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Volker Rieke Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt


lexming commented 4 years ago

There is an overlay with ebuilds for Lmod at https://data.gpo.zugaina.org/junkdrawer/app-admin/Lmod/ Those provide a nice starting point if we decide to install Lmod at the level of the Gentoo prefix

bedroge commented 4 years ago

This seems to work for me:

emerge --ask =dev-lua/luafilesystem-1.6.3
emerge --ask dev-lang/tcl
emerge --ask dev-lua/luaposix
emerge --ask dev-lua/bit32
emerge --ask app-admin/Lmod
boegel commented 4 years ago

I agree, we can do both and even place them in separate trees. Regarding Lmod itself, we can bootstrap it in with EB (using https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/l/Lmod/Lmod-7.3.eb or an updated version of that) and make the init script clever enough to know if it needs it or not (since we already have all the required logic for that in our own bootstrap script).

@ocaisa Can't install stuff with EasyBuild if there's no module tool, that's a chicken-egg situation. ;)

@bedroge dev-lua/bit32 didn't work for me, I wonder what I did wrong there... There must be some other step you did to get that to work?

bedroge commented 4 years ago

I guess that's because I had already added our overlay (which is a fork of CC, and includes this bit32):

https://github.com/EESSI/compatibility-layer#adding-eessi-overlay

ocaisa commented 4 years ago

You can, you can use an ancient standalone TCL script to start with.

On Fri, 3 Jul 2020, 16:45 Kenneth Hoste, notifications@github.com<mailto:notifications@github.com> wrote:

I agree, we can do both and even place them in separate trees. Regarding Lmod itself, we can bootstrap it in with EB (using https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/l/Lmod/Lmod-7.3.eb or an updated version of that) and make the init script clever enough to know if it needs it or not (since we already have all the required logic for that in our own bootstrap script).

@ocaisahttps://github.com/ocaisa Can't install stuff with EasyBuild if there's no module tool, that's a chicken-egg situation. ;)

@bedrogehttps://github.com/bedroge dev-lua/bit32 didn't work for me, I wonder what I did wrong there... There must be some other step you did to get that to work?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/EESSI/software-layer/issues/6#issuecomment-653580654, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA5JTNOH2BNTKKRENYUZBXLRZXVJXANCNFSM4OPGT2IA.



Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Volker Rieke Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt


bartoldeman commented 4 years ago

As @bedroge kind of discovered by seeing it in the fork of the repo I got this working (Lmod on top of Gentoo) before we moved to the separate installation.

The ebuilds are still in our repo although they may need to be updated a little: https://github.com/ComputeCanada/gentoo-overlay/tree/master/app-admin/Lmod https://github.com/ComputeCanada/gentoo-overlay/tree/master/dev-lua (for bit32 and luafilesystem) I was using lua 5.1.5 here.

bedroge commented 4 years ago

The installation issues are solved with this ebuild/PR (and some follow-ups) in the gentoo-overlay repo: https://github.com/EESSI/gentoo-overlay/pull/2

The automated installation of Lmod and some dependencies / other packages is done in this PR (still WIP): https://github.com/EESSI/compatibility-layer/pull/12

So I guess we can close this issue?

boegel commented 4 years ago

Lmod is included in compatibility layer now, so closing this...