Jeff Mangum's MacOSX Discussion Page

TIP Last Update: JeffMangum - 01 May 2009

This wiki page discusses several MacOSX issues (and solutions, I hope) that I have encountered.


MacOSX Resources

Why Can't I...

The following is a list of things that I believe I should be able to do but haven't figured out how to do yet:

  • Display today's date, along with the current time, in the menu bar?
  • Make Finder list directories first, followed by files (seems the only listing option is to list all alphabetically).

Package Installers/Maintainers (DarwinPorts and Fink)

Both DarwinPorts and Fink are package installation/maintenance tools for MacOS. NRAO (Darrell Schiebel) has developed DarwinPorts packages for many applications that many of the NRAO scientists use. Fink is also widely used, including a nice collection of astrophysical packages at Naomi Ridge's page listed above. I describe a few features of both package installers below.


To install/upgrade a package with DarwinPorts:
  1. Connect to afp:// and migrate to the "packages" directory.
  2. Double-click on the package you want to install.
  3. DarwinPorts takes care of the rest.
Default location for executables is /opt/local/bin.

-- JeffMangum - 25 Oct 2005


To install packages with Fink, you need to install and use the FinkCommander. This is a GUI interface to fink packages. Executables are installed in /sw/bin. More details later on this...

-- JeffMangum - 25 Oct 2005

MacOSX Issues

Cisco VPN Client ALERT! (fixed)

This issue fixed with version 4.8.00 (0490) of the Cisco VPN Client.

Using the Cisco VPN client for MacOSX takes some perseverence, I am afraid. At best, the Cisco client is flakey, often refusing to start. When the Cisco client fails to start, you will get a popup message which says:

Error 51: Unable to communicate with the VPN subsystem. Please make sure that you have at least one network interface that is currently active and has an IP address and start this application again.

I often get this error message when I do indeed have an active network connection (dialup). First, make sure that you are starting things using the following sequence:
  1. Start your network connection using the Internet Connect application.
  2. Start a browser application (like Firefox).
  3. Start the Cisco VPN client.

Note that:
  • Exchanging steps 1 and 2 will work also.
  • If you leave your network connection application running but disconnect, you can sometimes reconnect and restart your VPN client without difficulty as long as you still have a browser running. Note, though, that you will generally get the error above when trying to reconnect and restart the client. After doing some googling of this problem, found the internet splattered with complaints about it. Found one solution that worked for me. If you try to restart the VPN client and get the "error 51" message, do the following:

sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart

...and restart the VPN client. You should see something like the following as output from this sudo command:

torgo:~ jmangum$ sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart
Stopping Cisco Systems VPN Driver
kextunload: unload kext /System/Library/Extensions/CiscoVPN.kext succeeded
Starting Cisco Systems VPN Driver
kextload: /System/Library/Extensions/CiscoVPN.kext loaded successfully
torgo:~ jmangum$ 

Seems that the Cisco VPN client for MacOS is a turd. I am currently using version 4.6.04(0061). Reportedly version 4.7 is not an improvement.

-- JeffMangum - 25 Oct 2005

Setting your Default Browser

The following is a real brain-fart on the part of Apple! Short set the default browser within what Apple appears to think the default browser should be...Safari. Go to for the specific instructions. I tried clicking on a link in Thunderbird after making the suggested changes to Safari and indeed it works.

These instructions also point to an additional system preference panel that apparently one can add to set this default, but I will leave it up to the sysadmins to decide whether this is a good thing to add to the default NRAO configuration or now.

-- JeffMangum - 21 Oct 2005

Setting your Default Mail Client

See Default Browser brain-fart above...same story! Short set the default mail client within what Apple appears to think the default mail client should be...Mail. Go to for the specific instructions. I haven't tried this one yet to see if it works.

As was the case with the default browser settings, these instructions also point to an additional system preference panel that apparently one can add to set this default, but I will leave it up to the sysadmins to decide whether this is a good thing to add to the default NRAO configuration or now.

-- JeffMangum - 21 Oct 2005

Some Emacs Issues

The .emacs File

If you use gnu emacs, you likely have a .emacs file for setting certain parameters that you regularly use. Mine dates from the Dark Ages (SunOS), so it could be the case that the one problem I had to fix was related to an outdated syntax. The syntax error I was getting was a complaint about a '?' used where it should not have been. I simply commented-out all of a series of global-set-key commands that I had used since the Dark Ages (global-set-key [?\C-cl] 'load-file, for example). After taking care of this problem, my .emacs file ran just fine.

-- JeffMangum - 22 Oct 2005

Getting ispell to Work

The problem here was that even though I had installed ispell through both DarwinPorts and Fink, emacs just plain would not find it. Finally, found the solution on John Schneiders "Getting Mac OS X 10.3 to Behave Almost Like my Linux Boxes" page. You need to make a symlink from /opt/local/bin/ispell (or /sw/bin/ispell if you Fink installed) to /usr/bin/ispell:

sudo ln -s /opt/local/bin/ispell /usr/bin/ispell

-- JeffMangum - 04 Nov 2005

Mounting External File Systems

Though I have not figured out the syntax for general external file system mounts via NFS and Samba, here is a prescription for mounting /users and /home/nraoweb:
  1. Select Finder -> Go -> Connect to Server.
  2. Enter:
    • "smb://" to mount /users using Samba protocol.
    • "nfs://" to mount /users using NFS protocol.
    • "smb://" to mount /home/nraoweb using Samba protocol.
  3. If you want to save either of these mount points, use the "+" button in the Connect to Servers menu to add it to your favourites.
  4. NOTE: You must use fully-qualified domain names, like, if you want to be able to mount these systems while connected to networks other than NRAO (i.e. your home DSL).

-- JeffMangum - 10 Nov 2005

Setting Up iSync for Palm Devices

If you use iCal and want to sync it with your Palm Pilot, you need to work around a little bug in MacOSX 10.4 (Tiger). The PalmOne website lists a known issue. Taking the steps listed worked for me.

-- JeffMangum - 31 Oct 2005

Gildas Installation

This installation was relatively straightforward once I realized that Gildas motif-based GUIs only run when Gildas tasks are started from within an Xterm. I also had to fix a few minor issues with the current (October 2005b) source installation package that Jérôme Pety helped me through. Note too that I did an installation from source, which I maintain with CVS to keep up-to-date with the (mainly) ALMA-related changes to Gildas. I have not tried the binary installation (also available from the Gildas web site), but I am told that it works too.

In summary, the (known) issues with Gildas are:
  1. You must run Gildas from within an Xterm in order for the motif-based GUIs to work.
  2. If you compiled with the ALMA ATF support (which uses cfitsio), you must set DYLIB_LIBRARY_PATH to the location where libcfitsio.dylib is located. I did this within bash_profile as follows (copying the LD_LIBRARY_PATH setting syntax):
######## ADDED BY JGM #######
if [ "$DYLD_LIBRARY_PATH" = "" ]; then
######## END JGM ADD ########

-- JeffMangum - 09 Nov 2005

Playing Advanced Streaming Format (ASF) Files

I think that ASF files are some sort of Windows streaming video format. QuickTime doesn't seem to support it, but I am told that MPlayer does. There is also a version of WMP that is built for MacOSX, but Josh advises against using it.

-- JeffMangum - 13 Dec 2005

Miriad Installation

ALERT! The following works for MacOSX 10.4.6 and 10.5.6

With much help from Peter Teuben I succeeded in installing miriad under MacOSX 10.4.6 and MacOSX 10.5.6 . Using g95 and gcc 4.0.1 (Xcode version). Following the information posted to:

I was able to eventually install miriad. Note that many of the links and such described in the SMA page are no longer necessary for 10.4.6 (apparently). For now, my solution is somewhat of a hack, as I use my own compile.darwin file with customized library settings. Here is what you need to do after having gotten the tarball (or CVS version) of miriad:

  1. cp $MIR/src/sys/bin/compile.darwin $MIR/bin/localsys
  2. Edit $MIR/bin/localsys/compile.darwin to look like the following. Note that you might have to play with the Flinklib values a bit to suit your situation:
# source'd file compile.darwin, for mac os X
set mmir  = $MIR
set mhost = $MIRHOST
set mlsys = $mmir/bin/localsys
#  also of possible use:
# -finit-local-zero              if you debug code and need initialized data
# -mcpu=i686 -march=i686 -malign-double -ffast-math         architecture opt
setenv Fcompile  "g95"
setenv Foptions  "-O"
setenv FoptionsN "-fno-globals"
setenv Flinkdir  "-L`echo $mmir/lib/$mhost $MIRXLIB | sed 's/ / -L/g'`"
setenv Flinklib  "-lmir -llinpack -lpgplot -lX11 -lm -L/usr/lib -lSystemStubs -l
f95 -lgcc_eh -lSystem -L/opt/local/lib"
setenv Finclude  "-I`echo $mmir/src/inc $MIRXINC | sed 's/ / -I/g'`"
# the gnu compiler actually adds -Dlinux, so we don't need it here
setenv Ccompile  "gcc"
setenv Coptions  "-O -fno-common -DWORDS_BIGENDIAN -Ddarwin"
setenv CoptionsN "-DWORDS_BIGENDIAN -Ddarwin"
setenv Clinkdir  "-L`echo $mmir/lib/$mhost $MIRXLIB | sed 's/ / -L/g'`"
setenv Clinklib  "-lmir -llinpack -lpgplot -lX11 -lf2c -lm"
setenv Cinclude  "-I`echo $mmir/src/inc $mmir/src/subs | sed 's/ / -I/g'`"
setenv Ratty     "$mmir/bin/$mhost/ratty -s f2c -b -D linux"
setenv Intf2c    "$mmir/bin/$mhost/intf2c -s f2c"
if ($?MIRDEBUG)   then
   setenv Coptions  "$Coptions  -g"
   setenv CoptionsN "$CoptionsN -g"
   setenv Foptions  "$Foptions  -g"
   setenv FoptionsN "$FoptionsN -g"
if ($?MIRTESTBED) then
   setenv Coptions  "$Coptions  -DTESTBED"
   setenv CoptionsN "$CoptionsN -DTESTBED"
   setenv Foptions  "$Foptions  -DTESTBED"
   setenv FoptionsN "$FoptionsN -DTESTBED"
   setenv Ratty     "$Ratty -D TESTBED"
if  (-e $mlsys/compile.darwin && ! $?local_compile ) then
  echo $mlsys/compile.darwin exists =======================
  setenv local_compile
  source $mlsys/compile.darwin
unset mmir
unset mhost
unset mlsys
unsetenv local_compile
  1. cd $MIR/install
  2. install.miriad g95=1 telescope=sma
  3. source $MIR/

Note that if you find that you need to work through compiler issues, the easiest thing to do is to:

  1. source $MIR/
  2. mirboss
  3. mir.prog progname

...where progname is the program you are trying to compile.

Fixing-Up Your MIRSRC.darwin Startup Script

ALERT! NOTE: This now appears to be fixed in the CVS version of MIRIAD.

If you are a bash user you will notice that the miriad setup script must be sourced first in your .bashrc file, before any other program setup is done. With some help from PatMurphy the following change to your MIRSRC.darwin file will fix a couple of path assignment errors and make it so your miriad setup can be done anywhere in your .bashrc file:

if [ `echo ":${PATH}:" | grep -c ":\.:"` = 1 ]; then
# Following fix by JGM (with PPM help) to fix path munging...
#  export PATH=`echo ":${PATH}:"|sed "s&:.:&.:${MIRBIN}:&"`
  export PATH=`echo ":${PATH}:" | sed -e "s&:.:&:.:${MIRBIN}:&"`
  export PATH=`echo $PATH | sed -e 's/^://' -e 's/:$//'`
  export PATH=${MIRBIN}:$PATH

The first "sed -e" is trying to assure that ${MIRBIN} comes after any "." in the path. Unfortunately, the original expression was broken (a missing ":"). The second "sed -e" cuts-out the leading and trailing colons.

Installing WIP

Make the following change to $MIR/src/sys/bin/pgm.wip:

#$wipdir/makewip -wip "$wipdir" -pgplot "$libdir" -lib "$libdir" \
$wipdir/makewip -wip "$wipdir" -pgplot "/opt/local/include" -lib "$libdir" \ 

ALERT! The following doesn't appear to be needed to install WIP with miriad version 4.

See Peter Teuben's MacOSX Installation Tips Page for further information. In my particular case, I had to make a some different changes to the /borrow/wip/makewip script. Change the f77lib setting at or near line 586 as follows:

#    set f77lib = ( $f77lib -lg2c )
# Do the following for MacOSX install (see Peter's web page for details)
   set f77lib = ( $f77lib -lf95 -lSystemStubs -lSystem -L/opt/local/lib )

Regarding Compilers

  • The locations of my compilers were as follows:
    • /Users/jmangum/bin/g95
    • /usr/bin/gcc
  • Versions of each compiler as follows:
g95 -v

Using built-in specs.
Configured with: /Users/andy/g95/osx/gcc.osx/configure --enable-languages=c
Thread model: posix
gcc version 4.0.1 (g95!) Oct 17 2005

gcc -v

Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^+.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)

-- JeffMangum - 26 May 2006

Conflict With Applications That Share X-Devices (like MRXVT)?

You many or may not run into the following issue when trying to use the pgplot XWINDOWS device with WIP or Miriad. If you see errors like the following:

%PGPLOT, PGSVP ignored: invalid arguments
%PGPLOT, PGVSIZ ignored: invalid arguments

...and get no output on the graphics window when trying to use the XWINDOWS graphics device in WIP or Miriad, check for other applications that might also be using the X11 server. Here is the specific problem I ran into...

I am using the Apple-distributed version of X11 (X11 1.1.3, XFree86 4.4.0). I also have pgplot 5.2. For my terminal application I generally use an X11-based thing called "mrxvt". When I tried running WIP or Miriad from an mrxvt terminal and tried to also use the XWINDOWS graphics device, I got the errors above, and no output to the graphics device. When I shut-down mrxvt and tried running WIP from an X-term, it worked fine.

Apparently, mrxvt interacts badly with pgplot when they share the X11 server. I then tried restarting mrxvt and running the XWINDOWS device from WIP, and it worked this time. So, this problem is sporatic. Unfortunately, I have no further diagnostic information to share on this problem. You can steer clear of it by just not using mrxvt.

-- JeffMangum - 19 Jan 2007
Topic revision: r25 - 2009-05-01, JeffMangum
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback