Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Oct 5, 2023
1 parent 9a3850b commit 9db530c
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions src/providers.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# Hardcoded list of supported platforms
# In principle, we could check FFTW_jll.is_available() and MKL_jll.is_available()
# but then we would have to load MKL_jll which we want to avoid (lazy artifacts!)
const platforms_providers = Dict(
Base.BinaryPlatforms.Platform("aarch64", "macos") => ("fftw",),
Base.BinaryPlatforms.Platform("aarch64", "linux"; libc = "glibc") => ("fftw",),
Base.BinaryPlatforms.Platform("aarch64", "linux"; libc = "musl") => ("fftw",),
Base.BinaryPlatforms.Platform("armv6l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("armv6l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("i686", "linux"; libc = "glibc") => ("fftw", "mkl"),
Base.BinaryPlatforms.Platform("i686", "linux"; libc = "musl") => ("fftw",),
Base.BinaryPlatforms.Platform("i686", "windows") => ("fftw", "mkl"),
Base.BinaryPlatforms.Platform("powerpc64le", "linux"; libc = "glibc") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "macos") => ("fftw", "mkl"),
Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "glibc") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "musl") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "freebsd") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "windows") => ("fftw", "mkl"),
)
const valid_fftw_providers = Base.BinaryPlatforms.select_platform(platforms_providers, Base.BinaryPlatforms.HostPlatform())
const valid_fftw_providers = let
# Hardcoded list of supported platforms
# In principle, we could check FFTW_jll.is_available() and MKL_jll.is_available()
# but then we would have to load MKL_jll which we want to avoid (lazy artifacts!)
platforms_providers = Dict(
Base.BinaryPlatforms.Platform("aarch64", "macos") => ("fftw",),
Base.BinaryPlatforms.Platform("aarch64", "linux"; libc = "glibc") => ("fftw",),
Base.BinaryPlatforms.Platform("aarch64", "linux"; libc = "musl") => ("fftw",),
Base.BinaryPlatforms.Platform("armv6l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("armv6l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "glibc", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("armv7l", "linux"; libc = "musl", call_abi = "eabihf") => ("fftw",),
Base.BinaryPlatforms.Platform("i686", "linux"; libc = "glibc") => ("fftw", "mkl"),
Base.BinaryPlatforms.Platform("i686", "linux"; libc = "musl") => ("fftw",),
Base.BinaryPlatforms.Platform("i686", "windows") => ("fftw", "mkl"),
Base.BinaryPlatforms.Platform("powerpc64le", "linux"; libc = "glibc") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "macos") => ("fftw", "mkl"),
Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "glibc") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "linux"; libc = "musl") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "freebsd") => ("fftw",),
Base.BinaryPlatforms.Platform("x86_64", "windows") => ("fftw", "mkl"),
)
Base.BinaryPlatforms.select_platform(platforms_providers, Base.BinaryPlatforms.HostPlatform())
end
if valid_fftw_providers === nothing
error("no valid FFTW library available")
end
Expand Down Expand Up @@ -76,7 +78,7 @@ end
if !FFTW_jll.is_available()
# more descriptive error message if FFTW is not available
# (should not be possible to reach this)
error("FFTW library cannot be loaded: please switch to the `mkl` provider for FFTW.jl")
@error("FFTW library cannot be loaded: Run `FFTW.set_provider!(\"mkl\")` to switch to MKL")
end
libfftw3[] = FFTW_jll.libfftw3_path
libfftw3f[] = FFTW_jll.libfftw3f_path
Expand Down Expand Up @@ -116,7 +118,7 @@ end
if !MKL_jll.is_available()
# more descriptive error message if MKL is not available
# (should not be possible to reach this)
error("MKL library cannot be loaded: please switch to the `fftw` provider for FFTW.jl")
@error("MKL cannot be loaded: Run `FFTW.set_provider!(\"fftw\")` to switch to the FFTW library")
end
libfftw3[] = MKL_jll.libmkl_rt_path
libfftw3f[] = MKL_jll.libmkl_rt_path
Expand Down

0 comments on commit 9db530c

Please sign in to comment.