Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocksdb fails to compile on x86 musl #12725

Closed
Kladki opened this issue Jun 2, 2024 · 5 comments
Closed

Rocksdb fails to compile on x86 musl #12725

Kladki opened this issue Jun 2, 2024 · 5 comments
Labels
Build build, makefile, cmake, scripts

Comments

@Kladki
Copy link

Kladki commented Jun 2, 2024

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

Rocksdb compiles.

Actual behavior

Fails to compile, with the following error. With this patch we managed to get the error down to this, but we are not sure how to proceed from there.

Steps to reproduce the behavior

  1. Try to compile Rocksdb on an x86 musl system
  2. See error
@hx235 hx235 added the Build build, makefile, cmake, scripts label Jun 3, 2024
@ajkr
Copy link
Contributor

ajkr commented Jun 4, 2024

There was a related patch, but I couldn't accept it yet because there were a bunch of test failures: #12515

@rhubner
Copy link
Contributor

rhubner commented Jun 17, 2024

Hello @Kladki,
Thank you for reporting this issue. To solve your problem, you need to compile RocksDB on modern CPUs for x32 target with flag PORTABLE=1

Detail answer:
RocksDB contains a lot of low-level optimisation with vector instructions. Most of this instruction doesn't work in 32bit mode. Unfortunatelly for example __BMI2__ flag is setup even when you are compiling RocksDB for x86(32bit) target.

For example _bzhi_u64 (declaration). As you can see few lines up, there is macro which enable _bzhi_u64 only on 64bit systems.

Radek

@Kladki
Copy link
Author

Kladki commented Jun 17, 2024

We already build with the portable flag,

@rhubner
Copy link
Contributor

rhubner commented Jun 18, 2024

Hello @Kladki,

Thank for quick response. I'm little confused with your build system. I can see that you use cmake to generate build configuration for ninja build. But it doesn't look like the ninja build is the one used for final compilation. It looks to me you are using our make file. Also if I check the build log you provided, I can still see the -march=native in Cflags flags.

In you PR, I don't understand why did you deleted cmake --build build link

I don't think you need the patch for util/math.h either. You just need to tell build system to compile with PORTABLE=1 on x86 architectures.

Radek

@Kladki
Copy link
Author

Kladki commented Jun 18, 2024 via email

@ajkr ajkr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build build, makefile, cmake, scripts
Projects
None yet
Development

No branches or pull requests

4 participants