Using the "clean" argument when intel builds its module file

5 views
Skip to first unread message

Rob Groner

unread,
Apr 1, 2021, 12:30:22 PM4/1/21
to Spack
We've had numerous problems with the Lmod module file built by spack for the intel package, and it comes down to there being paths such as "/usr/local/bin" and "/usr/sbin" in the "Prepend_Path" value, so once you load the intel module, any previous module basically gets overriden.

I finally tracked down where all this was happening in the environment.py file after it is called by the intel.py file to source the "compilervars.sh" file.  The problem boils down to:
Before the compilervars.sh file is sourced, there are (for WHATEVER reason) already duplicates of /usr/local/bin and /usr/local/sbin in the PATH env var.  AFTER the compilervars.sh file is sourced, those duplicates are gone.  So the compilervars.sh file takes it upon itself to cleanup the PATH env var.  Then when the environment method from Spack comes along and diffs the before and after, it sees they are different (besides everything else that Intel adds to the PATH) and lets them through.

Bottom line....I found that utilizing the "clean=True" arg for environment.py:from_sourcing_file() resolves the problem (I hard coded it for testing purposes).  I cannot, however, find where I would put this arg, other than creating my own modified version of the intel.py file.  I see where the args are formed via _expand_fields(), which is labelled experimental, but can't determine where I would set it outside of the python source code itself.

Do I just need to extend the intel.py class to tell it to clean duplicates when creating its environment module file?

Thanks.

Rob


Reply all
Reply to author
Forward
0 new messages