JuliaMath / FFTW.jl

Julia bindings to the FFTW library for fast Fourier transforms
https://juliamath.github.io/FFTW.jl/stable
MIT License
273 stars 55 forks source link

Check and use only available FFTW libraries #278

Open devmotion opened 1 year ago

devmotion commented 1 year ago

I think it would be good to check if FFTW_jll and MKL_jll are actually available before trying to load them, as suggested in https://github.com/JuliaMath/FFTW.jl/issues/274#issuecomment-1618774373. I ran into this issue with a project that specified provider = "mkl" in a LocalPreferences.toml - precompilation will error on my MacBook since MKL is not available for Apple silicon. With this PR, FFTW will use FFTW_jll instead (if it's not available either an error is thrown) but present the user with the error message:

┌ FFTW [7a1cc6ca-52ef-59f5-83cd-3a7055c09341]
│  ┌ Error: Invalid provider setting "mkl"; valid settings include ["fftw"]
│  └ @ FFTW ~/.julia/dev/FFTW/src/providers.jl:23
└

Fixes https://github.com/JuliaMath/FFTW.jl/issues/274.

codecov[bot] commented 1 year ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (ef8fc5b) 73.08% compared to head (9db530c) 73.15%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #278 +/- ## ========================================== + Coverage 73.08% 73.15% +0.07% ========================================== Files 5 5 Lines 535 529 -6 ========================================== - Hits 391 387 -4 + Misses 144 142 -2 ``` | [Files](https://app.codecov.io/gh/JuliaMath/FFTW.jl/pull/278?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaMath) | Coverage Δ | | |---|---|---| | [src/providers.jl](https://app.codecov.io/gh/JuliaMath/FFTW.jl/pull/278?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaMath#diff-c3JjL3Byb3ZpZGVycy5qbA==) | `66.66% <60.00%> (+7.40%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/JuliaMath/FFTW.jl/pull/278/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaMath)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.