Expand ENV variables in RHS of option list options

Create issue
Issue #2312 resolved
Roland Haas created an issue

Updating the comet simfactory files once more after a module update, I find myself reminded that while we use the module command in envsetup we are not really reaping much of a benefit from it b/c we cannot use eg HDF5HOME in comet.cfg since those files, while they look like they may, are not actually parsed by make, and thus things like HDF5_DIR=$(HDF5HOME) do not work.

Thus one has to repeat the full path to eg HDF5 in HDF5_DIR etc. each time the modules are updated or risk that ini file and cfg get out of sync (irrespective of how happy / unhappy one is with having build information in the ini files to begin with).

Inspired by #332 a possible way to use them would be to not set HDF5_DIR in comet.cfg at all and instead add lines like:


to envsetup in comet.ini. While this works it requires sufficiently much knowledge of almost forgotten Cactus lore (namely that Cactus is supposed to used ENV variables as a sources of configure options) that I am feeling somewhat uncomfortable with it (at the very least one would have to add a comment to comet.cfg that HDF5_DIR is actually supplied by envsetup).

Thus branch rhaas/expenv adds explicit code to expand ENV variables of the form $(FOO) when the options are read in from config-info.

The branch can be found here: https://bitbucket.org/cactuscode/cactus/src/3894ff8129fafd018c2810173b0a9763e95b8612/?at=rhaas%2Fenvexp with the actually interesting commit being: https://bitbucket.org/cactuscode/cactus/commits/a5c6260e94ec23472db8de0cd9835bc4f2584af6

Comments (7)

  1. Roland Haas reporter

    @Steven R. Brandt and I had a some offline discussion and iterated over the best regular expression to use. In he course of this we realised that $(...) cannot be used b/c there is already an option list that relies on $(…) being expanded as only a make variable to set C_MAKE_DEPENDS using CC which is only known to make but not in the environment (usually).

  2. Log in to comment