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

error: RUSTFLAGS='-Ctarget-cpu=haswell' or later is required #2685

Open
pcarbonn opened this issue Dec 9, 2024 · 2 comments
Open

error: RUSTFLAGS='-Ctarget-cpu=haswell' or later is required #2685

pcarbonn opened this issue Dec 9, 2024 · 2 comments

Comments

@pcarbonn
Copy link

pcarbonn commented Dec 9, 2024

Crate name

m2csmt-0.1.2

Build failure link

https://docs.rs/crate/m2csmt/0.1.2/builds/1579956/x86_64-unknown-linux-gnu.txt

Additional details

My crate has the inari crate as a dependency. Inari requires an haswell CPU, and docs.rs raises the error above during the build. I configured .cargo/config.toml accordingly, but docs.rs seems to ignore it.

What can I do ?

@syphar
Copy link
Member

syphar commented Dec 10, 2024

I don't have much time to dig into how your package and inari interact, but here some points where you can start looking:

For these kind of errors it's always good to look into how the dependency itself builds the docs, it the build is successful. Specifically, you can look at the docs.rs metadata in the cargo.toml file and what features are activated for docs.

On top of that, there might be conditional compilation with #[cfg(docsrs)]. The interesting part is that the error you are seeing is actually inactive for docs: https://github.com/unageek/inari/blob/9e519ce47c9baa897bf11a735300ca4718a7a2a1/src/simd.rs

@pcarbonn
Copy link
Author

Thank you for your reply.

I still cannot make it work. I won't spend more time on this issue. One can use my m2csmt package after adding these lines to their .cargo/config.toml, and that seems OK to me for now:

[build]
rustflags = ["-C", "target-cpu=haswell"]
rustdocflags = ["-C", "target-cpu=haswell"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants