View this page in Romanian* | German | Russian | Slovakian translation created by Sciologness Team
There's already a lot of OS X stuff on the web. This page is simply a cookbook of how I used those resources to put together my system. What follows is intended to be step-by-step instructions for new users to set up their OS X Mac to work in a Unix environment. As such, it is not for everyone. I also don't intend to be comprehensive in listing all the resources that are dealt with elsewere, but do point to links where relevant.
I have not updated for each OS X release, but most things here are generic to any release since 10.2
For current HPC resources for OS X, see http://hpc.sourceforge.net/.
OS X puts all the standard commercial software tools (Word, Illustrator, Matlab) and a unix programming environment seamlessly into a single box. This poses many advantages to scientific programming relative to other desktop systems based on Windows, Linux, or Unix. While many unix and linux packages exist for document preparation, there are many reasons one might want to have access to the standard commercial tools that run only on Windows and Macintosh computers (eg, from Microsoft and Adobe). In the past, however, integrating these computers into the primary computing system has been awkward.
OS X's unix core allows nfs mounts, X windows, and most of the common Unix/Linux software tools can be run on the Mac so the Mac can be just another Unix computer. Fortran or c code can be directly shared between the mac and other platforms. So, one needs no longer to decide between having a unix system or a office system on one's desk; OS X does both.
Apple has a page on Unix development, which is a good place to start.
As shipped, OS X is setup for the non-technical traditional Mac user, not like a unix box. System administration is also not exactly the same as a unix box. So, a few extra steps need to be made to get it to all work.
Here are the things I needed to do to make my Powerbook function for me using open-source tools. There may be better ways around, but without much documentation, this is what I needed to do. (Wherever I give command-line instructions (ie within the shell by running Terminal), the % sign is the prompt for a normal user. The sudo command gives you administrator privileges and can only be run by someone in the admin group.)
Set uid to match uid on existing unix network
Set up nfs mounts to existing unix network
Install X windows.
Apple supplies an X11 emulating application, but it is not part of the standard installation. If installing from CDs, choose a custom installation and you will be given the option for X11. For new computers, an X11 installer is probably somewhere on the hard drive.
You can also run Xfree86 from the fink project (see below).
Install fortran and c compilers
Dealing with binary data
The Mac uses a different binary format from Intel, AMD, and Alpha systems. The G4 uses so-called "big endian" byte order, as do most other Unix platforms. x86 (Intel, AMD) and Alpha (Dec/Compaq/HP) use "little endian". This can cause problems with sharing binary data among platforms. The best solution is to use a platform-independent self-describing format such as netCDF or HDF or even gzipped ascii.
NetCDF is available for OS X from the above link or from fink These OS X ports only support the fortran-77 interface via g77. If you use a commercial fortran-95 compiler, such as NAGware, compile yourself according to these instructions in order to get the f90 interface.
HDF is also available for OS X from HDF web site linked above or fink.
For dealing with raw binary, read this article.
Optimized math libraries.
If you do any matrix operations on a G4/G5, you'll want to use LAPACK and BLAS libraries that take advantage of the vector processor.
Macs are now included in the Automatically Tuned Linear Algebra Software (ATLAS) package. There is even a precompiled G4 library here. ATLAS contains a full tuned BLAS and a partial LAPACK.
Since OS X 10.2, Apple includes optimized ATLAS/Lapack libraries in the vecLib framework.
Both NAG f95 and g77 accept the -framework veclib flag to link to veclib. Eg:
% f95 -o prog prog.f90 -framework veclib
Absoft has directions here.
Install other tools as needed. Complete lists exist elesewhere on the web, such as:
Here's some specific stuff I like:
Emacs text editor:
I've found that the best emacs for OS X is the GNU Emacs in it's new carbon version. This is just beginning to be supported, so there are no official binaries. Your best bet is to build it from source or try to find a reasonably current binary on line.
Two good binary downloads are linked by Apple:
To build from source, download the source from CVS:
setenv CVS_RSH "ssh" cvs -z3 -d:ext:firstname.lastname@example.org:/cvsroot/emacs co emacs > cvs.outand compile:
cd emacs ./configure --enable-carbon-app --without-x >& configure.err make bootstrap >& make.err
NetCDF: This is an essential package for atmospheric science datasets. If you use g77, you can get it from fink. If you use a fortran90 compiler, you'll need to download the source from and build it yourself. It builds nicely with NAG f95 following this proceedure.
Plotting atmospheric data fields:
NCAR Graphics is available as pre-built binaries. These use g77, but can be used with XLF or NAG compilers if you include the g2c library when you compile (ie add -lg2c).
Adobe Illustrator. EPS files from Grace, GrADS and NCAR Graphics (eps or cgm) are easily opened and edited with Illustrator.
Microsoft Office. Adobe eps files can easily be incorporated into word documents.
Set up printers. You can add networked lpr printers hanging off unix boxes using Print Center if the printers don't support Appletalk. If PrintCenter crashes, then read fixes for Print Center.
Many of the popular tools used by atmospheric and ocean scientists for data analysis and visualization are available on OS X. These include:
Student version $99, Commercial package $1,900 - Many plugins available
Free binary download. The fortran libraries are built using g77, but can be used with XLF or NAG compilers if you include the g2c library when you compile (ie add -lg2c) and the -qextname flag for xlf.
NCAR Graphics is a Fortran and C based software package for scientific visualization.
Free binary download
NCL is a programming language designed specifically for the analysis and visualization of data
Free binary download
The Grid Analysis and Display System (GrADS) is an interactive desktop tool that is used for easy access, manipulation, and visualization of earth science data
free source download
NetCDF (network Common Data Form) is an interface for array-oriented data access and a freely-distributed collection of software libraries for C, Fortran, C++, Java, and perl that provide implementations of the interface. NetCDF is the standard format for distribution of atmos and ocean data worldwide.
Free source code download
Vis5D is a software system that can be used to visualize both gridded data and irregularly located data. Sources for this data can come from numerical weather models, surface observations and other similar sources.
Free binary. OS X support is only partial/beta
Ferret is an interactive computer visualization and analysis environment designed to meet the needs of oceanographers and meteorologists analyzing large and complex gridded data sets.