[Products] Don't dlopen libraries built for an incompatible ISA#233
[Products] Don't dlopen libraries built for an incompatible ISA#233giordano wants to merge 1 commit intoJuliaPackaging:masterfrom
Conversation
f01f186 to
dcba487
Compare
dcba487 to
7badc10
Compare
| using Base.BinaryPlatforms: Platform, platforms_match, set_compare_strategy! | ||
| @testset "Microarchitecture augmentation" begin | ||
| linux_x86_64 = Platform("x86_64", "linux") | ||
| linux_avx = Platform("x86_64", "linux"; march="avx") |
There was a problem hiding this comment.
I am not sure I would call this march. llc has mcpu which has names like opteron or x86-64-v3 and mattr which allows you to set feature sets.
avx is the name of a feature set. I think following hwcaps/linux feature level and only support:
x86-64-v1
x86-64-v2
x86-64-v3
x86-64-v4
Might be the best.
x-ref: JuliaLang/julia#42073
The logic for how to map x86-64-v3 to different compilers is defined here https://github.com/archspec/archspec-json/blob/020e418c9fe991a8155e53245fde4e4bdef08382/cpu/microarchitectures.json#L135-L191
There was a problem hiding this comment.
He, those names and sets are in Base: https://github.com/JuliaLang/julia/blob/c50361144ce783cecf65294e09d6e7cfdc73eb3f/base/binaryplatforms.jl#L598 changing them is quite a nightmare
There was a problem hiding this comment.
...Unless you're going to suggest to move the dictionary to https://github.com/JuliaPackaging/Yggdrasil/blob/master/platforms/microarchitectures.jl
There was a problem hiding this comment.
:/ How are we going to deal with adding new names? E.g. power9? I would prefer for these not to be dependent on Julia releases. So yes moving them there or MicroArchitectures.jl (better than JLLWrappers?) would be nice.
There was a problem hiding this comment.
I think we still depend on julia for features detection (and for powerpc that's completely missing).
There was a problem hiding this comment.
To be clear, what name do you suggest instead of march? I think we initially thought about microarchitecture but that was a bit mouthful.
I'm also mostly ok with revising the levels we have (especially if we move them to https://github.com/JuliaPackaging/Yggdrasil/blob/master/platforms/microarchitectures.jl so we don't need to worry about compatibility), but we'll also need to revise all the compiler flags and versions in
BinaryBuilderBase.jl/src/Platforms.jl
Lines 90 to 147 in 55c795d
There was a problem hiding this comment.
I think march is fine, I am more opposed to calling avx a micro-architecture since it is not, but a micro-architecture feature.
Yeah which is why I pointed out archspec, we could parse that JSON instead of maintaining the same thing in BB.
Exactly same thing as JuliaPackaging/BinaryBuilder.jl#1194 (which will eventually be based on this PR). I still need to add tests, once I figure out how
platforms_matchis supposed to compare platforms.At least I verified that with this PR and the one in BB I can build a library for AVX512 on an AVX2 system, without audit freaking out.