-2

After installing CDO in a Manjaro distro, I got the following error:

cdo sinfo air_temperature.nc
cdo    sinfo: Open failed on >air_temperature.nc<
       Unsupported file type (library support not compiled in)
To create a CDO application with NetCDF support use: ./configure --with-netcdf=<NetCDF root directory> ...

netcdf is installed and works with other applications (RNetCDF, QGIS, etc.). However, I don't find which NetCDF root directory, I should indicate in the configure instruction.

Could somebody help me?

Thanks.

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
piechevall
  • 11
  • 1
  • Adrian's answer below should solve the problem. However, it is probably easiest to install CDO from conda, as recommended by the CDO developers. That should fix the need for solving these issues. – Robert Wilson Nov 29 '21 at 10:34
  • Does this answer your question? [check library version netcdf linux](https://stackoverflow.com/questions/32117781/check-library-version-netcdf-linux) – ClimateUnboxed Nov 30 '21 at 07:42

1 Answers1

1

As the question is written you need to know the location of your netcdf libs. This is a duplicate of this linked question. If you have netcdf installed then you should be able to use nf-config to find out where your libs are, try

nf-config --flibs 

On most Debian-based flavours of linux it can be installed with

sudo apt-get install libnetcdff-dev

but in your case using an arch-based system, you instead need

pacman -S netcdf-fortran-openmpi

But an easier alternative is to bypass the manual install altogether by using conda, see this page for details

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
  • Adrian and Robert, I followed your suggestions. However, they where not successful! Conda led to compilation errors; I don't know why. Finally I've tried to recompile CDO with: ./configure --with-netcdf=usr/lib && make && sudo make install That solved the problem. Thanks for the assistance. – piechevall Nov 29 '21 at 15:13
  • But your question states that you didn't know where your netcdf libs were installed. If you had tried the command above it would have returned /usr/lib - then you needed to type --with-netcdf=/usr/lib as per the cdo error message. – ClimateUnboxed Nov 29 '21 at 16:56
  • The command nf-config gave "command not found". So I did several tentatives of search with catfish (Manjaro) and I found that the libnetcdf.so file was in the directory /usr/lib... And it worked. However I did'nt understand why nf-config is not found. May-be an installation issue of Manjaro? (v 4.8.1-1 from the "community" repository). If you have an explanation, I'm interested. – piechevall Nov 30 '21 at 17:22
  • To be precise: It is v.4.8.1-1 of netcdf! – piechevall Nov 30 '21 at 17:31
  • that means you didn't have the libnetcdf-dev installed... although Manjaro is not debian based, but instead arch, so on manjaro you would need pacman -S netcdf-fortran-openmpi – ClimateUnboxed Nov 30 '21 at 17:54
  • Many many thanks. That solved the issue. I understood that you are linked with both development teams of netcdf and of CDO. Could-you ask this info on the install procedure for both utilities? Pierre – piechevall Dec 01 '21 at 12:45
  • No, neither team. I'm just a researcher at ICTP trying to help out the community where I can... – ClimateUnboxed Dec 01 '21 at 14:28
  • @piechevall If this answer solved the problem for you, please consider marking it as accepted by clicking on the grey tick symbol so that it becomes green. This will let people see at a glance that the question has been answered to your satisfaction. – alani Dec 03 '21 at 02:17
  • YES, I consider that the question is solved. But I don't find howto mark it. – piechevall Dec 04 '21 at 07:20
  • Hi. There is a grey tick mark just below the up and down voting triangles on the top left of the answer. If you click it it changed to green to accept that answer. – ClimateUnboxed Dec 04 '21 at 08:13