NCL > Download

Running NCL under MacOSX

This document contains helpful notes on installing running NCL on MacOSX systems.


Install gcc and gfortran

Open a Terminal window and type the following commands to check if you already have gcc and/or gfortran installed:

   which gcc
   which gfortran

If you don't have them installed, then there are several ways you can get gcc and gfortran installed on your Mac. Here are three of them:

  1. Check if you have a "Developer's Tool" disk that came with your Mac. This may have gcc and gfortran on it.

  2. Download gcc and gfortran from http://hpc.sourceforge.net/.

  3. Use MacPorts to install gcc and gfortran.


Go to list of available NCL binaries on the Earth System Grid

If this is your first visit to the Earth System Grid, a short registration is required. To register, go to:

http://www.earthsystemgrid.org

and look on the right side of the page under "Quick Links" for "Create Account".

Once you have an account, then following these instructions to get to the list of available NCL binaries:

  1. Open a browser to http://www.earthsystemgrid.org.
  2. Click on "NCL: NCAR Command Language".
  3. Look for the largest NCL version number in the list and click on the link.
  4. Select one of the "precompiled binaries" link, unless you want the source code. Choose the "not OPeNDAP-enabled" link if you don't need OPeNDAP capabilities.
  5. Click on "Download Files".
  6. At this point you will need to login with your OpenID. There are instructions on the page. If you forgot your OpenID or password, then click on the "Forgot your OpenID?" link.
  7. Click on the "Accept License" button after if you've read and agreed to the license.
  8. Click on the "Download Individual Files" button.
  9. Go to the next section on how to choose which binary to download.


Choose and download the right NCL binary for your MacOSX system

All MacOSX binaries are 64-bit, even if they have "i386" in the name of the file. This is because they were all built with the "-m64" option with the gcc and gfortran compilers.

If you're not sure what MacOSX binary you need to download, type:

  sw_vers -productVersion
  uname -m

This will echo something like:

  10.6.8
  i386

This would mean you need to download this binary:

  ncl_ncarg-6.1.2.MacOS_10.6_64bit_gcc460.tar.gz

If it echoes something like:

  10.7.4
  x86_64

This would mean you need to download this binary:

  ncl_ncarg-6.1.2.MacOS_10.7_64bit_gcc450.tar.gz

If you have MacOS 10.8, then you can use a MacOS 10.7 binary.


Install (and test) NCL from downloaded binary

See the "Install NCL/NCAR Graphics from a precompiled binary" document.


Issue with 2.7.x version of XQuartz

If you are running MacOS 10.8, or have upgraded your X11 server to be XQuartz 2.7.x, then you may run into an issue with NCL's x11 window, in which all subsequent X11 windows after the first one will not be drawn correctly.

We are hoping that this bug will be fixed by Apple/XQuartz very soon, but meanwhile, if you believe you've run into this bug with our precompiled binary, then you can try "ncl.xq.fix" to see if this fixes the issue. Just use this executable in place of "ncl":

  ncl.xq.fix myscript.ncl
If this seems to fix the problem, then you can make this your default "ncl":

  mv $NCARG_ROOT/bin/ncl $NCARG_ROOT/bin/ncl.bug
  mv $NCARG_ROOT/bin/ncl.xq.fix $NCARG_ROOT/bin/ncl


Increase stacksize limits

Many people running NCL under MacOSX have reported getting segmentation faults on simple scripts. To avoid this, follow one of the steps depending on whether you're running bash (the default) or csh/tcsh:

For bash, put this in your .profile file:

    ulimit -s unlimited

For csh/tcsh, put this in your .cshrc or .tcshrc file:

    limit stacksize unlimited 


Troubleshooting problems

  • If you try to run NCL, and get an error like:

        dyld: Library not loaded: /usr/local/gfortran/lib/libgfortran.3.dylib
    

    Then this may mean that you don't have the same version of gcc/gfortran installed that NCL was built with. You can first try typing:

      locate  libgfortran.3.dylib
    

    to see if this file is already on your machine. If it is, then you may need to set the environment variable DYLD_LIBRARY_PATH to point to the location of this file.

    Otherwise, if you don't have the file, go to http://hpc.sourceforge.net/ and download the latest version of gcc/gfortran.