-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from JuliaMath/aa/ugh-oh-my-god
Wrap everything in a version check
- Loading branch information
Showing
6 changed files
with
110 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
julia 0.6.0-rc1 | ||
AbstractFFTs | ||
julia 0.6.0 | ||
AbstractFFTs 0.2.0 | ||
Compat 0.27.0 | ||
BinDeps 0.6.0 | ||
@osx Homebrew | ||
@windows WinRPM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,5 @@ | ||
__precompile__() | ||
|
||
module FFTW | ||
|
||
# Since nothing is exported from AbstractFFTs as long as the FFT functionality is | ||
# defined (or deprecated) in Base, we need to be very explicit about the things we | ||
# want to import | ||
import AbstractFFTs: Plan, ScaledPlan, | ||
fft, ifft, bfft, fft!, ifft!, bfft!, | ||
plan_fft, plan_ifft, plan_bfft, plan_fft!, plan_ifft!, plan_bfft!, | ||
rfft, irfft, brfft, plan_rfft, plan_irfft, plan_brfft, | ||
fftshift, ifftshift, | ||
rfft_output_size, brfft_output_size, | ||
plan_inv, normalization | ||
|
||
if VERSION >= v"0.7.0-DEV.602" | ||
if isdefined(Base, :FFTW) | ||
import Base.FFTW: dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct! | ||
else | ||
export dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct! | ||
end | ||
end | ||
|
||
const depsfile = joinpath(dirname(@__DIR__), "deps", "deps.jl") | ||
if isfile(depsfile) | ||
include(depsfile) | ||
else | ||
error("FFTW is not properly installed. Please run Pkg.build(\"FFTW\") ", | ||
"and restart Julia.") | ||
end | ||
|
||
# MKL provides its own FFTW | ||
fftw_vendor() = Base.BLAS.vendor() === :mkl ? :mkl : :fftw | ||
|
||
if fftw_vendor() === :mkl | ||
const libfftw_name = "libmkl_rt" | ||
const libfftwf_name = "libmkl_rt" | ||
elseif is_windows() | ||
const libfftw_name = "libfftw3" | ||
const libfftwf_name = "libfftw3f" | ||
if VERSION < v"0.7.0-DEV.602" | ||
import Base.FFTW | ||
else | ||
const libfftw_name = "libfftw3_threads" | ||
const libfftwf_name = "libfftw3f_threads" | ||
end | ||
|
||
# Threads must be initialized before any FFTW planning routine. | ||
# -- This initializes FFTW's threads support (defaulting to 1 thread). | ||
# If this isn't called before the FFTW planner is created, then | ||
# FFTW's threads algorithms won't be registered or used at all. | ||
# (Previously, we called fftw_cleanup, but this invalidated existing | ||
# plans, causing Base Julia issue #19892.) | ||
function __init__() | ||
stat = ccall((:fftw_init_threads, libfftw), Int32, ()) | ||
statf = ccall((:fftwf_init_threads, libfftwf), Int32, ()) | ||
if stat == 0 || statf == 0 | ||
error("could not initialize FFTW threads") | ||
end | ||
include("package.jl") # defines module FFTW | ||
end | ||
|
||
include("fft.jl") | ||
include("dct.jl") | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
__precompile__() | ||
|
||
module FFTW | ||
|
||
using Compat | ||
|
||
import AbstractFFTs: Plan, ScaledPlan, | ||
fft, ifft, bfft, fft!, ifft!, bfft!, | ||
plan_fft, plan_ifft, plan_bfft, plan_fft!, plan_ifft!, plan_bfft!, | ||
rfft, irfft, brfft, plan_rfft, plan_irfft, plan_brfft, | ||
fftshift, ifftshift, | ||
rfft_output_size, brfft_output_size, | ||
plan_inv, normalization | ||
|
||
if VERSION < v"0.7.0-DEV.986" | ||
import Base.FFTW: dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct! | ||
else | ||
export dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct! | ||
end | ||
|
||
const depsfile = joinpath(dirname(@__DIR__), "deps", "deps.jl") | ||
if isfile(depsfile) | ||
include(depsfile) | ||
else | ||
error("FFTW is not properly installed. Please run Pkg.build(\"FFTW\") ", | ||
"and restart Julia.") | ||
end | ||
|
||
# MKL provides its own FFTW | ||
fftw_vendor() = Base.BLAS.vendor() === :mkl ? :mkl : :fftw | ||
|
||
if fftw_vendor() === :mkl | ||
const libfftw_name = "libmkl_rt" | ||
const libfftwf_name = "libmkl_rt" | ||
elseif Compat.Sys.iswindows() | ||
const libfftw_name = "libfftw3" | ||
const libfftwf_name = "libfftw3f" | ||
else | ||
const libfftw_name = "libfftw3_threads" | ||
const libfftwf_name = "libfftw3f_threads" | ||
end | ||
|
||
# Threads must be initialized before any FFTW planning routine. | ||
# -- This initializes FFTW's threads support (defaulting to 1 thread). | ||
# If this isn't called before the FFTW planner is created, then | ||
# FFTW's threads algorithms won't be registered or used at all. | ||
# (Previously, we called fftw_cleanup, but this invalidated existing | ||
# plans, causing Base Julia issue #19892.) | ||
function __init__() | ||
stat = ccall((:fftw_init_threads, libfftw), Int32, ()) | ||
statf = ccall((:fftwf_init_threads, libfftwf), Int32, ()) | ||
if stat == 0 || statf == 0 | ||
error("could not initialize FFTW threads") | ||
end | ||
end | ||
|
||
include("fft.jl") | ||
include("dct.jl") | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters