incorporate envssetup into Cactus option list

Issue #2397 new
Roland Haas created an issue

Currently, on clusters that use environment modules, simfactory uses the envsetup entry of the machine definition files to load modules required by the option list.

This ties together option list and machine definition file, making it hard to offer different “flavors” of the same machine.

It should be possible to instead use the information in envsetup in the Cactus option list. Since this implies that “make” needs to change its own environment the simplest way to achieve that is to have the top level Makefile load the environment then pass everything down one level:

  export ENV_VAR="somesetting" ; $(MAKE) -f Makefile.real $(MAKECMDGOALS)

or one can try something like wrapping two Makefiles in one

.PHONY: all

ifneq ($(MODULES_LOADED), yes)
    export ENV_VAR="dummy" ; make MODULES_LOADED=yes $(MAKECMDGOALS)

    echo "ENV_VAR is $$ENV_VAR"


which has no advantage other than saving one file, so seems not best way of doing this.

Comments (1)

  1. Roland Haas reporter

    @Steven R. Brandt points out that this envsetup will also have to be propagated to submit and run scripts. Likely requiring simfactory to parse the cfg file for envsetup.

  2. Log in to comment