-
Notifications
You must be signed in to change notification settings - Fork 56
Require Julia 1.6+, use Preferences, eliminate mutable state #189
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
Conversation
eaa703b to
70f23d4
Compare
|
This closes #188 X-ref: JuliaLang/Pkg.jl#2500 |
70f23d4 to
60b6612
Compare
|
LGTM, assuming CI is okay… |
3e2eebb to
3534101
Compare
This adds support for `Preferences.jl` as the backing store for setting a computation backend (currently only supports `fftw` and `mkl` as valid choices). The convenience method `set_provider!()` is given, but it is little more than a wrapper around `Preferences.set_preferences!()`. Users can alter their `LocalPreferences.toml` or `Project.toml` files by hand as well; in the event that an illegal value is provided, an error will be displayed and `fftw` will be chosen as the default value. Preferences is a relatively new subsystem in Julia and it has some lacking support in `Pkg`; so for now we are adding a separate `test/Project.toml`, which will have preferences added into it on CI, as there is a bug in propagating preferences when a single `Project.toml` is used with extra dependencies for the tests.
3534101 to
2972104
Compare
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 65.04% 66.35% +1.30%
==========================================
Files 4 5 +1
Lines 412 428 +16
==========================================
+ Hits 268 284 +16
Misses 144 144
Continue to review full report at Codecov.
|
|
@staticfloat perhaps it'd also be useful to have some documentation about how to set the preference 🙂 For example in https://juliamath.github.io/FFTW.jl/stable/#Installation |
| @static if fftw_provider == "mkl" | ||
| using IntelOpenMP_jll, MKL_jll | ||
| const libfftw3 = MKL_jll.libmkl_rt_path | ||
| const libfftw3f = libfftw3 | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem compatible with PackageCompiler. The paths will end up being compiled into the system image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this should be done within __init__() if we need this to work with PackageCompiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally we ned all packages to work with PackageCompiler and specifically we very much need this to work with PackageCompiler
This adds support for
Preferences.jlas the backing store for settinga computation backend (currently only supports
fftwandmklas validchoices). The convenience method
set_provider!()is given, but it islittle more than a wrapper around
Preferences.set_preferences!().Users can alter their
LocalPreferences.tomlorProject.tomlfiles byhand as well; in the event that an illegal value is provided, an error
will be displayed and
fftwwill be chosen as the default value.Preferences is a relatively new subsystem in Julia and it has some
lacking support in
Pkg; so for now we are adding a separatetest/Project.toml, which will have preferences added into it on CI, asthere is a bug in propagating preferences when a single
Project.tomlis used with extra dependencies for the tests.