Project

General

Profile

conda-forge release with NetCDF support on Mac-OS

Added by Valerio Lembo almost 6 years ago

Hi,

I am writing because I need to import Cdo libraries in a Python script and I always get the same error:

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

Searching around, it seems that it is a common issue with conda installation on Mac. As far as I understood, compiling from source won't solve the problem, because conda package would have priority on the manual installation.

As a workaround, I uninstalled the cdo package from conda and installed the version available with pip (which is properly working, although it is quite an old version of CDO, i.e. 1.3).

Is there a better way to solve the problem?

Thanks for helping.

Best,

Valerio


Replies (5)

RE: conda-forge release with NetCDF support on Mac-OS - Added by Ralf Mueller almost 6 years ago

for python scripting bindings, you need a working CDO installation. you can use MacPorts for building CDO. the python-cdo package is independent of CDO - it can run multiple cdo binaries. the Macport package (https://github.com/macports/macports-ports/blob/master/science/cdo/Portfile) is up-to-date.

RE: conda-forge release with NetCDF support on Mac-OS - Added by Valerio Lembo almost 6 years ago

Hi Ralf,

thank you for the answer.

I have the most recent version installed with port on my computer. When I need to import the cdo bindings on Python, though, it wants me to link to an existing Python package. The one available in conda-forge repository (which is the most recent), has some compiling issues when it comes to Mac. This is why the only workaround I found for now is to obtain the package from pip, although it is an outdated version, as mentioned before...

RE: conda-forge release with NetCDF support on Mac-OS - Added by Ralf Mueller almost 6 years ago

pip is my prefered way of distributing the python bindings of CDO, so it has the latest release 1.3.6:

wanglung:~ m300064$ pip search cdo
cdo (1.3.6)                  - python bindings to CDO
  INSTALLED: 1.3.5
  LATEST:    1.3.6

there is a slight naming collision: I use the package name 'cdo' for the python pindings. that's what you can install with pip directly. conda-forge package is renamed to 'python-cdo' instead, because 'cdo' is already the name for the cdo binary package. both python-cdo and pip's cdo are on version 1.3.6. CDO (the binary) is at 1.9.3 (conda-forge) or 1.9.4 (macports).

if you have pip and macports, it should work. What is the output of your pip search cdo? BTW. the python-bindings of cdo are plain python - nothing should be compiled. could be that this was done for some dependencies, though.

hth
ralf

RE: conda-forge release with NetCDF support on Mac-OS - Added by Valerio Lembo almost 6 years ago

Hi Ralf,

this is the output of my pip search cdo:

cdo (1.3.6)                  - python bindings to CDO
  INSTALLED: 1.3.6 (latest)
cdo-api-client (1.0.0.dev4)  - Python interface to the climate data online api
cdo-api-py (1.0.0.dev12)     - Python interface to the climate data online api
cdochain (0.2b3)             - Easy chaining of cdo methods.

I think I misinterpreted the name of the version, so this is the updated one! Thanks for the answer...

Nevertheless, given that we are trying to migrate to Anaconda repositories, it would be maybe useful if a sanity check is performed in order to understand what is the reason for the NetCDF support error on Mac.

Best,

Valerio

RE: conda-forge release with NetCDF support on Mac-OS - Added by Ralf Mueller almost 6 years ago

the condaforge build of CDO does not support netcdf at the moment because of a long-lasting linking problem (https://github.com/conda-forge/cdo-feedstock/issues/15). I think is is related to the fact, that conda delivers pre-build binarys. My recommendation is using the macports version. for users this is more attractive because all features can be built into CDO with it.

If you have some free resources, the conda-forge people would be very thankful for some help with the Mac-version I guess.

cheers
ralf

    (1-5/5)