Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FFTW relocatable for PackageCompiler #207

Merged
merged 1 commit into from
Jun 21, 2021
Merged

Conversation

staticfloat
Copy link
Collaborator

Because we need to know the FFTW vendor pretty early (at precompile
time to generate code, and at runtime) we need to load the path during
build (which bakes it into the precompile image), however we need to
update that path on next load within __init__() in case we're a part
of PackageCompiler and we need to be able to move things around without
requiring a recompile. So we change all accesses of libfftw3{,f} to
be through a Ref{String}(), then update that ref within __init__().

In the future, accesses of FFTW_jll.libfftw3 will be through a
function, rather than a direct variable access, and we'll be able to get
these things for free, but that's still a ways down the line.

Because we need to know the FFTW vendor pretty early (at precompile
time to generate code, and at runtime) we need to load the path during
build (which bakes it into the precompile image), however we need to
update that path on next load within `__init__()` in case we're a part
of PackageCompiler and we need to be able to move things around without
requiring a recompile.  So we change all accesses of `libfftw3{,f}` to
be through a `Ref{String}()`, then update that ref within `__init__()`.

In the future, accesses of `FFTW_jll.libfftw3` will be through a
function, rather than a direct variable access, and we'll be able to get
these things for free, but that's still a ways down the line.
@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #207 (e96270a) into master (df8f937) will increase coverage by 0.20%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   62.64%   62.85%   +0.20%     
==========================================
  Files           5        5              
  Lines         423      428       +5     
==========================================
+ Hits          265      269       +4     
- Misses        158      159       +1     
Impacted Files Coverage Δ
src/fft.jl 63.25% <60.00%> (ø)
src/FFTW.jl 86.66% <100.00%> (-3.34%) ⬇️
src/providers.jl 38.46% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df8f937...e96270a. Read the comment docs.

@andreasnoack
Copy link
Member

We've now been able to test this and it makes the package work with PackageCompiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants