Re: [Lmod-users] [EXTERNAL] Re: Opposite to pushenv?
A Lua based environment module system that reads TCL modulefiles.
Brought to you by:
rtmclay
|
From: Robert M. <mc...@ta...> - 2022-08-15 18:05:25
|
Glad that I was wrong about the variable and you found a way to get around
this issue.
Best,
Robert.
On Mon, Aug 15, 2022 at 11:51 AM Thompson, Matt (GSFC-610.1)[SCIENCE
SYSTEMS AND APPLICATIONS INC] <mat...@na...> wrote:
> Robert,
>
>
>
> The bad environment variable was:
>
>
>
> MACOSX_DEPLOYMENT_TARGET
>
>
>
> which I've had set in my .zshrc as:
>
>
>
> export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)
>
>
>
> for...a long time. I don't know what made Intel all of the sudden hate
> this, but fine.
>
>
>
> It turns out pushenv-ing that to "blank" made CMake not happy as CMake was
> setting an incomplete flag.
>
>
>
> So what I did instead was remove that line from my .zshrc and instead for
> GNU, say, I'm doing this:
>
>
>
> local sw_vers = subprocess("sw_vers -productVersion")
>
> pushenv("MACOSX_DEPLOYMENT_TARGET",sw_vers)
>
>
>
> Good thing here is when I `ml rm gcc`, the environment variable disappears!
>
>
>
> And since I tend to just copy-and-sed my modulefiles as I update
> compilers, the flag will go ever on.
>
>
>
> Thanks,
> Matt
>
>
>
> --
>
> Matt Thompson, SSAI, Ld Scientific Programmer/Analyst
>
> NASA GSFC, Global Modeling and Assimilation Office
>
> Code 610.1, 8800 Greenbelt Rd, Greenbelt, MD 20771
>
> Phone: 301-614-6712 Fax: 301-614-6246
>
> *http://science.gsfc.nasa.gov/sed/bio/matthew.thompson
> <http://science.gsfc.nasa.gov/sed/bio/matthew.thompson>*
>
>
>
> *From: *Robert McLay <mc...@ta...>
> *Date: *Monday, August 15, 2022 at 11:23 AM
> *To: *"Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]"
> <mat...@na...>
> *Cc: *lmod-users <lmo...@li...>
> *Subject: *[EXTERNAL] Re: [Lmod-users] Opposite to pushenv?
>
>
>
> I suspect that the problem is with the environment variable FPATH. Since
> macs use zsh as their default shell, messing with FPATH is bad as zsh
> depends on it unset not being equal to "". This what your pushenv function
> will do.
>
>
>
> Can't you just not set FPATH in your Fortran module? As far as I know, the
> Intel compiler doesn't use FPATH like it uses CPATH.
>
>
>
> If you really want do what you want, you will save FOO in another
> variable, say FOO2, then use unsetenv on FOO. Finally, use the execute
> function to reset FOO to FOO2 when the mode is unload.
>
>
>
> See the settarg module that comes with the Lmod source for examples of the
> execute function.
>
>
>
> Best,
>
> Robert
>
>
>
> On Mon, Aug 15, 2022, 06:57 Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS
> AND APPLICATIONS INC] via Lmod-users <lmo...@li...>
> wrote:
>
> Lmod List,
>
>
>
> A query. I've recently found that one of my environment variables that has
> been benign for years is all of the sudden causing issues with Intel
> Fortran on my Mac. So, fine, I thought maybe I can unset it when I load
> Intel and then "reset" it when I unload.
>
>
>
> But per the docs:
>
>
>
> *unsetenv* (“NAME”):
>
> unset the value associated with “NAME”. This command is a no-op when the
> mode is unload.
>
>
>
> So, I could "unset" the variable but never get it back.
>
>
>
> But a while back I "discovered" pushenv and its magic, so I am going to
> try:
>
>
>
> pushenv("FOO","")
>
>
>
> and see if that is enough to work around the issue I'm suddenly seeing
> (not sure if it's the value of FOO or the presence of FOO itself that
> causes the issue), but I wondered if there was some fancier/cooler lmod or
> Lua way of doing this?
>
>
>
> Lmod always seems to have a way of doing...everything I need :)
>
>
>
> Matt
>
>
>
> --
>
> Matt Thompson, SSAI, Ld Scientific Programmer/Analyst
>
> NASA GSFC, Global Modeling and Assimilation Office
>
> Code 610.1, 8800 Greenbelt Rd, Greenbelt, MD 20771
>
> Phone: 301-614-6712 Fax: 301-614-6246
>
> *http://science.gsfc.nasa.gov/sed/bio/matthew.thompson
> <https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fscience.gsfc.nasa.gov%2Fsed%2Fbio%2Fmatthew.thompson&data=05%7C01%7C%7Cdd91bd8866834d4894e208da7ee6d5c7%7C31d7e2a5bdd8414e9e97bea998ebdfe1%7C0%7C0%7C637961827144329773%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vTsVoXzrFgQ7pzGnMpJsT6yUHku%2FPXTM7Vu2rNvEvHg%3D&reserved=0>*
>
> _______________________________________________
> Lmod-users mailing list
> Lmo...@li...
> https://lists.sourceforge.net/lists/listinfo/lmod-users
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flmod-users&data=05%7C01%7C%7Cdd91bd8866834d4894e208da7ee6d5c7%7C31d7e2a5bdd8414e9e97bea998ebdfe1%7C0%7C0%7C637961827144329773%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J9P41XW6nELO6E9j9Z28A180tK0Urp%2FvsFaPxGZAhd4%3D&reserved=0>
> >> This message is from an external sender. Learn more about why this <<
> >> matters at https://links.utexas.edu/rtyclf
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinks.utexas.edu%2Frtyclf&data=05%7C01%7C%7Cdd91bd8866834d4894e208da7ee6d5c7%7C31d7e2a5bdd8414e9e97bea998ebdfe1%7C0%7C0%7C637961827144329773%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=WxZ%2FR8ev%2F8y%2BfqcrQJFVwUXGJ7fg0VUxS7apTFJMxIs%3D&reserved=0>.
> <<
>
>
--
Robert McLay, Ph.D.
Manager of Software Tools, HPC
mc...@ta...
|