-
Notifications
You must be signed in to change notification settings - Fork 0
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
Linker inherits CompilerWrapper (#20) #23
base: bom_master
Are you sure you want to change the base?
Conversation
@@ -29,9 +29,9 @@ def test_run(self, tool_box): | |||
config.artefact_store[ArtefactSet.OBJECT_FILES] = \ | |||
{'foo': {'foo.o', 'bar.o'}} | |||
|
|||
with mock.patch('os.getenv', return_value='-L/foo1/lib -L/foo2/lib'): |
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.
Was this test previously meant to mock LDFLAGS
or FFLAGS
?
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.
Leave this for now. I need a decision from the Fab devs if we can abandon support for environment variables (Fab should be free of that, any application ... like the Fab build system can decide to support this and provide the appropriate flags based on environment variables).
@@ -32,9 +32,9 @@ def test_run(tool_box): | |||
config.artefact_store[ArtefactSet.OBJECT_FILES] = \ | |||
{None: {'foo.o', 'bar.o'}} | |||
|
|||
with mock.patch('os.getenv', return_value='-L/foo1/lib -L/foo2/lib'): |
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.
Was this test previously meant to mock LDFLAGS
or FFLAGS
?
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.
Same, imho this should all go.
This was my work on issue #20 before I saw the new comment about reusing flags with mpi wrappers. Have a look and see if it would be useful in its current form. |
Seems to go in the right direction. But we need to support nested linker - e.g. an intel mpif90 wrapper would need to take a linker (which is now a CompilerWrapper) - linker-ifort as parameter. Then any flags from linker-ifort need to he used in the intel-mpif90 wrapper. I am not sure about the best way to implement this, here some tests with using isinstance:
So the first modification (to get_lib_flags) should work just fine - if we don't have a defintion (which could overwrite the base linker), and the 'compiler' is a linker, we call it to get the definition. The second modification needs a bit more work. For now I'd guess that any pre- and post-flags from the linker wrapper should wrap the linker ... that sounds convoluted. Assume linker1 adds
Is that enough to get you started? |
Luke will not have time to finish this |
Changes
Linker
to inheritCompilerWrapper
as in Issue #20