Skip to content
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 support of recent versions of Windows #7

Closed
alexamici opened this Issue Jul 27, 2018 · 13 comments

Comments

Projects
None yet
5 participants
@alexamici
Copy link
Collaborator

alexamici commented Jul 27, 2018

At the moment cfgrib supports only Linux and MacOS.

For Windows we need:

  • ecCodes support (experimental)
  • CFFI support and DLL search capabilities
  • popular Python distributions
    • conda
  • loose ends
    • write support (fix needed in ecCodes)
    • broken .idx locking

@alexamici alexamici self-assigned this Jul 27, 2018

@alexamici alexamici assigned StephanSiemen and unassigned alexamici Aug 29, 2018

@jlandmann

This comment has been minimized.

Copy link

jlandmann commented Oct 13, 2018

Hi!
First of all: thanks for the great work you're doing!

I just wanted to ask out of curiosity if this issue something that has high priority for you or if you have kind of a "time schedule" of implementation. Background: I am writing a Python model that should run on both Windows & Linux, and GRIB support via Python on Windows seems to be something that is not yet possible without major hacks.

@kikocorreoso

This comment has been minimized.

Copy link

kikocorreoso commented Oct 26, 2018

@jlandmann
In case it is useful, in Windows I use GDAL tools to do some stuff with GRIB files.

@alexamici
For me it would be interesting to know the plans for the windows versions. Are there any stuff we can help with eccodes or cfgrib on Windows?
Context: in the office I have to deal with Windows (7/10 - 32/64 bits) with limited admin rights so VC++ es complicated, Windows Subsystem for Linux is capped, Docker is not possible,... My only option nowadays is GDAL and Conda-forge to work with some GRIB related stuff on windows.

Thanks for the hard work with all the meteo related tools you are working on.

@vciulei

This comment has been minimized.

Copy link

vciulei commented Oct 29, 2018

hi @kikocorreoso ,

Would you mind sharing what are you using in order to decode GRIB files on windows x64?
I am also investigating using MetView for this matter, will update.

Tks

@jlandmann

This comment has been minimized.

Copy link

jlandmann commented Oct 29, 2018

Thanks @kikocorreoso, and sorry for the late reply. That's a good hint! I've tried to read in COSMO predictions in GDAL, it is throwing an error though - but that seems to be file-related.

@kikocorreoso

This comment has been minimized.

Copy link

kikocorreoso commented Oct 30, 2018

@vciulei

Here is a basic example to read mslp from a GFS file:

from osgeo import gdal

grib = gdal.Open("gfs.t00z.pgrb2.0p25.anl", gdal.GA_ReadOnly)
b = grib.GetRasterBand(1)
mslp = b.ReadAsArray()

Some relevant info:

@alexamici

This comment has been minimized.

Copy link
Collaborator Author

alexamici commented Nov 3, 2018

@jlandmann @kikocorreoso and @vciulei I have no timeline at the moment and I'm not going to have details in the future as I don't plan to work on the issue myself. According to @StephanSiemen who had looked into this, the main problem is that ecCodes itself can be forced to compile on Windows but only with serious effort. ECMWF aims to provide full windows support in ecCodes, but I have no idea of when.

On a brighter note. If anybody manages to build ecCodes on Windows they may just need to test what name to add to the list of library names here: https://github.com/ecmwf/cfgrib/blob/master/cfgrib/eccodes.py#L50

@jlandmann

This comment has been minimized.

Copy link

jlandmann commented Nov 5, 2018

Thanks @alexamici for the clarification!
In fact I (think I) managed to compile some working x64 .exes in Visual Studio as described in your online instructions and I found the lines you cited above, because I bumped into them when trying to open the grib file. I'll play a bit around and make a PR if I found something that works for me.

@vciulei

This comment has been minimized.

Copy link

vciulei commented Nov 5, 2018

@kikocorreoso @alexamici thank you both for the updates and the suggestions.
@jlandmann looking forward, keep up the good work

@alexamici

This comment has been minimized.

Copy link
Collaborator Author

alexamici commented Feb 21, 2019

📢📢📢 ecCodes can be installed on Windows with conda:

> conda install -c conda-forge eccodes

And cfgrib works almost out of the box! 🎊

I'll be tying up loose ends in the next few days and release a version with full (read-only) Windows support soon.

@alexamici alexamici assigned alexamici and unassigned StephanSiemen Feb 21, 2019

@jlandmann

This comment has been minimized.

Copy link

jlandmann commented Feb 21, 2019

Sorry that I didn't get back to you anymore! I accidentally overwrote the *.exes I produced and then it never worked anymore...:/
Therefore I'm even happier to hear the good news! :-)

@kikocorreoso

This comment has been minimized.

Copy link

kikocorreoso commented Feb 22, 2019

@alexamici @StephanSiemen

Thanks for the effort and the huge work!!!

Working with compilers on windows (enterprise capped windows environment in my case) is a real pain 😞

@vciulei

This comment has been minimized.

Copy link

vciulei commented Feb 22, 2019

@alexamici @StephanSiemen This is great news! Thank you for your effort!

@alexamici

This comment has been minimized.

Copy link
Collaborator Author

alexamici commented Feb 22, 2019

Well, ensuring full read-only Windows support in cfgrib amounted to adding a single line of code in an obscure error path, so kudos really need to go to ECMWF @StephanSiemen and @shahramn for pushing the ecCodes porting effort and to the @cffi developers for making writing portable bindings dead simple 😄

Write support as well would have been 100% functional out of the box if was not for a path portability bug in the current version of ecCodes.

@alexamici alexamici closed this in 8d92277 Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.