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 CentOS Linux system.
Please read these instructions all the way through before starting the installation.
- Install or update to Windows 10
- Enable and run the Linux Bash shell
- Install additional packages
- Install and run Xming
- Download NCL
- Install NCL
- Set your environment to run NCL
- Set DISPLAY environment variable
- Test NCL
- Troubleshooting problems
Install or updated to Windows 10In 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 shellOnce 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 packagesBefore 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:
sudo apt-get install fontconfig sudo apt-get install gfortran sudo apt-get install libxrender-dev sudo apt-get install csh sudo apt-get install libx11-dev sudo apt-get install firefox sudo apt-get install gfortran sudo apt-get install imagemagick
Note that the "imagemagick" package is not required, but this software gives you the powerful "convert" command for converting and post-processing graphical images.
Install and run XmingIf 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 NCLNow you are ready to download and install NCL. Open a browser window from the Linux shell (using the above instructions from PC World) and go to the Earth System Grid web site. Navigate your way to NCL Version 6.4.0, either the OPenDAP-enabled or non OPeNDAP-enabled binary page, and download the binary for the 64-bit version of NCL compiled under CentOS 6.8 (ncl_ncarg-6.4.0-CentOS6.8_64bit_gnu447.tar.gz).
Here's a direct link to the OPeNDAP-enabled location of this file.
Install NCLOnce 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-CentOS6.8_64bit_gnu447.tar.gz -C /usr/local/ncl-6.4.0
Set your environment to run NCLEvery user of NCL needs to set their environment before they can use NCL. You can do this by opening the file "~/.profile" or "~/.bash_profile" 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:$PATHPlease 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 variableIn 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 instructions on installing Xming. You can set this variable in the same ~/.profile or ~/.bash_profile that you used for setting NCARG_ROOT.
export DISPLAY=:0You should now be ready to test NCL.
Test NCLTo test your installation of NCL, type the following:
ncl -VThis 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.
Troubleshooting problemsIf 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 displaythen this probably means that your DISPLAY environment variable is not set, or it is set incorrectly. Please type:
printenv DISPLAYand make sure that it is set to what is discussed in the "Set DISPLAY environment variable" section above.