|
1 |
| -const valid_fftw_providers = if FFTW_jll.is_available() && MKL_jll.is_available() |
2 |
| - ("fftw", "mkl") |
3 |
| -elseif FFTW_jll.is_available() |
4 |
| - ("fftw",) |
5 |
| -elseif MKL_jll.is_available() |
6 |
| - ("mkl",) |
7 |
| -else |
| 1 | +# Hardcoded list of supported platforms |
| 2 | +# In principle, we could check FFTW_jll.is_available() and MKL_jll.is_available() |
| 3 | +# but then we would have to load MKL_jll which we want to avoid (lazy artifacts!) |
| 4 | +const platforms_providers = Dict( |
| 5 | + Base.BinaryPlatforms.Platform("aarch64", "macos") => ("fftw",), |
| 6 | + Base.BinaryPlatforms.Platform("aarch64", "linux"; libc = "glibc") => ("fftw",), |
| 7 | + Base.BinaryPlatforms.Platform("aarch64", "linux"; libc = "musl") => ("fftw",), |
| 8 | + Base.BinaryPlatforms.Platform("armv6l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",), |
| 9 | + Base.BinaryPlatforms.Platform("armv6l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",), |
| 10 | + Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",), |
| 11 | + Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",), |
| 12 | + Base.BinaryPlatforms.Platform("i686", "linux"; libc = "glibc") => ("fftw", "mkl"), |
| 13 | + Base.BinaryPlatforms.Platform("i686", "linux"; libc = "musl") => ("fftw",), |
| 14 | + Base.BinaryPlatforms.Platform("i686", "windows") => ("fftw", "mkl"), |
| 15 | + Base.BinaryPlatforms.Platform("powerpc64le", "linux"; libc = "glibc") => ("fftw",), |
| 16 | + Base.BinaryPlatforms.Platform("x86_64", "macos") => ("fftw", "mkl"), |
| 17 | + Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "glibc") => ("fftw",), |
| 18 | + Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "musl") => ("fftw",), |
| 19 | + Base.BinaryPlatforms.Platform("x86_64", "freebsd") => ("fftw",), |
| 20 | + Base.BinaryPlatforms.Platform("x86_64", "windows") => ("fftw", "mkl"), |
| 21 | +) |
| 22 | +const valid_fftw_providers = Base.BinaryPlatforms.select_platform(platforms_providers, Base.BinaryPlatforms.HostPlatform()) |
| 23 | +if valid_fftw_providers === nothing |
8 | 24 | error("no valid FFTW library available")
|
9 | 25 | end
|
10 | 26 |
|
|
56 | 72 |
|
57 | 73 | # If we're using fftw_jll, load it in
|
58 | 74 | @static if fftw_provider == "fftw"
|
| 75 | + import FFTW_jll |
| 76 | + if !FFTW_jll.is_available() |
| 77 | + # more descriptive error message if FFTW is not available |
| 78 | + # (should not be possible to reach this) |
| 79 | + error("FFTW library cannot be loaded: please switch to the `mkl` provider for FFTW.jl") |
| 80 | + end |
59 | 81 | libfftw3[] = FFTW_jll.libfftw3_path
|
60 | 82 | libfftw3f[] = FFTW_jll.libfftw3f_path
|
61 | 83 |
|
|
90 | 112 |
|
91 | 113 | # If we're using MKL, load it in and set library paths appropriately.
|
92 | 114 | @static if fftw_provider == "mkl"
|
| 115 | + import MKL_jll |
| 116 | + if !MKL_jll.is_available() |
| 117 | + # more descriptive error message if MKL is not available |
| 118 | + # (should not be possible to reach this) |
| 119 | + error("MKL library cannot be loaded: please switch to the `fftw` provider for FFTW.jl") |
| 120 | + end |
93 | 121 | libfftw3[] = MKL_jll.libmkl_rt_path
|
94 | 122 | libfftw3f[] = MKL_jll.libmkl_rt_path
|
95 | 123 | const _last_num_threads = Ref(Cint(1))
|
|
0 commit comments