@@ -56,7 +56,7 @@ function plan_r2r end
5656# # FFT: Implement fft by calling fftw.
5757
5858const version = VersionNumber (split (unsafe_string (cglobal (
59- (:fftw_version ,libfftw3), UInt8)), [' -' , ' ' ])[2 ])
59+ (:fftw_version ,libfftw3[] ), UInt8)), [' -' , ' ' ])[2 ])
6060
6161# # Direction of FFT
6262
@@ -141,39 +141,39 @@ alignment_of(A::FakeArray) = Int32(0)
141141@exclusive function export_wisdom (fname:: AbstractString )
142142 f = ccall (:fopen , Ptr{Cvoid}, (Cstring,Cstring), fname, :w )
143143 systemerror (" could not open wisdom file $fname for writing" , f == C_NULL )
144- ccall ((:fftw_export_wisdom_to_file ,libfftw3), Cvoid, (Ptr{Cvoid},), f)
144+ ccall ((:fftw_export_wisdom_to_file ,libfftw3[] ), Cvoid, (Ptr{Cvoid},), f)
145145 ccall (:fputs , Int32, (Ptr{UInt8},Ptr{Cvoid}), " " ^ 256 , f) # no NUL, hence no Cstring
146- ccall ((:fftwf_export_wisdom_to_file ,libfftw3f), Cvoid, (Ptr{Cvoid},), f)
146+ ccall ((:fftwf_export_wisdom_to_file ,libfftw3f[] ), Cvoid, (Ptr{Cvoid},), f)
147147 ccall (:fclose , Cvoid, (Ptr{Cvoid},), f)
148148end
149149
150150@exclusive function import_wisdom (fname:: AbstractString )
151151 f = ccall (:fopen , Ptr{Cvoid}, (Cstring,Cstring), fname, :r )
152152 systemerror (" could not open wisdom file $fname for reading" , f == C_NULL )
153- if ccall ((:fftw_import_wisdom_from_file ,libfftw3),Int32,(Ptr{Cvoid},),f)== 0 ||
154- ccall ((:fftwf_import_wisdom_from_file ,libfftw3f),Int32,(Ptr{Cvoid},),f)== 0
153+ if ccall ((:fftw_import_wisdom_from_file ,libfftw3[] ),Int32,(Ptr{Cvoid},),f)== 0 ||
154+ ccall ((:fftwf_import_wisdom_from_file ,libfftw3f[] ),Int32,(Ptr{Cvoid},),f)== 0
155155 error (" failed to import wisdom from $fname " )
156156 end
157157 ccall (:fclose , Cvoid, (Ptr{Cvoid},), f)
158158end
159159
160160@exclusive function import_system_wisdom ()
161- if ccall ((:fftw_import_system_wisdom ,libfftw3), Int32, ()) == 0 ||
162- ccall ((:fftwf_import_system_wisdom ,libfftw3f), Int32, ()) == 0
161+ if ccall ((:fftw_import_system_wisdom ,libfftw3[] ), Int32, ()) == 0 ||
162+ ccall ((:fftwf_import_system_wisdom ,libfftw3f[] ), Int32, ()) == 0
163163 error (" failed to import system wisdom" )
164164 end
165165end
166166
167167@exclusive function forget_wisdom ()
168- ccall ((:fftw_forget_wisdom ,libfftw3), Cvoid, ())
169- ccall ((:fftwf_forget_wisdom ,libfftw3f), Cvoid, ())
168+ ccall ((:fftw_forget_wisdom ,libfftw3[] ), Cvoid, ())
169+ ccall ((:fftwf_forget_wisdom ,libfftw3f[] ), Cvoid, ())
170170end
171171
172172# Threads
173173
174174@exclusive function set_num_threads (nthreads:: Integer )
175- ccall ((:fftw_plan_with_nthreads ,libfftw3), Cvoid, (Int32,), nthreads)
176- ccall ((:fftwf_plan_with_nthreads ,libfftw3f), Cvoid, (Int32,), nthreads)
175+ ccall ((:fftw_plan_with_nthreads ,libfftw3[] ), Cvoid, (Int32,), nthreads)
176+ ccall ((:fftwf_plan_with_nthreads ,libfftw3f[] ), Cvoid, (Int32,), nthreads)
177177end
178178
179179# pointer type for fftw_plan (opaque pointer)
@@ -187,9 +187,9 @@ const NO_TIMELIMIT = -1.0 # from fftw3.h
187187
188188# only call these when fftwlock is held:
189189unsafe_set_timelimit (precision:: fftwTypeDouble ,seconds) =
190- ccall ((:fftw_set_timelimit ,libfftw3), Cvoid, (Float64,), seconds)
190+ ccall ((:fftw_set_timelimit ,libfftw3[] ), Cvoid, (Float64,), seconds)
191191unsafe_set_timelimit (precision:: fftwTypeSingle ,seconds) =
192- ccall ((:fftwf_set_timelimit ,libfftw3f), Cvoid, (Float64,), seconds)
192+ ccall ((:fftwf_set_timelimit ,libfftw3f[] ), Cvoid, (Float64,), seconds)
193193@exclusive set_timelimit (precision, seconds) = unsafe_set_timelimit (precision, seconds)
194194
195195# Array alignment mod 16:
@@ -210,9 +210,9 @@ unsafe_set_timelimit(precision::fftwTypeSingle,seconds) =
210210 convert (Int32, convert (Int64, pointer (A)) % 16 )
211211else
212212 alignment_of (A:: StridedArray{T} ) where {T<: fftwDouble } =
213- ccall ((:fftw_alignment_of , libfftw3), Int32, (Ptr{T},), A)
213+ ccall ((:fftw_alignment_of , libfftw3[] ), Int32, (Ptr{T},), A)
214214 alignment_of (A:: StridedArray{T} ) where {T<: fftwSingle } =
215- ccall ((:fftwf_alignment_of , libfftw3f), Int32, (Ptr{T},), A)
215+ ccall ((:fftwf_alignment_of , libfftw3f[] ), Int32, (Ptr{T},), A)
216216end
217217
218218# FFTWPlan (low-level)
@@ -268,9 +268,9 @@ unsafe_convert(::Type{PlanPtr}, p::FFTWPlan) = p.plan
268268
269269# these functions should only be called while the fftwlock is held
270270unsafe_destroy_plan (plan:: FFTWPlan{<:fftwDouble} ) =
271- ccall ((:fftw_destroy_plan ,libfftw3), Cvoid, (PlanPtr,), plan)
271+ ccall ((:fftw_destroy_plan ,libfftw3[] ), Cvoid, (PlanPtr,), plan)
272272unsafe_destroy_plan (plan:: FFTWPlan{<:fftwSingle} ) =
273- ccall ((:fftwf_destroy_plan ,libfftw3f), Cvoid, (PlanPtr,), plan)
273+ ccall ((:fftwf_destroy_plan ,libfftw3f[] ), Cvoid, (PlanPtr,), plan)
274274
275275const deferred_destroy_lock = ReentrantLock () # lock protecting the deferred_destroy_plans list
276276const deferred_destroy_plans = FFTWPlan[]
@@ -331,19 +331,19 @@ end
331331# ################################################################################################
332332
333333cost (plan:: FFTWPlan{<:fftwDouble} ) =
334- ccall ((:fftw_cost ,libfftw3), Float64, (PlanPtr,), plan)
334+ ccall ((:fftw_cost ,libfftw3[] ), Float64, (PlanPtr,), plan)
335335cost (plan:: FFTWPlan{<:fftwSingle} ) =
336- ccall ((:fftwf_cost ,libfftw3f), Float64, (PlanPtr,), plan)
336+ ccall ((:fftwf_cost ,libfftw3f[] ), Float64, (PlanPtr,), plan)
337337
338338@exclusive function arithmetic_ops (plan:: FFTWPlan{<:fftwDouble} )
339339 add, mul, fma = Ref (0.0 ), Ref (0.0 ), Ref (0.0 )
340- ccall ((:fftw_flops ,libfftw3), Cvoid,
340+ ccall ((:fftw_flops ,libfftw3[] ), Cvoid,
341341 (PlanPtr,Ref{Float64},Ref{Float64},Ref{Float64}), plan, add, mul, fma)
342342 return (round (Int64, add[]), round (Int64, mul[]), round (Int64, fma[]))
343343end
344344@exclusive function arithmetic_ops (plan:: FFTWPlan{<:fftwSingle} )
345345 add, mul, fma = Ref (0.0 ), Ref (0.0 ), Ref (0.0 )
346- ccall ((:fftwf_flops ,libfftw3f), Cvoid,
346+ ccall ((:fftwf_flops ,libfftw3f[] ), Cvoid,
347347 (PlanPtr,Ref{Float64},Ref{Float64},Ref{Float64}), plan, add, mul, fma)
348348 return (round (Int64, add[]), round (Int64, mul[]), round (Int64, fma[]))
349349end
@@ -374,9 +374,9 @@ const has_sprint_plan = version >= v"3.3.4" && fftw_provider == "fftw"
374374
375375@static if has_sprint_plan
376376 sprint_plan_ (plan:: FFTWPlan{<:fftwDouble} ) =
377- ccall ((:fftw_sprint_plan ,libfftw3), Ptr{UInt8}, (PlanPtr,), plan)
377+ ccall ((:fftw_sprint_plan ,libfftw3[] ), Ptr{UInt8}, (PlanPtr,), plan)
378378 sprint_plan_ (plan:: FFTWPlan{<:fftwSingle} ) =
379- ccall ((:fftwf_sprint_plan ,libfftw3f), Ptr{UInt8}, (PlanPtr,), plan)
379+ ccall ((:fftwf_sprint_plan ,libfftw3f[] ), Ptr{UInt8}, (PlanPtr,), plan)
380380 function sprint_plan (plan:: FFTWPlan )
381381 p = sprint_plan_ (plan)
382382 str = unsafe_string (p)
@@ -457,49 +457,49 @@ _colmajorstrides(p) = ()
457457# Execute
458458
459459unsafe_execute! (plan:: FFTWPlan{<:fftwDouble} ) =
460- ccall ((:fftw_execute ,libfftw3), Cvoid, (PlanPtr,), plan)
460+ ccall ((:fftw_execute ,libfftw3[] ), Cvoid, (PlanPtr,), plan)
461461
462462unsafe_execute! (plan:: FFTWPlan{<:fftwSingle} ) =
463- ccall ((:fftwf_execute ,libfftw3f), Cvoid, (PlanPtr,), plan)
463+ ccall ((:fftwf_execute ,libfftw3f[] ), Cvoid, (PlanPtr,), plan)
464464
465465unsafe_execute! (plan:: cFFTWPlan{T} ,
466466 X:: StridedArray{T} , Y:: StridedArray{T} ) where {T<: fftwDouble } =
467- ccall ((:fftw_execute_dft ,libfftw3), Cvoid,
467+ ccall ((:fftw_execute_dft ,libfftw3[] ), Cvoid,
468468 (PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
469469
470470unsafe_execute! (plan:: cFFTWPlan{T} ,
471471 X:: StridedArray{T} , Y:: StridedArray{T} ) where {T<: fftwSingle } =
472- ccall ((:fftwf_execute_dft ,libfftw3f), Cvoid,
472+ ccall ((:fftwf_execute_dft ,libfftw3f[] ), Cvoid,
473473 (PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
474474
475475unsafe_execute! (plan:: rFFTWPlan{Float64,FORWARD} ,
476476 X:: StridedArray{Float64} , Y:: StridedArray{Complex{Float64}} ) =
477- ccall ((:fftw_execute_dft_r2c ,libfftw3), Cvoid,
477+ ccall ((:fftw_execute_dft_r2c ,libfftw3[] ), Cvoid,
478478 (PlanPtr,Ptr{Float64},Ptr{Complex{Float64}}), plan, X, Y)
479479
480480unsafe_execute! (plan:: rFFTWPlan{Float32,FORWARD} ,
481481 X:: StridedArray{Float32} , Y:: StridedArray{Complex{Float32}} ) =
482- ccall ((:fftwf_execute_dft_r2c ,libfftw3f), Cvoid,
482+ ccall ((:fftwf_execute_dft_r2c ,libfftw3f[] ), Cvoid,
483483 (PlanPtr,Ptr{Float32},Ptr{Complex{Float32}}), plan, X, Y)
484484
485485unsafe_execute! (plan:: rFFTWPlan{Complex{Float64},BACKWARD} ,
486486 X:: StridedArray{Complex{Float64}} , Y:: StridedArray{Float64} ) =
487- ccall ((:fftw_execute_dft_c2r ,libfftw3), Cvoid,
487+ ccall ((:fftw_execute_dft_c2r ,libfftw3[] ), Cvoid,
488488 (PlanPtr,Ptr{Complex{Float64}},Ptr{Float64}), plan, X, Y)
489489
490490unsafe_execute! (plan:: rFFTWPlan{Complex{Float32},BACKWARD} ,
491491 X:: StridedArray{Complex{Float32}} , Y:: StridedArray{Float32} ) =
492- ccall ((:fftwf_execute_dft_c2r ,libfftw3f), Cvoid,
492+ ccall ((:fftwf_execute_dft_c2r ,libfftw3f[] ), Cvoid,
493493 (PlanPtr,Ptr{Complex{Float32}},Ptr{Float32}), plan, X, Y)
494494
495495unsafe_execute! (plan:: r2rFFTWPlan{T} ,
496496 X:: StridedArray{T} , Y:: StridedArray{T} ) where {T<: fftwDouble } =
497- ccall ((:fftw_execute_r2r ,libfftw3), Cvoid,
497+ ccall ((:fftw_execute_r2r ,libfftw3[] ), Cvoid,
498498 (PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
499499
500500unsafe_execute! (plan:: r2rFFTWPlan{T} ,
501501 X:: StridedArray{T} , Y:: StridedArray{T} ) where {T<: fftwSingle } =
502- ccall ((:fftwf_execute_r2r ,libfftw3f), Cvoid,
502+ ccall ((:fftwf_execute_r2r ,libfftw3f[] ), Cvoid,
503503 (PlanPtr,Ptr{T},Ptr{T}), plan, X, Y)
504504
505505# NOTE ON GC (garbage collection):
556556
557557# low-level FFTWPlan creation (for internal use in FFTW module)
558558
559- for (Tr,Tc,fftw,lib) in ((:Float64 ,:(Complex{Float64})," fftw" ,:libfftw3 ),
560- (:Float32 ,:(Complex{Float32})," fftwf" ,:libfftw3f ))
559+ for (Tr,Tc,fftw,lib) in ((:Float64 ,:(Complex{Float64})," fftw" ,:libfftw3 [] ),
560+ (:Float32 ,:(Complex{Float32})," fftwf" ,:libfftw3f [] ))
561561 @eval @exclusive function cFFTWPlan {$Tc,K,inplace,N} (X:: StridedArray{$Tc,N} ,
562562 Y:: StridedArray{$Tc,N} ,
563563 region, flags:: Integer , timelimit:: Real ) where {K,inplace,N}
0 commit comments