NCL Website header

Installing NCL from a precompiled binary

This document explains how to download and install NCL using binaries hosted on the Climate Data Gateway website. This website provides several versions of NCL for MacOS, Linux, and Windows running Cygwin.

There are three main steps:


Download the appropriate NCL binary

All of the available NCL binaries are on the Climate Data Gateway website.

Here's the direct link the NCL V6.5.0 binaries.

The list of systems supported for NCL are included below. The compiler versions are included because if you have an older compiler on your system, you may get errors when you try to run NCL that was built with a newer compiler.

Detailed instructions for downloading a precompiled binary:

  • Go to www.earthsystemgrid.org
  • Click on "NCL: NCAR Command Language" (near the bottom of the page).
  • Click on "NCL Version 6.5.0" (or the version you're interested in).
  • Click on whether you want an OPeNDAP binary or a non-OPeNDAP binary.
    If you don't know what OPeNDAP is, then you probably don't need it.
  • Click on "Download Options".
  • Click on the name of the file you want to download, and it should automatically download to your machine.


Extract files from downloaded file to desired directory

The precompiled binary that you downloaded will either be a compressed tar file (ncl_ncarg-6.5.0-xxxx.tar.gz) or a tar file (ncl_ncarg-6.5.0-xxxx.tar) if your system automatically uncompressed it when you downloaded it.

To install NCL from this file, you need to uncompress and untar it into the desired installation directory. When you do this, it will create three directories: "bin", "lib", and "include", which contain executables, library files, various databases, examples, and include files.

As an example, assume the downloaded file resides in resides in a directory called "Downloads" in your home directory and is called ncl_ncarg-6.5.0-MacOS_10.13_64bit_gnu730.tar.gz. Further assume you want to install the software to the directory "/usr/local/ncl-6.5.0".

To extract the files in the desired installation path, type the following from a UNIX Terminal window:

    mkdir /usr/local/ncl-6.5.0
    tar -zxf ~/Downloads/ncl_ncarg-6.5.0-MacOS_10.13_64bit_gnu730.tar.gz -C /usr/local/ncl-6.5.0

If the file is already uncompressed, then simply remove the "z" from the tar command:

    mkdir /usr/local/ncl-6.5.0
    tar -xf ~/Downloads/ncl_ncarg-6.5.0-MacOS_10.13_64bit_gnu730.tar -C /usr/local/ncl-6.5.0

Once this step is finished, you can remove the downloaded file:

    rm ~/Downloads/ncl_ncarg-6.5.0-MacOS_10.13_64bit_gnu730.tar.gz

or

    rm ~/Downloads/ncl_ncarg-6.5.0-MacOS_10.13_64bit_gnu730.tar


Set up environment

  • Set the NCARG_ROOT and PATH environment variables to point to where the software was installed.
  • Set the DISPLAY environment variable to indicate where to display graphics (this step likely not needed).
  • Put a ".hluresfile" file in your home directory (optional).

    Set the NCARG_ROOT and PATH environment variables to point to where the software was installed

    In order to use the software, you must 1) set the NCARG_ROOT environment variable to the parent directory of where the software was installed, 2) add the $NCARG_ROOT/bin path to your PATH environment variable.

    It is best to do this from the appropriate "dot" file in your home directory. A "dot" file is a hidden file which starts with a period. You must use the "-a" option with "ls" to see these files.

    Which dot file you add these settings to depends on which UNIX shell you're using when you login. To determine your UNIX shell, there are several commands you can type on the UNIX command line. Here's a couple of them:

        ps -p $$
        echo $0
    
    Here are some of the possible UNIX shells:

    "sh" Bourne shell
    "bash" Bourne-Again shell
    "csh" C shell
    "tcsh" TENEX shell (C shell compatible)
    "ksh" Korn shell

    To determine which dot file in your home directory to add the environment variables to, type:

        "ls -a ~/"
    
    You might see files like ".bash_profile", ".cshrc", ".tcshrc", ".profile", etc.

    Given your UNIX shell and using "/usr/local/ncl-6.5.0" as an example path, here's which "dot" file to edit and what lines to add (use a UNIX editor to make the changes):

    csh/tcsh (the file might be ".cshrc" or ".tcshrc"):

        setenv NCARG_ROOT /usr/local/ncl-6.5.0
        setenv PATH $NCARG_ROOT/bin:$PATH
    
    bash/ksh (the file might be ".bash_profile" or ".profile" or ".bashrc"):

        export NCARG_ROOT=/usr/local/ncl-6.5.0
        export PATH=$NCARG_ROOT/bin:$PATH
    
    sh (the file might be ".bash_profile" or ".profile"):

        NCARG_ROOT=/usr/local/ncl-6.5.0
        PATH=$NCARG_ROOT/bin:$PATH
        export NCARG_ROOT
        export PATH
    

    You will need to logout and log back in for the changes to take effect.

    Set the DISPLAY environment variable to indicate where to display graphics

    Important note: this step should not generally be required! Your system should be setting this environment variable for you. If your DISPLAY is not set, then something is likely wrong with your login environment, and you should look into this.

    However, if you are getting an error that DISPLAY is not set, and you have an older system or just can't seem to get anything else to work, then keep reading.

    This is not an NCL specific environment variable, but rather one that is used by any X11 Windows application that you run.

    For NCL or NCAR Graphics, this environment variable is needed when you display your graphics to an X11 window, or if you use ictrans, ctrans, or idt to view your NCGM files.

    This variable must be set to the IP address or name of the machine you want to display your graphics on, for example "localhost:13.0" . If you are not running on a remote machine, then you can try setting it to ":0.0". Please contact your system administrator if you are not sure what to set it to.

    For example, from C-shell (csh):

        setenv DISPLAY :0.0
        setenv DISPLAY 128.117.14.12:0
        setenv DISPLAY localhost:13.0
    

    From bash:

        export DISPLAY=:0.0
        export DISPLAY=128.117.14.12:0
        export DISPLAY=localhost:13.0
    

    Put a ".hluresfile" file in your home directory

    This step is not required.

    However, if you want to customize your NCL graphical environment, then see this ".hluresfile" page. At a minimum, you may want to use this file to change things like the default size of your X11 window or the default color table.


    Help on installation

    All questions about installing, building, or setting up your environment should be emailed to ncl-install@ucar.edu. You will need to subscribe first.


  •