GeezerVison is showing github.com — Any appetite to get a permissive licensed python SLICOT that includes Windows wheels? · python-control/python-control · Discussion #928
Any appetite to get a permissive licensed python SLICOT that includes Windows wheels?
#928
Aug 2, 2023
·
2 comments
·
3 replies
Discussion options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
I have been doing some work on compiling SLICOT on Windows and seemingly I managed to compile things in a pretty straightforward way via f2py thanks to our folks' work on the SciPy side using meson build system. Obviously the unicorn way would have been rewriting all this in anything other than F77 but that is a lot of work that I don't have too much time to spare because I'm converting F77 stuff on the SciPy eating all my time. So this seems like the second best thing to save things out of GPL licensed Slycot.
Hence my question in the title.
There are a few things to handle obviously,
- OpenBLAS, MKL linking and so on. For regular pip wheels SciPy already ships OpenBLAS but conda uses MKL etc. So that part would need some surgery. I'm not sure how the conda part is done but I can ask @h-vetinari since he is the expert on that part.
- The custom wrappers would probably change here and there. I don't know if that would pose any backwards compatible changes on the control side.
- We can opt for generating all signatures without any modification and then modify only the ones we are interested in instead of generating the signatures we are interested in. That would make things slightly easier to maintain.
I'd love to hear your thoughts about it.
Also related #867
|
You must be logged in to vote
Replies:
2 comments
·
3 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
OpenBLAS, MKL linking and so on.
I thought there was Conda-specific linking magic for that, as in one could choose per environment which linear algebra "backend" to use?
The custom wrappers would probably change here and there. I don't know if that would pose any backwards compatible changes on the control side.
I think python-control is the biggest user of Slycot, but it's not the only one. It would be good to have Slycot compatibility in a new package.
We can opt for generating all signatures without any modification and then modify only the ones we are interested in instead of generating the signatures we are interested in. That would make things slightly easier to maintain.
I'm not so sure about auto-generation, specifically following recent python-control/Slycot#199
I'm not sure what to think about a new package: it seems like a lot of work, and we have what seems like a good-enough solution, except of course for Windows wheels. On Windows I use mambaforge, so I'm not affected by this short-coming.
|
You must be logged in to vote
1 reply
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
I thought there was Conda-specific linking magic for that, as in one could choose per environment which linear algebra "backend" to use?
You can also do that without conda with Meson.
I think python-control is the biggest user of Slycot, but it's not the only one. It would be good to have Slycot compatibility in a new package.
Sure that won't be a problem since the number of wrappers are relatively low.
I'm not sure what to think about a new package: it seems like a lot of work, and we have what seems like a good-enough solution, except of course for Windows wheels. On Windows I use mambaforge, so I'm not affected by this short-coming.
Main issue is that pip install for windows is broken and there are no wheels for different architectures that easily. My problem with Slycot is the license to be honest. Other than that there won't be much difference in functionality
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
Having a SLICOT python module with permissive license and windows wheels for pip sounds like a great idea to me.
I am currently experimenting with SLICOT, f2py and meson with the goal of building a windows wheel.
And despite being quite new to the topic I am making progress, thanks to the great documentation of f2py and SciPy - Building from source.
@ilayn, can you briefly describe how you compiled SLICOT for windows? E.g. which fortran compiler did you use (I guess flang, after reading this)?
|
You must be logged in to vote
2 replies

Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
We have been using gfortran from MinGW and VS community edition compilers on Windows for generating wheels.
Typically what I do is to wrap things with f2py with a pyf file and generate a python module. You can find the gory details in SciPy meson files. The main issue is to link with OpenBLAS but you can find a precompiled OpenBLAS dll in your Python distro scipy/.libs or numpy/libs folder. It is the same machinery using MKL but I never tried it. The flang parts are typically conda related.
In the meantime, we have translated quite a bit of F77 code scipy/scipy#18566 so my opinion about feasibility of SLICOT translation work is definitely strengthened. Ideally no code should be left in F77 format in this day an age. With sufficient capacity, which is ample in the academia among young researchers, ROI of such work is quite high in case anyone interested. Thus, my attention is mostly porting F77 code to C or Cython. I am investigating whether this is feasible for LAPACK so SLICOT is surely possible. But that is not what you asked so I'll skip the details :) If you are interested here is a much longer diatribe scientific-python/faster-scientific-python-ideas#7
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
Your hints are very valuable to me, so thank you for the quick reply.
Porting SLICOT from F77 to C is an interesting alternative, but I agree with past-@ilayn 😉
Obviously the unicorn way would have been rewriting all this in anything other than F77 but that is a lot of work that I don't have too much time to spare [...]. So this seems like the second best thing to save things out of GPL licensed Slycot.
|
|