environment modules issues

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
gostal
Level 1
Level 1
Posts: 17
Joined: Fri Sep 07, 2018 9:56 am

environment modules issues

Post by gostal » Thu Oct 11, 2018 9:26 am

There is a repo-package with binaries for environment modules so one does not have to download from SourceForge and build from scratch. The package name is: environment-modules version 4.1.1-1 and originates from Ubuntu.

There are, however, some issues:
  • To enable environment modules the file /usr/share/modules/init/$shell, has to be sourced. ($shell is the name of the shell). This is supposed to be done by /etc/profile which sources all *.sh-files in /etc/profile.d where the installation of the package puts the file modules.sh which sources the initialisation file in /usr/share/modules/init/. Assuming the shell is bash this works fine in text login because then bash reads /etc/profile but apparently /etc/profile is not read during graphical login, at least not in Mate, which leaves environment modules uninitialised when a terminal window is opened as neither bash reads /etc/profile as it is not invoked as a login shell.

    To remedy this I edited ~/.bashrc to directly source /etc/profile.d/modules.sh as ~/.bashrc is read by bash every time a terminal window is opened. Incidentally, this file is not read by bash when invoked as a login shell which is the reason why usually ~/.profile which also is read during text login sources ~/.bashrc. There is also a bunch of other *.sh-files in /etc/profile.d/ but I guess corresponding initialisations are not needed in a graphical terminal window otherwise I could of course just as easily have sourced /etc/profile in ~/.bashrc. Comments here would be appreciated. The question is if this is the best way to solve the problem. Is there perhaps some way to tell the graphical login process to read /etc/profile (or if that's not advised then only the initialisation file)? I imagine it would be good to have environment modules initialised once and for all instead of having to do it all the time.

    If not reading /etc/profile during graphical login is intended it would have been nice if the installation process issued a warning that environment modules might need initialisation as it took me a bit of investigation to find out what the trouble was.
  • Once initialised environment modules behaves a bit odd. If the querie command module avail is entered the response is the following:

    Code: Select all

    > module avail
    ---------------------------------- /usr/share/modules/modulefiles ----------------------------------
    dot  module-git  module-info  modules  null  use.own  
    
    ---------------------------------- /usr/share/modules/modulefiles ----------------------------------
    dot  module-git  module-info  modules  null  use.own  
    
    
    i.e. it looks like the command repeats itself invisibly. The same goes for a bunch of other commands that generate output. Other than that things seem to work. I don't know if this behaviour is caused by Mint system tweaks or if the same thing would happen on Ubuntu. Does anybody know what's going on here? If so, do tell.
Laptop: Latitude E6520, i3-2330M @ 2.20GHz, 4GB, Intel HD Graphics 3000, OS Mint 19 version Mate, Windows 7 Enterprise
Desktop: Dell Precision T5810, Xeon E5-1650 v4 @ 3.60GHz,72 GB, Radeon Pro WX 7100, OS OpenSuse Leap 42.3
Stockholm, Sweden

Post Reply

Return to “Software & Applications”