Installing various
useful tools for the Mac OS X
|
This is a quick
list of things I do when setting up a Mac, and is meant for internal
reference.
Eric Salathe has a more comprehensive list at http://www.atmos.washington.edu/~salathe/osx_unix/
Also Andy
Jacobson has a good list at http://tazman.princeton.edu/osx/
Changing the default shell
The default shell
type in OS X is bash, whereas on the seismo Suns it
is tcsh. To make things simpler I usually make
the default tcsh. To do this:
1. In the Applications/Utilities folder, start up NetInfo Manager
2. Click on _users_ and then your user login
3. Click the lock to make changes
4. In the _shell_ property, change to /bin/tcsh
5. Click the lock again and exit
Changing uid in OS X
[Skip this step for now – this is a placemarker
for future implementation]
In future when
the Macs are mounted onto the Sun drives, this will be necessary.
Instructions, courtesy of Eric Salathe, are here:
http://www.atmos.washington.edu/~salathe/osx_unix/change_uid.html
To find out your uid on the Suns, type this (on the Sun of course)
id <login name>
Install X11
[Contributed by Andrew Friedman]
X11 is automatically installed with 10.5. The latest (unsupported)
updates are at http://trac.macosforge.org/projects/xquartz/wiki/Releases
If
you have OS 10.4:
1. Go to http://xanana.ucsc.edu/xtal/x11.html
2. Download X11.app and SDK for 10.4
3. Install both X11User.pkg and X11SDK.pkg
4. Go to the Applications/Utilities folder and pull the X11
icon over to the desktop dock
5. NOTE: to tunnel X11 windows through ssh
on a mac you need to use "ssh
-Y"
6. (suggested by Charlie Koven) add the following lines to your .cshrc
file so that you can use X11 from terminal.app:
if ( $?DISPLAY
== 0 ) then
setenv
DISPLAY :0.0
endif
To use X11 remotely [contributed by Charlie Koven]
To use X11 programs when logging in from another computer, you
need to set up ssh and sshd to forward the X11 connections. To do this, you have
to modify two files: /etc/ssh_config and /etc/sshd_config
/etc/ssh_config has a line that
initially says:
# ForwardX11 no
change this line (you have to use sudo to do
it) to:
ForwardX11 yes
(make sure you delete the # at the start
of the line)
/etc/sshd_config has a line that says:
#X11Forwarding no
change it to:
X11Forwarding yes
(again you need to sudo
and make sure to delete the #)
Then
restart the computer (or restart the ssh daemon using
kill -HUP `cat /var/run/sshd.pid') and you should be
able to use X11 programs through your ssh
connection.
Install Xcode developer
tools
1. Go to http://developer.apple.com/tools/xcode/
2. Click on Tools Download
3. If you aren_t registered yet,
register – its free
4. Download Xcode 3.0 DMG and install
if you have 10.5
5. If you have 10.4 instead, download Xcode
2.5 DMG. Also download the Xcode Legacy tools – found below – for packages that need
gcc3.1 to build
Install MacPorts
(contributed by Andrew Friedman)
1.
Download MacPorts at www.macports.org
2.
Add /opt/local/bin and /opt/local/sbin to your path
Optional:
You can try adding /opt/local/man to your MANPATH, but this may cause
conflicts.
Porticus
is a free graphical interface for MacPorts: http://porticus.alittledrop.com/
Install NETCDF
Before you
do, check to see if netcdf has been installed
already. A typical location is /usr/local/netcdf_.
If it is in there already, there is no need to install – you just need to make
sure that your applications can see it (see step 4)
OTHERWISE:
you can either go through MacPorts, or install
prepackaged binaries from the netcdf website.
Instructions for MacPorts
(contributed by Andrew Friedman):
Type 'port install netcdf' in the command
line.
If
you are running OS 10.4 or earlier, you may need to install the prepackaged
binaries from the netcdf website.
Instructions for prepackaged binaries:
1. Go to http://www.unidata.ucar.edu/software/netcdf/binaries.html. The current compiled version will be called
something like _darwin_...._macintosh_
2. Download it, and unzip (it should do so automatically; if
not, use _unzip_ to unzip and _tar xvf ?_ to untar.
3. You_ll see a folder called something like _netcdf-3.6.1_.
These contain the binaries of netcdf. You can
put them anywhere you like, so long as your applications know where they
are. If you don_t have admin status, you_ll have to put it somewhere in your home
directory. If you have superuser,
/usr/local/netcdf-3.6.1 (or whatever it is called) is typical
4. Make sure that the netcdf binaries
can be accessed: in .cshrc
in your home directory (make one if you don_t have
one), add these lines (anywhere):
setenv PATH /usr/local/netcdf-3.6.1/bin:$PATH
setenv NETCDF_LIB /usr/local/netcdf-3.6.1/lib
setenv NETCDF_INC /usr/local/netcdf-3.6.1/include
To
activate this immediately, type _source .cshrc_.
In subsequent logins, it_ll automatically read the .cshrc to modify the
PATH (to check, do an _env_ in the command
line)
5. You can check to see that netcdf works by doing a _ncdump_
on a netcdf file.
Install NCO (netcdf operator)
These
contain useful utilities for netcdf files. Using MacPorts,
type 'port install nco' in the command line.
Matlab
Installation
1. Install X11 BEFORE installing Matlab
2. If a previous matlab version is
installed, uninstall it. For uninstall directions, go to http://www.mathworks.com/support/solutions/data/1-19VJS.html?solution=1-19VJS
3. Install Matlab disks. You_ll need the current license file for group use (the
installation will ask for it), please ask Charley Paffenbarger
for them. The current MATLAB version is R2006a; you_ll
need the appropriate license version for them.
Matlab Netcdf Toolbox
1. Go to http://mexcdf.sourceforge.net/ and click on _download instructions_
2. Download the SNCTOOLS and netCDF
Toolbox. I generally download both even though they say one is OK. Untar it, and create a subdirectory in your home directory
called Matlab (so: /Users/<yourlogin>/Matlab/). Move the snctools
and netcdf_toolbox subdirectories there.
3. Download precompiled MEXNC. Generally, find the latest
version for OS X. It may not be the one for your version of MATLAB, but
it should work. Untar, and then move the
subdirectory to /Users/<yourlogin>/Matlab/.
4. Start MATLAB, and type _pathtool_.
You_ll see a window with a couple of paths.
Click on _Add with Subfolders_ and add the /Users/<yourlogin>/Matlab/ path into it. Save.
5. This should be it!
MATLAB mapping utility: M_MAP
http://www.eos.ubc.ca/~rich/map.html
See the website
for installation instructions.
Basically, you need to get the matlab
subroutines and make sure the path to them is visible to MATLAB.
Grads
This is a useful
mapping program made by COLA/IGES. To install:
1. Download the binaries (full distribution) from http://www.iges.org/grads/downloads.html
2. Untar – you_ll see a grads folder
called grads-xxx (xxx=version)
3. You can place this folder anywhere, but I usually move the
grads-xxx folder to /usr/local/.
4. Modify the .cshrc
file by adding these lines:
setenv PATH
/usr/local/grads-1.9b4/bin:$PATH
setenv GADDIR
/usr/local/grads-1.9b4/data
5. I_m also used to calling GRADS by typing _grads_ so I also put
an alias in .cshrc:
alias grads gradsnc
6. That should
be it!
Ferret (suggested by Charlie Koven)
Andy Jacobson has
a version of ferret for osx.
Latex (suggested by Charlie Koven)
·
Install all the
latex binaries (either through Fink, or through I-installer. The advantage of I-installer is that it installs the latex
binaries in directories that Texshop and Latex
Equation Editor expect; if you only have the fink version you will have to
change the paths in the preferences boxes of those applications.)
·
Then get TexShop
as a front end.
·
And get bibdesk
for managing your bibtex database. It does most of what you’d use Endnote
for, and its free.
·
To avoid powerpoint not displaying equations properly, use Latex Equation Editor
as a substitute for the MS equation editor: it transforms latex code into
either .pdf or .tiff files
(which you can put in your powerpoint and trust that
they'll work).
Aquamacs Emacs (suggested by Charlie Koven)
·
An aqua-native
version of emacs, called aquamacs emacs. Nicer looking than the X11 version. If you use it, but you want to be able to
open documents from the command line, add the following line to your .cshrc:
alias
emacs "open -a /Applications/Aquamacs\
Emacs.app/ "
iTerm (suggested
by Charlie Koven)
Textwrangler (suggested
by Abby Swann)
a great free text editor: a quote from their website: “Among
other things, it can open files from (and save them) to remote FTP servers,
offers a significantly more powerful grep engine,
supports multi-byte and non-Roman text files, can perform Find Differences on
pairs of files, and can be invoked from the Unix command line”
http://www.barebones.com/products/textwrangler/