Standard conforming BLAS/LAPACK calls from C #85
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds wrappers using
iso_c_binding
andbind(c)
to allow standard conforming calls to BLAS/LAPACK functions from the SSIDS C++ code. See #4, and #4 (comment) for background, reasoning and alternatives.On
gfortran
, without link time optimization, this adds another function call and a little bit of stack management (https://godbolt.org/z/ooKb4cboM). Withoutbind(c)
, the stack management even reduces to just adding1
s for the hidden string length arguments that exposed the broken non-standard function calls in #4 in the first place (https://godbolt.org/z/cjfK7Gjv4). I'm not quite sure why the compiler does not do the same withbind(c)
, perhaps this is a missed optimization that can be leveraged in the future. This PR still proposes to go withbind(c)
for standard compliance and to avoid to continue relying on implementation-defined behavior.With these wrappers, the compiler flag workaround
-fno-optimize-sibling-calls
from #69 can be removed.