Handle multi-flag compiler options on all types of options.#1966
Handle multi-flag compiler options on all types of options.#1966boegel merged 7 commits intoeasybuilders:developfrom
Conversation
tools/toolchain/compiler.py _set_compiler_flags should use nextend instead of nappend when setting the actual C/F FLAGS If there is a option that isn't a simple flag but multiple flags the use of self.variables.nappend(var, flags) results in things like -fPIC -['someflag', 'flag2'] Using self.variables.nextend(var, flags) instead gives the expected result of -fPIC -someflag -flag2
|
I'm looking into the failed tests to see if i can figure out a better solution |
9e1e115 to
7689007
Compare
compiler/cuda.py also needs to use nextend when setting it's CUDA_FLAGS.
7689007 to
0fa4c25
Compare
This is caused by the "Handle multi-flag compiler options on all types of options" commits. Have no idea why but it is coming from the _set_compiler_flags in toolchains/compiler/cuda.py
|
Please rewiew, and especially the "Handle weird bool" commit, and if someone can figure out why it happens in the first place (coming from the cuda.py nextend calls somehow) i'd be interested. I just can't figure out that part.... |
|
@akesandgren Can you clarify the context in which you were hitting this? I think there should be no need for this, since The It's clear that the way in which the toolchain supports deals with variables is quite complex, it should probably be thoroughly revised/simplified at some point... |
|
I was hitting it when trying to add a 'ieee' toolchain option (PR 1975), where the gcc definition is: So if you take PR 1975 by itself you will see a bunch of errors that this PR deals with. |
|
@akesandgren we already have various other options that relate to a list of flags rather than a single flag, and that's working fine? I don't see what's different about Where are you seeing errors pop up without this change? |
|
Hmm, wait, the precision options relate to lists of flags, but those are already handled via I'm adding a test for So, this change indeed makes sense. That leaves the |
|
@akesandgren OK, I think the problem is that using defining the I'll see if I can come up with a better fix, your change in |
|
Yeah, i thought it was suspicious. |
This reverts commit 8c09d6a.
…nhance tests to check it's handled correctly
|
@akesandgren I fixed the problem differently by making sure there's always a compiler flag defined for It's not airtight either, but at least I'm dealing with the root of the problem you ran into, I feel it's better than the change you made to |
…ifort, fix broken test
specify -fopenmp as general compiler flag for enabling OpenMP mode, enhance tests to check it's handled correctly
|
lgtm, thanks @akesandgren! |
tools/toolchain/compiler.py _set_compiler_flagsshould usenextendinstead of
nappendwhen setting the actual C/F FLAGSIf there is a option that isn't a simple flag but multiple flags the use of
self.variables.nappend(var, flags)results in things like-fPIC -['someflag', 'flag2']Using
self.variables.nextend(var, flags)instead gives the expected result of
-fPIC -someflag -flag2