When I install Pkg.add("FFTW")
, how does Julia link to FFTW? I guess it downloads a pre-compiled version because I didn't give it a path to link my local version and it didn't seem to take long enough to be compiling FFTW from source. Is that correct? If so, is there a way to set Julia to use a locally compiled and optimized version of FFTW? I ask because I have a simulation code with both a Julia and a C++ version, and the C++ one runs about 6-7x faster, even though I think both should be spending most of their time in FFTW calls. So I am wondering if the difference is that the Julia version is using a less well optimized build of FFTW.
Many Julia packages provide prebuilt libraries through the so called JLL. Julia also provides a mechanism to override these artifacts.
In particular, your ~/.julia/artifacts/Overrides.toml
will look like
[f5851436-0d7a-5f13-b9de-f02708fd171a]
FFTW = "...."
where ....
is the "prefix" where your FFTW is installed, i.e. the directory in which there is the lib/libfftw....
file. You can read more about overriding artifacts of JLL packages at https://juliapackaging.github.io/BinaryBuilder.jl/dev/jll/#Non-dev'ed-JLL-packages
If you happen to find that the slowdown is due to the different library, please do report it to https://github.com/JuliaPackaging/Yggdrasil/