Description of problem: After installing openmpi I just want to load the associated module. The load failed with a 'MODULEPATH' no set. Version-Release number of selected component (if applicable): environment-modules-3.2.10-6.fc20.x86_64 How reproducible: Always Steps to Reproduce: 1. modulecmd sh load mpi/openmpi-x86_64 Actual results: $ modulecmd bash load mpi/openmpi-x86_64 locate_module.c(245):ERROR:107: 'MODULEPATH' not set ModuleCmd_Load.c(208):ERROR:105: Unable to locate a modulefile for 'mpi/openmpi-x86_64' $ file /etc/modulefiles/mpi/openmpi-x86_64 /etc/modulefiles/mpi/openmpi-x86_64: ASCII text Expected results: The PATH env variable should be updated. Additional info:
Did you get a new shell after installing?
No, I just installed it then try to use it.
Yeah, that doesn't work.
*** Bug 1443124 has been marked as a duplicate of this bug. ***
(In reply to Orion Poplawski from comment #3) > Yeah, that doesn't work. Then it is a bug, at least IMO. There should be some default module path, so we don't have to strictly depend on shell profiles being loaded in. In bug 1443124 I mentioned: $ sudo bash -c '/usr/bin/modulecmd bash load existing-scl' locate_module.c(245):ERROR:107: 'MODULEPATH' not set It is really brittle to depend on env var; could we rather have some default path for modules hardwired directly into modulecmd? This is blocker for SCLs.
(In reply to Pavel Raiskup from comment #5) > It is really brittle to depend on env var; could we rather have some default > path for modules hardwired directly into modulecmd? This is blocker for > SCLs. Some hints to help you on this issue: * Starting version 4.0, module sources a Tcl rc file each time it is called. This rc file may contain the "hardwired" code you describe. * However this sourced-rc mechanism requires either the MODULERCFILE or MODULESHOME environment variables to be set, to locate the rc-file to source. So there are still dependencies to the environment context. I will ajust code for next feature release (4.1) to overcome that and use rc file location path configured at build time. * A workaround on the current module version you use may be to specify the modulefile to load as a full pathname.
With what is described on the above comment and the release of version 4.1.0 configuration could be done to handle this use case. This ticket can be closed.
(In reply to Xavier Delaruelle from comment #6) > * However this sourced-rc mechanism requires either the MODULERCFILE or > MODULESHOME environment variables to be set, to locate the rc-file to > source. So there are still dependencies to the environment context. I will > ajust code for next feature release (4.1) to overcome that and use rc file > location path configured at build time. Xavier, can you please send a link to patch implementing this?
Created attachment 1400145 [details] /usr/share/Modules/etc/rc I attach you an example "/usr/share/Modules/etc/rc" global RC file which will define MODULEPATH environment variable, based on /usr/share/Modules/init/.modulespath content, if this variable is found undefined or empty. With this global RC file, default MODULEPATH value is setup in case modulecmd is run through sudo: $ sudo modulecmd bash use MODULEPATH_modshare=/usr/share/modulefiles:1:/etc/modulefiles:1:/usr/share/Modules/modulefiles:1; export MODULEPATH_modshare; MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles; export MODULEPATH; test 0; Search path for module files (in search order): /usr/share/Modules/modulefiles /etc/modulefiles /usr/share/modulefiles