Correctly identify BLAS as ILP64 on Darwin#172
Draft
Feyorsh wants to merge 1 commit intoJuliaLinearAlgebra:mainfrom
Draft
Correctly identify BLAS as ILP64 on Darwin#172Feyorsh wants to merge 1 commit intoJuliaLinearAlgebra:mainfrom
Feyorsh wants to merge 1 commit intoJuliaLinearAlgebra:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On Darwin, depending on how a BLAS library was built it may have access to a copy of libBLAS from Apple's Accelerate framework through the dyld shared cache.
This is problematic for autodetecting whether the loaded BLAS is LP64 or ILP64, because symbols from Accelerate will "pollute" the namespace of symbols that
dlopencan probe for.I think it might be easier to show an example:
Notice how
isamax_appears to be defined inlibopenblas64_.dylibwhen doing thedlopencheck, but in reality it is defined in/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib.(This version of
libopenblas64_.dylibwas built as part of the Nix derivation for Julia and it directly links to the version of BLAS packaged in nixpkgs.)Note that while this issue appears to only be present on BLAS libraries from nixpkgs, I still believe this necessitates a fix in LBT.
Solution
I think the fix is simple, which is to try searching for ILP64 symbols first before the LP64 symbols (which will resolve, but they're not what we want). I suppose this could cause the opposite problem where someone's LP64 library is being misidentified as ILP64, but I'm not sure if that would ever happen in practice.