Dave Barnett wrote:
> One suggestion I might make is that you do something similar to how
> we've done a few of our modules.
>
> 1. In the module file proj1, do setenv SYNOPSYS_VER "1999.10", and then
> just do module load Synopsys (i.e. don't specify a version here, use the
> default one supplied by the .version file).
> 2. Make your Synopsys/.version file look similar to this:
> #%Module1.0
> set ModulesVersion = "1999.05"
> if { [info exists env(SYNOPSYS_VER)] } {
> set ModulesVersion = $env(SYNOPSYS_VER)
> }
> [snip]
Hello, Dave.
There was another aspect to this scenario, which is "what happens
if someone UNLOADS a module that was loaded in proj1 rather than
just SWITCHING it?" This will also cause an "unload" or "switch"
operation on proj1 to bomb out with an error.
I think I've found a way to handle this (seems to work here) as
follows.
1. In "proj1", put the initial "setenv PROG_VER 1.0" type
statements into an "if" statement:
if [module-info mode load] {
setenv SYNOPSYS_VER 1999.10
setenv VCS_VER 5.0
}
2. Add an "if" statment around each "module load" statement:
if [info exists env(SYNOPSYS_VER)] {
module load Synopsys
}
Now, during a "module unload proj1", any "module load" statements
will be skipped if their environment variables aren't set. This
works for a "switch", as well.
As a note, I'd like to see modules handle these sorts of conditions
"automatically". Anyone else agree? R.K., are you taking any
feature requests at this time? :-)
At any rate, hope this helps someone with a similar need.
Cheers,
- Leo
----------------------------------------------------------------------
Leo Butler Senior Engineer
Brocade Communications Phone: (408) 487-8096
1901 Guadalupe Parkway Fax: (408) 487-8090
San Jose, CA 95131 mailto:lb...@br...
|