-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update SLICOT to 5.7 with BSD license #152
Conversation
Thanks for taking a first cut at this! Is there a reason to create the submodule using a reference to the python-control project (or your fork, for now) rather than direct to the SLICOT project (SLICTO/SLICOT-Reference)? |
Yes, we need some changes to the sources so that we can build on gcc10 and newer LAPACK. |
Fails in the python-control test suite, because it has better coverage than the Slycot tests: Some call signatures have changed! First one fixed is sb03md, which indeed had inconsistencies in the call signatures between the Python function, the pyf wrapper and the Fortran routine. |
I've also taken a crack at this, see https://github.com/roryyorke/Slycot/tree/rory/slicot-5.7. That builds fine on Ubuntu 20.04 using conda-provided Python 3.8, numpy 1.19.5, gcc_linux-64 9.3.0, gfortran_linux-64 9.3.0, libblas 3.9.0, liblapack 3.9.0, libopenblas 0.3.12. After I cherry-picked your I presume if activate Github actions on that repo, I can run tests on Windows and Mac too; I haven't explored that. I didn't use submodules, but that is not my main point: I don't know the trade-offs between sub-modules and "other" options. What I do want to note is below.
modified examples/TMB03LD.f
@@ -28,7 +28,8 @@
$ Q( LDQ, 2*NMAX )
*
* .. External Subroutines ..
- EXTERNAL MB03LD
+ EXTERNAL MB03LD, LSAME
+ LOGICAL LSAME
*
* .. Intrinsic Functions ..
INTRINSIC MAX
|
See #111 |
#13. I think I remember that my system spit out errors without the changes. Testing without it: https://github.com/bnavigator/Slycot/actions/runs/565931777 |
I missed the AB13ID (7b96b647) fix from upstream; the annoyance in getting this into my branch has put me in favour of the submodule approach. If we do go the submodule route, could we briefly document how we go about updating SLICOT, either in README.md, or maybe SLICOT.md? My guess is it would work something like this:
|
Basically, what I did in bnavigator/SLICOT-Reference:
Submodules work on commit references, which can point into any branch. This reference is saved for the respective commit in python-control/Slycot or any forked repository. |
Tests were successful. I wonder if just my memory plays me a trick, or it maybe was just because of a failing intermediate test run between the merged changes from #13 and bnavigator/SLICOT-Reference@24a5d2d. So do we ditch the modifications, or do we still need it? Those functions are deprecated, albeit still present. |
Ugh, thanks.
I can't figure out how to install (now ancient?) conda-forge lapack 3.6.0 to test what happened back then. I see on scipy/scipy#5266 there is mention of being able to force LAPACK to be built with these deprecated functions in---I wonder if that is what is being done? I also see in #13 that @repagh tried to use the recommended replacement for *LATZM, but something went wrong. Sorry for the noise---I don't want to make extra work, I was just surprised when SLICOT compiled without complaint. I guess it would be safest to keep our SLCT_*LATZM functions. The other change (DGEGS) is more straightforward, and a good candidate for sending upstream (assuming licensing can be ironed out). |
I reckon we should keep our modifications for the deprecated LAPACK functions. |
Upstream has their own modifications between 5.0 and 5.7 regarding DGEGS/DGGES. I am pretty sure I ran into errors here, but as I said, that was maybe because something between backported #13 and not yet applied bnavigator/SLICOT-Reference@24a5d2d. Not applying any of those also seems to work. |
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.
Thanks @bnavigator, this is great. To wrap this up, I think we need to:
- fork your SLICOT-Reference to a new repo under python-control, and point the submodule to that - @murrayrm , do you agree?
- Update README.md to explain how to initialise the module, along with a pointer to https://git-scm.com/book/en/v2/Git-Tools-Submodules
- Also update README.md with an explanation of our update policy w.r.t. SLICOT (merge upstream/main to main & merge that to slycot-changes; Slycot-specific changes to slycot-changes)
I'm happy to do the README.md updates; let me know.
Co-authored-by: Rory Yorke <[email protected]>
6ab16c8
to
1f0a4f3
Compare
Sounds like a good plan to me. Anything special needed for SLICOT-Reference? Otherwise, I can create the repository, set @bnavigator, @roryyorke, @repagh as owners, and then let you at it. |
Sounds good. I suggest forking from SLICOT/SLICOT-Reference, so that we have the correct link registered by GitHub. |
SLICOT/SLICOT-Reference forked. @bnavigator, @roryyorke, @repagh invited as maintainers. |
|
I took the first steps, please feel free to enhance. |
Excellent, let's merge it. |
This is the first take on updating our SLICOT 5.0 GPL source to the official BSD-3-Clause licensed SLICOT-Reference 5.7. See also #146.
Currently, the new source is a submodule
with path "../SLICOT-Reference",referencing my fork on bnavigator/SLICOT-Reference. I don't have permission to fork into python-control/SLICOT-Reference.Unless the path is hardcoded to bnavigator, merging this PR will not result in a working Slycot then.Some fixes to obsoleted and removed LAPACK routines, which we (mainly @repagh) already have applied to our SLICOT 5.0 sources, needed to be ported to SLICOT 5.7. See https://github.com/bnavigator/SLICOT-Reference/tree/slycot-changes. I can submit my own work upstream. But unless stated otherwise by the author himself, every contribution to Slycot so far is under GPL. So you need to submit your fixes to upstream yourself, if you wish to do so, @repagh.