tlk00 / BitMagic

BitMagic Library
http://bitmagic.io
Other
412 stars 48 forks source link

asm compilation error on aarch64/s390x/ppc64le #65

Closed luizirber closed 3 years ago

luizirber commented 3 years ago

Hi!

Today I published two Rust packages mentioned in #61 to crates.io: https://crates.io/crates/bitmagic https://crates.io/crates/bitmagic-sys (let me know if you want to be added as owner, BTW).

I'm using these packages in https://github.com/dib-lab/sourmash/pull/1221, and the detail is that we build Python wheels (the binary format for Python packages) for the manylinux-supported platforms: aarch64, s390x and ppc64le. But, when I tried to build the wheels, compilation failed with errors in https://github.com/tlk00/BitMagic/blob/682196399f4df0969ad6684444c72ccadcb95cb7/lang-maps/libbm/src/libbm_impl.cpp#L57 like

impossible constraint in 'asm':
     asm volatile("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (1));

I'm adding CI to test in these platforms in https://github.com/luizirber/bitmagic-rs/, and here is a similar error log: https://github.com/luizirber/bitmagic-rs/pull/2/checks?check_run_id=2153526751#step:4:435

Considering the surrounding code, it is failing due to none of these platforms having SIMD, which makes sense, but... I don't know how to disable these checks in the places I can control externally (cmake defines). Any tips/suggestions on how to achieve that?

Thanks!

P.S: saying "we don't support these platforms" is totally fine too, I kind of started building s390x and ppc64le wheels just because I tested it once and it worked for sourmash at that point. I do know about some ppc64le users, but the benefits we get from bitmagic are way too good and are making me considering dropping them.