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

Trouble running cargo test on mac OS #109

Open
jeremiah-corrado opened this issue Sep 28, 2024 · 3 comments
Open

Trouble running cargo test on mac OS #109

jeremiah-corrado opened this issue Sep 28, 2024 · 3 comments

Comments

@jeremiah-corrado
Copy link

I'm seeing the following build error when trying to run cargo test on Mac OS with V1.0.2:

    Updating crates.io index
error: failed to select a version for `kifmm-fftw-src`.
    ... required by package `kifmm-fftw-sys v0.2.0 (/Users/jerey/Documents/kifmm-review/kifmm/fftw-sys)`
versions that meet the requirements `^0.2.0` are: 0.2.0

the package `kifmm-fftw-src` links to the native library `fftw3`, but it conflicts with a previous package which links to `fftw3` as well:
package `kifmm-fftw-src v0.2.0 (/Users/jerey/Documents/kifmm-review/kifmm/fftw-src)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "fftw3"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `kifmm-fftw-src` which could resolve this conflict

Alternatively, when trying to run cargo test on main, I'm not seeing the above error, but I do get a number of build failures (when building kifmm-fftw-sys) along the following lines:

error[E0432]: unresolved import `green_kernels::types::EvalType`
 --> kifmm/src/fmm/builder.rs:4:52
  |
4 | use green_kernels::{traits::Kernel as KernelTrait, types::EvalType};
  |                     

Note: I'm on an M1 Mac, I'm on the latest release of Rust, and I've installed FFTW using Homebrew.

Any help diagnosing what might be going wrong here would be appreciated!

@skailasa
Copy link
Collaborator

Hi, this library builds and links a version of fftw, so you should avoid linking your own. The reason for this is we use custom build options for fftw, and only wrap small portions of the library.

@skailasa
Copy link
Collaborator

If you have fftw in your LD_LIBRARY_PATH, you should update it so that the homebrew version is not seen by Rust.

@skailasa
Copy link
Collaborator

PS: I would also recommend running cargo build/cargo build --release, before running cargo test.

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