-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure Config.pm has correct setting for cc #4345
Conversation
Run a filter after install so that Config.pm records the compiler that Spack built the package with. If this isn't done, $Config{cc} will be set to Spack's cc wrapper script.
I've found another bit that I need to filter. Changed the title to WIP. |
This patch sets ld=gcc, which appears to work. I'm not sure if there's a good way to get at the ld that Spack uses.
This new bit sets I'm using @tgamblin, @adamjstewart -- is there a way to get at the linker that Spack uses? |
'print is_loaded(Config)', output=str) | ||
|
||
match = '^cc *=>.*' | ||
substitute = 'cc => \'{cc}\','.format(cc=self.compiler.cc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use "cc => '{cc}',"
and drop the backslashes, it makes it much easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
I have no idea how to get the equivalent of |
Does not start at beginning of line...
|
||
match = '^ld=.*' | ||
substitute = "ld='{ld}'".format(ld=self.compiler.cc) | ||
filter_file(match, substitute, config_heavy, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little known fact, filter_file
actually accepts a list of files to filter:
http://spack.readthedocs.io/en/latest/llnl.util.html#llnl.util.filesystem.filter_file
So if the match/substitute is the same for Config.pm
and Config_heavy.pl
, you could turn this from 4 filter_file
calls down to 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The matches aren't the same (I had a bug in one of the generations that I pushed). Config.pm
just needs 'cc' while Config_heavy.pl
needs (takes advantage of) '^cc'.
I could probably get away with the looser pattern in both files, but I'd prefer to be specific.
That ok?
@adamjstewart -- is there anything to be done for the codecov failure? |
Nope, you can ignore any codecov errors if the only files you modified were package files. We ignore code coverage for package files, but if |
* Ensure Config.pm has correct setting for cc Run a filter after install so that Config.pm records the compiler that Spack built the package with. If this isn't done, $Config{cc} will be set to Spack's cc wrapper script. * Also patch compilers Config_heavy.pl This patch sets ld=gcc, which appears to work. I'm not sure if there's a good way to get at the ld that Spack uses. * Clean up quoting * Fix pattern for Config.pm Does not start at beginning of line...
* Ensure Config.pm has correct setting for cc Run a filter after install so that Config.pm records the compiler that Spack built the package with. If this isn't done, $Config{cc} will be set to Spack's cc wrapper script. * Also patch compilers Config_heavy.pl This patch sets ld=gcc, which appears to work. I'm not sure if there's a good way to get at the ld that Spack uses. * Clean up quoting * Fix pattern for Config.pm Does not start at beginning of line...
Run a filter after install so that Config.pm records the compiler that Spack built the package with. If this isn't done, $Config{cc} will be set to Spack's cc wrapper script.
See #4338 for additional background.
Closes #4338