NCL Website header
NCL > Download > Windows notes

Installing and running NCL on Windows 10 Linux Bash shell

[Instructions on installing and running NCL under Cygwin/X.]

This document contains notes on installing running NCL under the Windows 10 subsystem, also known as the Linux Bash shell. We tested these instructions in February 2017, using a Linux binary we compiled on a Debian Linux system.

Please read these instructions all the way through before starting the installation.


Install or updated to Windows 10

In order to use the Linux Bash Shell, you must upgrade to Windows 10, and you must have a 64-bit system. See the next section for more details.


Enable and run the Linux Bash shell

Once you have Windows 10 installed, you need to enable the Linux Bash shell and then run it.

We found this useful article on howtogeek.com. Be sure to read through the section on how to run the bash.exe file, as you will need to do this before reading the next section.


Install additional packages

Before you can run NCL, you need to install some additional packages that NCL depends on. Using Linux makes this easy, because you can use the "apt-get" command to install the required packages.

From the Linux bash window that you opened earlier, type the following commands to install the required packages. You can put multiple packages on one line:

  sudo apt-get install csh libfontconfig gfortran libgfortran3
  sudo apt-get install libxrender-dev libx11-dev libxrender1
  sudo apt-get install libssh2-1 libgomp1
  sudo apt-get install firefox imagemagick

Note that the firefox and imagemagick packages are not required, but useful. Imagemagick gives you the powerful "convert" command for converting and post-processing graphical images.

The above installations can take awhile, so make sure to do this when you're not in a hurry.


Install and run Xming

If you need to use the X11 window option in NCL Graphics, then you will need to install and run an X server. If you are not sure, then we recommend following these instructions anyway.

We found an article in PC World that recommends using the Xming package as an X server. Be sure to read the instructions about setting the DISPLAY environment variable before reading the next section.


Download NCL

Now you are ready to download NCL:


Install NCL

Once you have the *.tar.gz file, decide where you want to install NCL. If you are new to UNIX and don't know where you want to put it, then we recommend installing NCL in the directory like "/usr/local/ncl-6.4.0". We'll use this path in the example below, and will assume that you saved the file to the directory "~/Downloads".

From the Linux bash shell window that you started earlier, type the following commands:

    mkdir /usr/local/ncl-6.4.0
    tar -zxf ~/Downloads/ncl_ncarg-6.4.0-Debian7.11_64bit_gnu472.tar.gz -C /usr/local/ncl-6.4.0

You can remove the ncl_ncarg-6.4.0-Debian7.11_64bit_gnu472.tar.gz file once the above commands are done.


Set your environment to run NCL

Every user of NCL needs to set their environment before they can use NCL. You can do this by opening the file "~/.profile" or "~/.bashrc" with a UNIX editor (vim, nedit, emacs, etc) and adding the lines:

    export NCARG_ROOT=/usr/local/ncl-6.4.0
    export PATH=$NCARG_ROOT/bin:$PATH
Please note that you must use a UNIX editor to change this file. If you are unfamiliar with UNIX editors, we recommend that you use nedit, which you can install via "sudo apt-get install nedit".


Set DISPLAY environment variable

In order to run any X applications, including running NCL to display graphics to your screen, you may need to set the DISPLAY enviroment variable, as described in the earlier Xming instructions. You can set this variable in the same ~/.profile or ~/.bashrce that you used for setting NCARG_ROOT.

    export DISPLAY=:0
You should now be ready to test NCL.


Test NCL

To test your installation of NCL, type the following:

    ncl -V
This should echo the version of NCL, like "6.4.0".

For a graphical test, type:

    cp $NCARG_ROOT/lib/ncarg/nclex/xyplot/xy04n.ncl .
    ncl xy04n.ncl

A window with an XY plot should pop up. If you click anywhere in the window with your left mouse button, the window will go away.

If you have problems, then please review the troubleshooting section that follows.


Troubleshooting problems

If you are having problems running the test in the above section, then here are some troubleshooting tips:

  • If you get an error about "ncl" not being able to find a missing "libxxxx.so" library, then try using the "apt-get" command to install that library or package.

  • If you get the error:

     warning:GKS:GOPWK: --X driver error: error opening display
    
    then this probably means that your DISPLAY environment variable is not set, or it is set incorrectly. Please type:

    printenv DISPLAY
    
    and make sure that it is set to what is discussed in the "Set DISPLAY environment variable" section above.

If you still have problems, then send email to ncl-install@ucar.edu. You need to be a member in order to post.