-
Notifications
You must be signed in to change notification settings - Fork 54
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
Any plans for a Linux enabled version? #50
Comments
If I am given some guidance I can try to implement this. |
@bhlevca Great :) |
@Rhadhi Thanks for your answer. |
@Rhadhi I am ready to try my hand at it. You told me above that it would be possible to do it without Mono. If I get a push in the right direction I will try to develop the glue code for this. |
@JesperGr Any suggestions? |
Right now the library is based on the MIKE Core .NET libraries, and utilizing the ease of the .NET API. That requires .NET integration in python. I have no idea if the .NET integration in python works on Linux, or whether it can be made to work. I guess that would be the first thing to test - testing need not be based on MIKE Core assemblies, but just getting any .NET Standard library working in python could show if that is an option. The alternative is to use the C API to DFS files. Using a C API is natively support by Python on both Windows and Linux. However, that will be a major rewrite of the code, since the C API it is quite different from the .NET API. And then comes the issue with DHI Linux libraries, which are currently not publicly available, and are only build for a few distributions (e.g. known not to work on Ubuntu), so I am not sure that part is fully ready either. |
Even though it could be a significant effort, the best solution to be able to provide a working library on both Windows and Linux seems to use the C API. Is there documentation and examples available for the C API? |
The C API is not as well documented as the .NET variant. There is one external example at: That should cover most of what is required for dfs0+1+2+3. For dfsu, interpretation of the static mesh data will be required. Documentation for how DFS is used for dfsu files can be found here: https://manuals.mikepoweredbydhi.help/2020/General/FM_FileSpecification.pdf We do plan on updating the examples to also include at least dfsu - just not there yet. The header file for all the C-methods are available in the latest version of the NuGet package DHI.DFS. There is some DHI-internal documentation of the C API, which I can also send on, if required. Otherwise we can find several examples internally within the DHI codebase. The more tricky part is writing dfs files, where the C api methods needs to be called in a specific order. Support for Res1D files will be difficult, because that one is highly dependent on .NET code on top of the DFS functionality. |
I found out that pythonnet can be installed in Ubuntu
and this documentation about .Net on Linux https://medium.com/wolox/how-to-create-your-first-net-e2223dedb74f I am going to explore this path first, although I agree with @ecomodeller that the C-API solution more elegant and universal. I will let you know what I find with my tests. I am working on OpenSuse not Ubuntu. and I had no issues installing pythonnet on it using pip/wheels. |
A list of things that would be possible with a linux version of mikeio:
|
@ecomodeller Great list. I hope to start working on this this week. Starting with testing Pythonnet on linux. I installed it but have not got a chance to test it |
I had partial success with pythonnet on Linux I started with something simple, to create a DFS2 file from some data. I'l kike to know your opinions and if you have any suggestions.
|
Dear bhlevca I think that is as far as you can get with what you have - which is actually good news. The mikeio package depends on the .NET MIKE Core package, which again depends on native dll's. But the native dll's that you have (eum.dll, ufs.dll), they are all Windows, and will not work on Linux. So you get a The good news, what you have shown is that the mikeio package can use the .NET MIKE Core package also on Linux. That was a question posted earlier in this thread. Then we are back to the fact that the DHI Linux libraries are currently not publicly available, and are only build for a few distributions (e.g. known not to work on Ubuntu). If you can describe exactly the steps you did in order to get this far, then maybe someone at DHI with access to the DHI Linux Libraries can pick this up to check if we can get all the way. |
Dear Jesper, I tried many things including with Mono and pythonnet installed with pip. However, my recommendations are the following: .Net Core
Pythonnet
mikeio
I work on OpenSuse and my commands differ a bit, for example, I use Please let me know if there is anything else you need to know. Bogdan |
If I get some help finding the right Linux libraries where I can find the Windows equivalent classes I could try to write an |
Just to let you know, that we will soon start the process of migrating away from using .NET and use a new Python version of the MIKE SDK. This will enable us to use most of MIKEIO on Linux in a not too distant future. |
Great news ! |
The future is expected to arrive in a few months. |
This is great news. This is going to be a long few months. |
Great news. I checked out mikecore but I am not getting the Linux binaries. I build the package and installed it but it is still creating a mikeio directory in site-packages and not a mikecore as in your example. Is there any way I can get access and start playing with it? I will make no complaints if it does not work :-) |
The Python-based/version of MikeSDK (mikecore) will be available as soon as we have sorted out some technical and maybe also some licensing details. The implication of this refactoring is that we will have to split the functionality of mikeio into two repos, one which doesn't need .Net (mainly dfs) and one that relies on .Net (Mike 1D). |
The Python version of Mike core (mikecore) is now available on Github. In order to give this new version of mikeio, you can install mikeio from this branch and it should hopefully work out of the box.
|
Just a small note: This first .NET-free version of mikeio will read/write dfs0 slower than the old version. This will be fixed soon! |
Thank you. Excellent work. I installed with "python setup.py
<https://signaltk.online/click?redirect=http%3A%2F%2Fsetup.py&dID=1622581344395&linkName=setup.py>
install" even though it is not mentioned in the Readme.md
<https://signaltk.online/click?redirect=http%3A%2F%2FReadme.md&dID=1622581344395&linkName=Readme.md>
file.
…On Tue, 1 Jun 2021 at 08:16, Jesper Sandvig Mariegaard < ***@***.***> wrote:
In order to give this new version of mikeio, you can install mikeio from
this branch and it should hopefully work out of the box.
$ pip install https://github.com/DHI/mikeio/archive/mikecore.zip
Just a small note: This first .NET-free version of mikeio will read/write
dfs0 slower than the old version. This will be fixed soon!
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#50 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABMRXWCPLTHMC24KLP7SCTTQTFQ5ANCNFSM4N6XSV3A>
.
|
The URL provided above (https://github.com/DHI/mikeio/archive/mikecore.zip) seems to be broken, it returns a 404 error. Did it move elsewhere ? |
@benjaminh , it's been merged in to the main branch: https://github.com/DHI/mikeio/archive/main.zip |
The Linux version works as expected! |
Many thanks for making this happen! |
The current version in
__init__.py
is loading dlls. If the equivalent functionality can be replaced with shared libraries perhaps a Linux or MacOS version could be achieved.It is possible that the Linux version could be made available sooner as there are already binaries for the cloud enabled Linux version of Mike Zero.
The text was updated successfully, but these errors were encountered: