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

confusing build linker error #82

Open
mingley opened this issue May 3, 2024 · 2 comments
Open

confusing build linker error #82

mingley opened this issue May 3, 2024 · 2 comments

Comments

@mingley
Copy link

mingley commented May 3, 2024

Hopefully this is a simple solution to something basic I might have missed.

Trying to utilize the static feature to compile a project that consumes faiss-rs as a crate.

Example Cargo.toml

[dependencies]
...
faiss = { version = "0.12.1", features = ["static"] }
  • Run cargo build
   Compiling json v0.12.4
   Compiling jni v0.21.1
   Compiling faiss v0.12.1
error: could not find native static library `faiss`, perhaps an -L flag is missing?

error: could not compile `faiss-sys` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

I'm not super experienced here but, isn't the static library faiss what the static feature is supposed to build and provide in the first place? Am I missing something basic here? Sorry if this is a dumb question.

@Enet4
Copy link
Owner

Enet4 commented May 6, 2024

You are right that the crate would automatically build the native library. Maybe this quirk happens specifically in your system. Can you provide more details about your OS, Rust toolchain, and C++ compiler?

@mingley
Copy link
Author

mingley commented May 6, 2024

OS
- x86_64 GNU/Linux, a weird internal company specific flavor of RHEL8.

mingley@mingley-ld1 [ ~/dev/test ]$ rustc --version
rustc 1.78.0 (9b00956e5 2024-04-29)
mingley@mingley-ld1 [ ~/dev/test ]$ g++ --version
g++ (GCC) 11.2.0

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