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
5 tasks done
alexamici opened this issue Jul 27, 2018 · 14 comments
Closed
5 tasks done

Add support of recent versions of Windows #7

alexamici opened this issue Jul 27, 2018 · 14 comments
Assignees
Labels
distribution Packaging and distribution enhancement New feature or request

Comments

@alexamici
Copy link
Contributor

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 added the enhancement New feature or request label Jul 27, 2018
@alexamici alexamici assigned StephanSiemen and unassigned alexamici Aug 29, 2018
@jlandmann
Copy link

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.

@alexamici alexamici added the distribution Packaging and distribution label Oct 21, 2018
@kikocorreoso
Copy link

@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
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
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
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
Copy link
Contributor Author

@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
Copy link

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
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
Copy link
Contributor Author

📢📢📢 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
Copy link

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
Copy link

@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
Copy link

vciulei commented Feb 22, 2019

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

@alexamici
Copy link
Contributor 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.

@albert-antony
Copy link

albert-antony commented Oct 13, 2022

@alexamici cfgrib version installed on windows using the command

conda install -c conda-forge eccodes

works fine and does almost everything for basic analytical part. I am unable to extract certain parameters with cfgrib. I think pynio engine works fine for most part but it is not supported for windows versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distribution Packaging and distribution enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants