Skip to content
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

Merged
merged 4 commits into from
May 29, 2017

Conversation

hartzell
Copy link
Contributor

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

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.
@hartzell hartzell changed the title Ensure Config.pm has correct setting for cc [WIP] Ensure Config.pm has correct setting for cc May 25, 2017
@hartzell
Copy link
Contributor Author

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.
@hartzell
Copy link
Contributor Author

This new bit sets cc and ld in Yet Another Config File (yafl?).

I'm using gcc as the linker, which seems to work fine.

@tgamblin, @adamjstewart -- is there a way to get at the linker that Spack uses? self.compiler.ld didn't do the right thing.

'print is_loaded(Config)', output=str)

match = '^cc *=>.*'
substitute = 'cc => \'{cc}\','.format(cc=self.compiler.cc)
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@adamjstewart
Copy link
Member

I have no idea how to get the equivalent of self.compiler.ld.

George Hartzell added 2 commits May 25, 2017 08:43
Does not start at beginning of line...

match = '^ld=.*'
substitute = "ld='{ld}'".format(ld=self.compiler.cc)
filter_file(match, substitute, config_heavy, **kwargs)
Copy link
Member

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.

Copy link
Contributor Author

@hartzell hartzell May 25, 2017

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?

@hartzell
Copy link
Contributor Author

@adamjstewart -- is there anything to be done for the codecov failure?

@hartzell hartzell changed the title [WIP] Ensure Config.pm has correct setting for cc Ensure Config.pm has correct setting for cc May 29, 2017
@adamjstewart
Copy link
Member

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 develop has increased its coverage since you branched off, the coverage will appear to have decreased, causing the errors you see.

@adamjstewart adamjstewart merged commit e3eaba8 into spack:develop May 29, 2017
@hartzell hartzell deleted the bug/perl-cc-config branch May 29, 2017 22:06
xavierandrade pushed a commit to xavierandrade/spack that referenced this pull request Jun 16, 2017
* 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...
EmreAtes pushed a commit to EmreAtes/spack that referenced this pull request Jul 10, 2017
* 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...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants