Installing NCL under MacOSX
If you plan to run NCL under MacOSX (PowerPC or Intel), you may need to install some other packages first. On newer Macs, these packages may already be installed, so check on this first before you start. If possible, install these packages as root, and install them to the suggested locations.For people doing scientific research on their Macs, there's a nice community website called MacResearch. This contains information on compilers, software, reviews, tutorials, etc.
Here's a full checklist for installing NCL/NCAR Graphics on your Mac:
- Install the MacOSX Developer Tools
- Install fink
- Install an X server
- Install Fortran compiler
- Download and install NCL
- Increase stacksize limits
- Set up your environment to run NCL
- Run X server
- Test NCL
- Fix possible problems
Install the MacOSX Developer Tools
The developer's tools will provide you with the "gcc" C compiler, among other things. They should be on a CD, or you may already have a Developers Tools directory. If you have a directory, cd to that directory, and search for a PDF file that will contain instructions on how to install the Developer's Tools.
If you don't have the directory or the CD, you can get the Developer's Tools from the http://connect.apple.com site. (You may need to create an account with them first.) Once you are logged in, click on "Download Software", and then "Mac OS X". You should then see a link for downloading the Developer's Tools.
Even if you aren't planning to install NCL, fink is a must-have application for MacOSX users. In the words of the fink developers, fink "makes existing Open Source software easily available to casual users as a coherent, comfortable distribution that matches what Linux users are used to".
To install fink, go to http://fink.sourceforge.net and click on "Download" on the left. Follow the instructions under "Quick Start". Basically, you just download the binary installer that they have a link to, and then click on the resultant "Fink-x.x.x-Installer.dmg" file that should be on your root window. Follow the rest of the instructions to make sure your fink environment is set up correctly.
Be sure to run:
fink selfupdate-cvs
to make sure all of the packages are up to date.You can either install X11 for MacOSX, which should be on one of the installation disks that came with your Mac, or you can install the fink xfree86 package. We highly recommend installing the one that comes with your Mac.
According to instructions on an Apple developer's website:
X11 is available as an optional install on the Mac OS X v10.3 Panther, and Mac OS X v10.4 Tiger install disks. Run the Installer, select the X11 option, and follow the instructions. You should install the X11 SDK as well, which is included on the Panther Developer CD. If you intend to download X11 source code and build your own binaries, you will need the tools and headers included in the SDK.If you can't find your installation disks, or don't want to install that version of X11 for some reason, here's how to install the fink version:
fink install xfree86
If you install Apple's X11, be sure to run:
fink install system-xfree86
so fink will know about it.Install Fortran compiler (needed if you plan to build NCL/NCAR Graphics from source code, or if you plan to use WRAPIT to create your own Fortran extensions)
There are a number of Fortran compilers you can try. Depending on what kind of system you have and what version of MacOS you're running, you can install free compilers like gfortran, g95, or g77 (being phased out). You can try using fink:
fink install gfortran
fink install g77
or else you can try their websites for precompiled binaries. If you
build a Fortran compiler from source, this may take awhile, so grab
some lunch or go see a movie.
We've had other people use Intel and Absoft compilers on their Macs as well. These are not free.
If you haven't already, download the NCL binary for MacOSX from the Earth System Grid web site. The full instructions can be found here.
Many people running NCL under MacOSX have reported getting segmentation faults on simple scripts. To avoid this, add the line:
limit stacksize unlimited
to your .tcshrc/.cshrc (or equivalent) file, and then log out and log
back in.Set up your environment to run NCL
It used to be you had to set up your NCARG_ROOT environment variable before you could run NCL. If the previous step was successful, however, the environment variable should be set for you automatically. Just log out and log back in, or open a new terminal window to make sure your environment gets set up correctly.
In order to run NCL and display the output to an X11 window, you must first be running an X server. If you installed "XonX", then double-click on the red X to start the X server. Then, from within this X server, you can run NCL and display to the screen.
To test your installation of NCL, type the following:
ng4ex xy01n -clean
An X11 window with an XY plot should pop up. If you click on the
middle of the window with your left mouse button, the window will go
away.If you have problems, then review the next section, "Fix possible problems" and then try the test again. If you continue to have problems, save any error messages to a file and email the contents of the file to Mary Haley.
- If you find that NCL is causing a segmentation fault when you run
it, you may need to increase your stacksize. To do this, add the line:
limit stacksize unlimitedto your .tcshrc file, and then log out and log back in.