-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Only warn in case of CHOLMOD major version mismatch #13000
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
base/sparse/cholmod.jl
Outdated
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.
BTW, I don't understand why this line is here. version_array
is declared const
above, and already set during compilation using the very same call. Since it's supposed to hold the version used when building Julia, resetting it on init doesn't make any sense to me. Should I remove it?
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.
version_array
ends up with the linked version of CHOLMOD if possible and tmp
has the version at build time. Therefore, I think we could just have
tmp = copy(version_array)
instead of
tmp = Array(Cint, 3)
ccall((:jl_cholmod_version, :libsuitesparse_wrapper), Cint, (Ptr{Cint},), tmp)
but I think there is a problem with version
which should be updated at run time.
I think we need these definitions at compile time, but I'm not completely sure, so it might be that they can just be defined in the __init__
function.
(Moving from adding comments inline as they get hidden after a new commit is added.) More precisions. I was actually able to get the tests to pass with 4.1.0 (it was related to a build issue). But with 4.0.0 they don't, and I get this error, which seems more serious:
So we should rely on either 4.1.0 (libcholmod 2.1.0) or 4.2.0 (libcholmod 2.1.1) as a minimum. Since only the latter allows getting the version number, I'm inclined to require it. Both versions were released in the same month 2013. That's what this PR currently does. I'll also write to Tim Davis to ensure we never get ABI breaks inside a minor release in the future. Finally, I forgot to say that currently, even with this PR, sparse support doesn't work at all when the warning message is printed: since |
base/sparse/cholmod.jl
Outdated
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.
Could we just say "binaries from www.julialang.org" without mentioning the OS here? MSYS2 may eventually have a Julia package where this could also apply.
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.
Sure, will fix when the PR is ready.
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.
Fixed in the new version.
9eadb0e
to
817f5c2
Compare
@andreasnoack @ViralBShah can somebody comment on the current state of this? |
817f5c2
to
76d7619
Compare
I've changed it to use There's still something I don't understand in the logic of the code: why do we call |
There used to be function definitions the depended on the version and therefore the constants were convenient. However, these conditions have been removed. It is likely that we don't need these constants at compile time anymore so feel free to try to remove them. |
@andreasnoack OK, I've added a commit simplifying the logic. |
778cede
to
553a0ef
Compare
With the last commit, the fields of the |
I think your reasoning here makes good sense. Package maintainers like you are also the main audience for these checks so if they make sense from a packaging perspective, we should be good. Users who downloads the generic builds or compile from source won't have these problems. I don't think I have any further comment. Is the pr ready now? |
The check introduced in #10362 is actually too strict, as ABI break only happen with mismatches in the major version. Warning on minor version differences means distributions cannot update SuiteSparse without rebuiling Julia (#12841). We also require at least libcholmod 2.1.1. Call dlsym_e instead of dlsym, which raises an error instead of returning C_NULL. Also fix the incorrect wording introuced in 25eb444: this message corresponds to the case where the version is different, not necessarily older.
Use jl_cholmod_version only once to get the version used during the build, and do not modify this constant in __init__(). Rename variables to make them more explicit. Also only register gc tracked allocator if current version (and not build version) is recent enough.
553a0ef
to
4c25109
Compare
That's ready from my side. I've squashed the two first commits, as they are tightly related and overlap a lot when moving the messages around. |
This looks ok to me too. Can merge once CI completes. |
Congrats, the last issue with milestone 0.4.0. Nice that it falls on number 13000. |
Cool, I hadn't noticed that detail! So I have the privilege of hitting the green button. Thanks everybody for the review! |
Improve CHOLMOD version mismatch detection
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.
these should be spaces, not tabs
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.
Ah, I hate editors when they don't respect the existing style of a file. I've pushed a fix on master, should I also push it on release-0.4 to ease future backports?
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.
just did d523dde
The check introduced in #10362 is actually too strict,
as ABI break only happen with mismatches in the major
version. Warning on minor version differences means
distributions cannot update SuiteSparse without
rebuiling Julia (#12841).
Also fix the incorrect wording introuced in 25eb444:
this message corresponds to the case where the version is
different, not necessarily older.
CC: @andreasnoack