{ "metadata": { "name": "", "signature": "sha256:a1356e9743f41049f7a4743963c2ceba4543289081bbb47a57275958caf217e1" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Install climate data operators (cdo) on Ubuntu with netCDF4 and hdf5 support" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " Nikolay Koldunov\n", " koldunovn@gmail.com\n", " @oceanographer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[CDOs](https://code.zmaw.de/projects/cdo) can be installed from Ubuntu repositories, but they are compiled without netCDF4 and HDF5 support. As a result you can get:\n", "\n", "`Unsupported file type (library support not compiled in)`\n", "\n", "error. To solve this we have to compile cdo by ourselves.\n", "\n", "Uninstal cdo if you have them installed from Ubuntu repositories:\n", "\n", " sudo apt-get purge cdo\n", " \n", "Install netcdf andf HDF5 libraries:\n", "\n", " sudo apt-get install libnetcdf-dev libhdf5-dev\n", " \n", " \n", "Download latest stable version of cdo from [here](https://code.zmaw.de/projects/cdo/files)\n", "\n", "Unpack it\n", "\n", "`cd` to unpacked directory\n", "\n", "If you want to install cdo in to your system directory:\n", "\n", " ./configure --enable-netcdf4 --enable-zlib --with-netcdf=/usr/ --with-hdf5=/usr/\n", " make\n", " sudo make install\n", " \n", "If you don't have administrative rights, of would like to have installation of `cdo` in other folder for any other reason, you can provide prefix:\n", "\n", " ./configure --enable-netcdf4 --enable-zlib --prefix=/dir/where/to/put/cdo --with-netcdf=/usr/ --with-hdf5=/usr/\n", " make\n", " make install\n", " \n", "In the last case you should also add this path to your $PATH in `.bashrc` file:\n", "\n", " export PATH=/dir/where/to/put/cdo/bin:$PATH\n", " \n", "note `bin` at the end!\n", "\n", "Hope it will work for you :)\n" ] } ], "metadata": {} } ] }