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
Add KLU support to sundials #94930
Add KLU support to sundials #94930
Conversation
I dont think it's linked but nixpkgs-review fails with
Isn't adding |
@GuillaumeDesforges you should rebase on latest master, for those that don't use @teto with this patch: diff --git i/pkgs/development/libraries/sundials/default.nix w/pkgs/development/libraries/sundials/default.nix
index 74907ee1cc9..d69b09ade07 100644
--- i/pkgs/development/libraries/sundials/default.nix
+++ w/pkgs/development/libraries/sundials/default.nix
@@ -15,7 +15,18 @@ stdenv.mkDerivation rec {
pname = "sundials";
version = "5.3.0";
- buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran blas lapack ];
+ buildInputs = [
+ python
+ ]
+ ++ stdenv.lib.optionals (lapackSupport) [
+ gfortran
+ blas
+ lapack
+ ]
+ ++ stdenv.lib.optionals (kluSupport) [
+ suitesparse
+ ]
+ ;
nativeBuildInputs = [ cmake ];
src = fetchurl {
@@ -39,8 +50,8 @@ stdenv.mkDerivation rec {
"-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
] ++ stdenv.lib.optionals (kluSupport) [
"-DKLU_ENABLE=ON"
- "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
- "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
+ # "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
+ # "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
];
doCheck = true; I got this cmake warnings:
However, I'd still put Regarding scikit-odes' failure in tests - perhaps we should disable it for Python2 interpreters? |
@doronbehar Agreed but I don't know how to do this. If I look in |
|
b7c2869
to
922cae2
Compare
Got it rebased. It was indeed required to explicit CMAKE flags. @idontgetoutmuch if I remember correctly there is a EDIT: Ah got it
|
You need |
922cae2
to
e34415a
Compare
e34415a
to
0d43a96
Compare
I get an error stating
Isn't |
0d43a96
to
e107e75
Compare
Github's actions marking this as failed are a false negative. @GrahamcOfBorg build python2Packages.scikit-odes python3Packages.scikit-odes |
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.
otherwise LGTM
@GrahamcOfBorg build python27Packages.scikits-odes python3Packages.scikits-odes |
e107e75
to
b9be3b3
Compare
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.
Diff LGTM, but I'd only kindly ask to make the last commit message a bit more precise:
python2Packages.scikits-odes: disable
Ever since we added KLU support to sundials (#94930),
it stopped building while the Python 3 versions didn't
break. Python 2 is EOL.
b9be3b3
to
cd81c8d
Compare
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.
👍.
, lapackSupport ? true }: | ||
, suitesparse | ||
, lapackSupport ? true | ||
, kluSupport ? true }: |
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.
Should we make the default false so as not to break other packages which might use this? For example, scikits-odes
does not need kluSupport
.
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.
Maybe better is make kluSupport
false when building scikits-odes
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.
are the klu related packages likely to break the build?
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.
I don't think it is necessary to disable klu support in sundials for scikits-odes, since build+test is ok.
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.
Via some conditionals, it could be disabled only for python2Packages.scikits-odes
:) but TBH I wouldn't see benefit in this effort - according to git grep
, there are no reverse dependencies of python2Packages.scikits-odes
available, and Python 2 is EOL (!!). python3Packages.scikits-odes
builds fine.
are the klu related packages likely to break the build?
What do you mean @jonringer?
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.
The biggest argument against adding "optional" dependencies by default is that it makes more fragile since there's another point of potential failure (either the dependency doesn't build, or the dependency gets bumped and is no longer compatible).
That's the concern I'm expressing.
Unless the klu library is prone to breakages, we should probably add 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.
either the dependency doesn't build
suitesparse
is what provides KLU support for sundials (IDK what that even means). Suitesparse seems well maintained to me, both upstream and at Nixpkgs.
or the dependency gets bumped and is no longer compatible
The best we can do is to trust Sundials to test it with the current versions of suitesparse we ship. @GuillaumeDesforges perhaps it'll be nice to note in a comment near the conditional kluSupport
, that this feature is tested by upstream according to the INSTALL_GUIDE.pdf, section 1.1.4. Currently they write there:
The KLU libraries are part of SuiteSparse, a suite of sparse matrix software, available from the TexasA&M University website:http://faculty.cse.tamu.edu/davis/suitesparse.html.sundialshasbeen tested with SuiteSparse version 5.3.0
While we ship version 5.7.2 of suitesparse, so IDK 🙆♀️.
As a side note, I also support enabling this feature by default, for GNU Octave 6.0.0 which is about to be released. It will require this feature as well from this major version of sundials (5) . Currently Octave uses an old version of sundials with this feature enabled as well, see https://github.com/NixOS/nixpkgs/pull/79864/files#diff-a71f6e05947eac8bd8360ddb7faa9693 .
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.
I don't understand the issue. As with most nixpkgs packages, if sundials requires a bumped version of suitesparse we can just upgrade suitesparse, and if it breaks other packages we can create another bumped package like suitesparse_X_X_X
(like in the Haskell infrastructure where multiple versions of a package live).
Suitesparse seems well maintained to me, both upstream and at Nixpkgs.
Agreed, I would have been more concerned if it wasn't the case but it seems we are relatively safe here
Ever since we added KLU support to sundials (NixOS#94930), it stopped building while the Python 3 versions didn't break. Python 2 is EOL.
cd81c8d
to
12759d3
Compare
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.
👍 on adding commenting the link to upstream's INSTALL_GUIDE.pdf.
@jonringer is there anything left to do in order for this to be merged ? |
@jonringer I'm now testing the release candidate of Octave 6 which needs sundials with this patch, otherwise:
Is there anything left here to do / any objections left? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/openblas-vs-reference-blas-implementation/9086/1 |
@flokli @FRidh @jonringer Can I help with anything to get this PR accepted? |
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.
LGTM
Result of nixpkgs-review pr 94930 1
3 packages built:
- python37Packages.scikits-odes
- python38Packages.scikits-odes
- sundials
Motivation for this change
Add KLU support to sundials.
Needed for Haskell
hmatrix-sparse
for instanceThings done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)