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

Floating point exception when linked with lld #22

Open
Yoshanuikabundi opened this issue Feb 26, 2022 · 3 comments
Open

Floating point exception when linked with lld #22

Yoshanuikabundi opened this issue Feb 26, 2022 · 3 comments

Comments

@Yoshanuikabundi
Copy link

lld is a linker developed by the LLVM team that (supposedly) has better performance than most system linkers. It is recommended for faster iterative builds by popular crates like Bevy and by the Rust performance book. chemfiles seems to crash with floating point exception (core dumped) when compiled with this linker.

To reproduce this, create a new project using lld:

cargo init chemfiles_lld
cd chemfiles_lld
mkdir .cargo
echo '[build]\nrustflags = ["-C", "link-arg=-fuse-ld=lld"]\n' > .cargo/config.toml

Then add chemfiles to Cargo.toml, add the example program in the readme to src/main.rs, and try to run with cargo run.

I understand that this is probably more effort than it's worth to fix, but I thought I'd raise it just in case someone was interested :) Thanks for chemfiles!

@Luthaf
Copy link
Member

Luthaf commented Feb 26, 2022

Thanks for the report! Which version of chemfiles are you using, and on which OS/CPU?

If you are using version 0.10.2, can you try to use the build-from-sources feature for chemfiles? i.e. use this in your Cargo.toml:

[dependencies]
chemfiles = {version = "0.10.2", features = ["build-from-sources"]}

This version is using pre-built version of the C++ library to cut down on compilation time, but this might have introduced the issue you are seeing.

@Yoshanuikabundi
Copy link
Author

Using chemfiles 0.10.2 on Arch Linux (AMD64).

With the build-from-sources feature, everything works! Thanks for the help, this is great.

@Yoshanuikabundi

This comment was marked as outdated.

@Luthaf Luthaf mentioned this issue Mar 4, 2022
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