|
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("armv7l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",), |
| 9 | + Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",), |
| 10 | + Base.BinaryPlatforms.Platform("i686", "linux"; libc = "glibc") => ("fftw", "mkl"), |
| 11 | + Base.BinaryPlatforms.Platform("i686", "linux"; libc = "musl") => ("fftw",), |
| 12 | + Base.BinaryPlatforms.Platform("i686", "windows") => ("fftw", "mkl"), |
| 13 | + Base.BinaryPlatforms.Platform("powerpc64le", "linux"; libc = "glibc") => ("fftw",), |
| 14 | + Base.BinaryPlatforms.Platform("x86_64", "macos") => ("fftw", "mkl"), |
| 15 | + Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "glibc") => ("fftw",), |
| 16 | + Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "musl") => ("fftw",), |
| 17 | + Base.BinaryPlatforms.Platform("x86_64", "freebsd") => ("fftw",), |
| 18 | + Base.BinaryPlatforms.Platform("x86_64", "windows") => ("fftw", "mkl"), |
| 19 | +) |
| 20 | +const valid_fftw_providers = Base.BinaryPlatforms.select_platform(platforms_providers, Base.BinaryPlatforms.HostPlatform()) |
| 21 | +if valid_fftw_providers === nothing |
8 | 22 | error("no valid FFTW library available")
|
9 | 23 | end
|
10 | 24 |
|
|
56 | 70 |
|
57 | 71 | # If we're using fftw_jll, load it in
|
58 | 72 | @static if fftw_provider == "fftw"
|
| 73 | + import FFTW_jll |
| 74 | + if !FFTW_jll.is_available() |
| 75 | + # more descriptive error message if FFTW is not available |
| 76 | + # (should not be possible to reach this) |
| 77 | + error("FFTW library cannot be loaded: please switch to the `mkl` provider for FFTW.jl") |
| 78 | + end |
59 | 79 | libfftw3[] = FFTW_jll.libfftw3_path
|
60 | 80 | libfftw3f[] = FFTW_jll.libfftw3f_path
|
61 | 81 |
|
|
90 | 110 |
|
91 | 111 | # If we're using MKL, load it in and set library paths appropriately.
|
92 | 112 | @static if fftw_provider == "mkl"
|
| 113 | + import MKL_jll |
| 114 | + if !MKL_jll.is_available() |
| 115 | + # more descriptive error message if MKL is not available |
| 116 | + # (should not be possible to reach this) |
| 117 | + error("MKL library cannot be loaded: please switch to the `fftw` provider for FFTW.jl") |
| 118 | + end |
93 | 119 | libfftw3[] = MKL_jll.libmkl_rt_path
|
94 | 120 | libfftw3f[] = MKL_jll.libmkl_rt_path
|
95 | 121 | const _last_num_threads = Ref(Cint(1))
|
|
0 commit comments