Project

General

Profile

Questions about Installation (Complete Beginner)

Added by Neil Waters about 1 year ago

Hello!

I would like to learn to use CDO to better work with my netcdf data. As a beginner I find the documentaton for CDO difficult to understand. I followed other installation posts on this forum but still have some questions. Google hasn't helped.

I've been following the Win32 wiki page. I have two questions:

1) I've installed Cygwin but I'm not sure whether I've added "cygeccodes.dll" and "cdo.exe" to my Windows 10 '$PATH' correctly. In my Downloads folder I have a folder called "cdo-1.9.8-cygwin64-Win10". Under Environmenntal Variables - Path, I have added a folder "C:\Users\nawat\Downloads\cdo-1.9.8-cygwin64-Win10\cdo-1.9.8-cygwin64-Win10". Is this correct so far? Is there any way I can check in Cygwin whether I've set the path correctly?

2) I've downloaded the "eccodes-2.9.0-Source.tar.gz" file and extracted it to the .tar file, but am not sure what to do next. The wiki says

"set the environment variable ECCODES_DEFINITION_PATH to the definitions subdirectory of the extracted source code with its full absolute path. Don't forget to make that persistent by adding tto your favourite shell config file (.bashrc, .zshrc, .cshrc or so)."

Where do I find the source code? And where is ECCODES_DEFINITION_PATH? The eccodes-2.9.0-Source.tar folder just has the .tar file.

Any easy to understand help or a reference to an approachable guide for beginners would be very welcome!


Replies (23)

RE: Questions about Installation (Complete Beginner) - Added by Brendan DeTracey about 1 year ago

Start a cygwin terminal. You need to untar the tar file:

$ tar -xf eccodes-2.9.0-Source.tar
Alternatively, you could have combined this with unzipping on the original tarball:
$ tar -xzf eccodes-2.9.0-Source.tar.gz

This will give you a directory named eccodes-2.9.0-Source. In there is a subdirectory called definitions. This is the path to which the environment variable ECCODES_DEFINITION_PATH must be set. Say you unpacked the tarball in your cygwin home directory e.g. /home/your_cygwin_username. That means you must set:
ECCODES_DEFINITION_PATH=/home/your_cygwin_username/eccodes-2.9.0-Source/definitions
or:
ECCODES_DEFINITION_PATH=~/eccodes-2.9.0-Source/definitions

(~/ is short for your HOME directory in the cygwin bash shell i.e. /home/your_cygwin_username/) You want to append this line permanently to the bottom of your existing .bashrc file, with an added export directive:
echo 'export ECCODES_DEFINITION_PATH=~/eccodes-2.9.0-Source/definitions' >> .bashrc
Now close the cygwin terminal and open a new one. cdo should now work with grib files.

I recommend that you google up and read a tutorial on using the bash shell. And if you are a first time cygwin user beware of editing text files in your cygwin file system with a windows based text editor (https://cygwin.com/faq/faq.html#faq.api.cr-lf). If you do, make sure the text editor can save the file with unix/linux style line endings, instead of windows style line endings.

RE: Questions about Installation (Complete Beginner) - Added by Brendan DeTracey about 1 year ago

Oh. And if you are only using netcdf files and not grib, you do not need to do any of this.

RE: Questions about Installation (Complete Beginner) - Added by Neil Waters about 1 year ago

Hi Brendan,

Thank you very much for your help, it's greatly appreciated! I've made some progress.

I've installed cygwin and copied the two cdo files into my cygwin bin file. I've added the cygwin bin folder to my system's environment variables path variable.

It seems like I'm missing 4 files to be able to run cdo correctly, however I'm unable to find these files available under the full list of packages when running
the cygwin installer. Is there a specific place where I can find these files? I've attached two screenshots of my cygwin window.

RE: Questions about Installation (Complete Beginner) - Added by Brendan DeTracey about 1 year ago

Okay. A few problems.
  • "cygeccodes.dll" and "cdo.exe" should be put in your cygwin/bin directory, the one that the cygwin setup program created. Should be something like: C:\cygwin64\bin under windows. You do not need to create your own cygwin/bin directory.
  • You will be accessing cdo from the cygwin terminal window. You do not need to add anything to your windows path. I suggest you delete the change you made to your Windows path.
  • Read the installation notes for windows/cygwin (https://code.mpimet.mpg.de/projects/cdo/wiki/Win32). There are eight pre-requisite packages required by cdo. You must install them using the cygwin setup program(package installer). When you do this, the cygwin installer may also prompt that additional packages(such as hdf, which netcdf requires) are also marked for installation. This is normal. Hopefully this will do the trick. And hopefully, the cygwin netcdf and hdf packages are currently in sync. When I last installed cdo six months ago(https://code.mpimet.mpg.de/boards/2/topics/8636?r=8639#message-8639), I had to go into the cygwin installer and select hdf version:
    libhdf5hl_100 1.10.2-1
    , and netcdf versions
    libnetcdf11 4.4.1-1
    libnetcdf15 4.7.3-1

Take a few minutes to read the cygwin installer documentation before starting and then the cygwin docs on the cygwin file system. And since you will be working in the cygwin terminal, which is a bash shell, spend a few minutes reading a bash tutorial or two. As of tomorrow I won't have internet access for a few weeks, so if I do not reply again, I am not ignoring you, just enjoying summer unplugged. :)

RE: Questions about Installation (Complete Beginner) - Added by Brendan DeTracey about 1 year ago

And just to be certain, in your cygwin termial:

$ tail ~/.bashrc
should show the line:
export ECCODES_DEFINITION_PATH=~/eccodes-2.9.0-Source/definitions
at the bottom. Above I mentioned the .bashrc file (the cygwin bash shell user configuration file) but I should have typed it:
/home/your_cygwin_username/.bashrc
or:
/home/your_cygwin_username/.bashrc

RE: Questions about Installation (Complete Beginner) - Added by Neil Waters about 1 year ago

Hi Brendan (and to those with a similar problem)

I had already installed the packages specified in the installation guide. However, after installing the extra packages you specified I'm able to use CDO.

Thanks again for your patience. Please enjoy your summer vacation!!

Best regards,

Neil

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller about 1 year ago

I linked this thread into the Win32 page - thx a lot from my side,too.

cheers
ralf

RE: Questions about Installation (Complete Beginner) - Added by Rihards Gackis about 1 year ago

Hello!

Just read this all through to install this on my win10 station.
did everything step by step ,but cygwin terminal shows the message about missing operators although i put cdo.exe and cygeccodes.dll at the cygwin64 bin folder
any idea to get past this?

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller about 1 year ago

please, show the command and its error you used

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller about 1 year ago

so what's the point? CDO works! You just have to provide something to do. Try

cdo -outputtab,value -topo

RE: Questions about Installation (Complete Beginner) - Added by oliverthom oliverthom about 1 year ago

I had already installed the packages specified in the installation guide. However, after installing the extra packages you specified I'm able to use CDO.

RE: Questions about Installation (Complete Beginner) - Added by Kyle Lesinger about 1 year ago

I have had very similar issues. I have the correct cdo -V installed, but when I try and read a file it says "1.nc is a file on disk!". Does anyone know why this occurs?

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller about 1 year ago

hi Kyle!

the CDO syntax work like this: cdo <operator> <inputfile> <outputfile> Please have a look at the documentation for more examples

cheers

RE: Questions about Installation (Complete Beginner) - Added by Kyle Lesinger about 1 year ago

Thank you, I am slowly learning. Is there any reason why certain operators don't work with just 1 file (i.e., griddes)? See photo attached.

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller about 1 year ago

hi Kyle!

If you want to get a rough overview about how to do basic stuff, the FAQ is the perfect place to start with.

In terms of output CDO has two classes of operators:

  1. operators that write to one or multiple output files
  2. operators that write to stdout

The second class of operators can give you information about the input(s): griddes for grid information, sinfov for an overview of variables and coordinates, showname for printing all variable names. A complete list of this type of operators can be found in the beginning of chapter 2 of the documentation

The first class basically contains all other operators.

when in comes to input, most of the operators need one or more input files. but there are a couple of operators, that generate data out-of-the-blue: topo, stdatm, const, rand, seq to name a few.

cdo --operators
will print a list of all operators together with a small hint about what they do. At the end of each line there is a sort information about how many input and output stream each operators use (-1 is the placeholder for an arbitrary number of inputs)

hth
ralf

RE: Questions about Installation (Complete Beginner) - Added by oliverthom oliverthom 8 months ago

Any easy to understand help or a reference to an approachable guide for beginners would be very welcome! same question

Regards, [[https://hellodear.in/]]
[[https://teatv.ltd]]

RE: Questions about Installation (Complete Beginner) - Added by Lucia Layritz 8 months ago

Hi everyone,
I have a similar problem. I added cdo.exe to the bin folder, unzipped eccodes-2.9.0-Source.tz inside cygwin and set ECCODES_DEFINITION_PATH.
When I try to install cdo I get the following warning:

C:/cygwin64/bin/cdo.exe: error while loading shared libraries: cygeccodes.dll: cannot open shared object file: No such file or directory

I understand which I get it as cygeccodes.dll is not in the bin folder but I do not understand where I can download cygeccodes.dll to add it to the bin folder, I cannot seem to find it here: https://code.mpimet.mpg.de/projects/cdo/wiki/Win32

How to I add cygeccodes.dll?

Thank you!

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller 8 months ago

Lucia Layritz wrote:

Hi everyone,
I have a similar problem. I added cdo.exe to the bin folder, unzipped eccodes-2.9.0-Source.tz inside cygwin and set ECCODES_DEFINITION_PATH.
When I try to install cdo I get the following warning:

C:/cygwin64/bin/cdo.exe: error while loading shared libraries: cygeccodes.dll: cannot open shared object file: No such file or directory

No, you don't have a similar problem IMO. You want to run a cygwin binary from a plain windows command line terminal. This cannot work. Please you a cygwin terminal instead. There should a shortcut on the desktop or at least in the start menu.

hth
ralf

I understand which I get it as cygeccodes.dll is not in the bin folder but I do not understand where I can download cygeccodes.dll to add it to the bin folder, I cannot seem to find it here: https://code.mpimet.mpg.de/projects/cdo/wiki/Win32

How to I add cygeccodes.dll?

Thank you!

RE: Questions about Installation (Complete Beginner) - Added by Lucia Layritz 8 months ago

Hello Ralf,

thank you for your answer. I have done this inside a cygwin terminal I opened from the start menu, so I think this is not the reason.
As far as I understand, it cannot work since I do not have cygeccodes.dll where it should be, I just do not understand where to download it.
Thank you,
Lucia

RE: Questions about Installation (Complete Beginner) - Added by Ralf Mueller 8 months ago

ah, my fault - sorry. put cygeccodes.dll next to the cdo.exe. then it should work.

This dll is part of the official download zip file for CDO: https://code.mpimet.mpg.de/attachments/download/20825/cdo-1.9.8-cygwin64-Win10.zip

RE: Questions about Installation (Complete Beginner) - Added by Lucia Layritz 8 months ago

Yes it worked! I must have had a broken version of CDO download before. Thank you :)

    (1-23/23)