NCL Website header
NCL > Download

Running NCL under Linux systems

This document contains helpful notes on choosing the correct NCL precompiled binary for your LINUX machine, and for running NCL on Linux systems:


Choosing the right NCL binary for your Linux system

If you are installing pre-compiled NCL binaries on a Linux system, there are a number of binaries to choose from.

The binary filenames contain the type of Linux it was built on (RedHat/RHEL, Debian, CentOS, SuSE Linux), the "bitness" (32-bit or 64-bit), and which version of the GNU or Intel compilers it was compiled with. The binary filenames look like this:

ncl_ncarg-6.4.0.Linux_RHEL6.4_x86_64_gnu472.tar.gz

The above binary was compiled on a 64-bit RedHat release 6.4 system using GNU compilers version 4.7.2.

If you are not sure which Linux binary to download, we recommend trying one of these two binaries if you need OPeNDAP support:

ncl_ncarg-6.4.0-CentOS6.8_64bit_gnu447.tar.gz
ncl_ncarg-6.4.0-RHEL6.4_64bit_gnu447.tar.gz

or one of these two binaries if you don't need OPeNDAP support:

ncl_ncarg-6.4.0-CentOS6.8_64bit_nodap_gnu447.tar.gz
ncl_ncarg-6.4.0-RHEL6.4_64bit_nodap_gnu447.tar.gz

If you want to download a Linux binary that is close to the kind of system you have, then type the following commands from a terminal window to get the type of system you have (32-bit or 64-bit), the flavor of LINUX you are running (RedHat/RHEL, Debian, CentOS, etc), and the version of gcc and gfortran:

  uname -m
  cat /etc/issue
  lsb_release -d
  gcc --version
For example, if the above commands report "x86_64", "Debian 8", and "4.7.2", then you should download one of these binaries:

ncl_ncarg-6.4.0.Linux_Debian8.6_x86_64_gnu492.tar.gz
ncl_ncarg-6.4.0.Linux_Debian8.6_x86_64_nodap_gnu492.tar.gz

You must match the bitness (32-bit or 64-bit). You can't use an "x86_64" binary on a system whose "uname -m" reports "i686". Secondly it's important to try to match your flavor of Linux if possible, and then match your version of gcc as close as possible.

If your flavor of Linux or "bitness" doesn't match, then you can usually use one of the other ones. For example, if you have a CentOS or Fedora system, then try a RedHat binary. If you have a Ubuntu system, try a Debian binary.

If you run into a problem, please email ncl-install (you must subscribe first).


Dealing with missing libgfortran issue

For most Linux binaries, NCL was built using gcc and gfortran. This may cause a dependency on a file called "libgfortran.so.x".

If you have a different version of gfortran installed on your system than what NCL was built with, then you may get an error message that "libgfortran.so.x can't be found".

If you see this, then you can try one of these things:

  1. Trying googling part of the error message that you're getting, along the flavor of LINUX.c for example, "CentOS cannot open libgfortran.so.1". You will usually get several hits with lots of good suggestions.

  2. Install the version of gfortran that your version of NCL was built with. (It is possible to have multiple versions of gfortran installed on the same system without conflict.)

  3. Try to find the libgfortran.so.x file that it is complaining about. You can try the "locate" command. For example if the file is "libgfortran.so.1":

       locate libgfortran.so.1
    

    If found, you can add this path to your LD_LIBRARY_PATH environment variable. Important note: it is generally recommended that you do not directly set LD_LIBRARY_PATH. If you have to do this, it may mean that gfortran may not be installed correctly on your system, and setting LD_LIBRARY_PATH is just a kludgy work-around. However, if you just can't get it to work, then read on.

    For example, if "libgfortran.so.1" is the file you need, and it is in /usr/local/lib, then look at the instructions below, depending on what shell you are running, and depending on whether LD_LIBRARY_PATH is already set:

       env | grep LD_LIBRARY_PATH
    
    From csh or tcsh, if not set:
        setenv LD_LIBRARY_PATH /usr/local/lib
    
    From csh or tcsh, if already set:
        setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/local/lib
    
    From bash or ksh, if not set:
        export LD_LIBRARY_PATH=/usr/local/lib
    
    From bash or ksh, if already set:
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    
    From sh, if not set:
        LD_LIBRARY_PATH=/usr/local/lib
        export LD_LIBRARY_PATH
    
    From sh, if already set:
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
        export LD_LIBRARY_PATH
    

  4. If all else fails, then send email to ncl-install@ucar.edu. You need to be a member in order to post.


Dealing with missing libxxx.so files

Some of the NCL binaries are OPeNDAP-enabled, which means there are a number of dependencies on shared libraries. If you try to run "ncl" and get one or more errors about not finding "libxxx.so" files, then you can try a few things.

If you don't need OPenDAP support, then you can try downloading a non-OPenDAP enabled binary.

If you need OPeNDAP support, you may need to install the "OpenSSL" software on your system, or find where it resides on your system and point to it.

To look for a particular missing file, try using the "locate" command:

  locate libcrypto.so.0.9.8

If you see the file, then read the previous section on the libgfortran issue to see how to point your LD_LIBRARY_PATH environment variable to this location.

If you can't find this file, then you may need to install OpenSSL on your system.

For example, on some Linux systems, you may be able to type:

  yum install openssl

or

  apt-get openssl
  apt-get install openssl

For further information and more links about where to find software, see the previous section on dealing with the missing libgfortran issue. You may simply need to set your LD_LIBRARY_PATH environment variable, or you may need to install some system libraries.


Installing other software for Linux systems

  • cairo, X11, and other dependent libraries

    - you need an X11 server in order to run ncl and display output to an X11 library, and you need the cairo, X11, and other development libraries in order to build NCL from source code.

    Getting the development libraries on your system depends on what kind of Linux system you have. The commands below are samples of the types of commands you can use to install the required software.

       apt-get install x11-dev
       apt-get install xorg-dev
       apt-get install libx11-dev
       apt-get install libcairo-devel
       yum install libX11-devel
       yum install cairo-devel
    

    If you find other libraries are missing, like "bz2", then you may need additional libraries:

       apt-get install libbz2-dev
       yum install libbz2-dev
    

  • tcsh/csh

    - you need tcsh or csh if you are trying to run one of the shell applications like ng4ex or nhlcc.

    You can install these shells with a command like:

      apt-get install csh
    
    or

      yum install tcsh 
    


If any of these instructions are out-of-date, please send email to ncl-install.