Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search


Getting Up and Running in Mac OS X (Leopard and then Snow Leopard)

Below is my blog on how I configured my Mac Pro (in late 2008, after many years running Linux and Windows). Later sections describe (in reverse-chronological order) my software setups for Linux and Windows. (Section 14 below gives a corresponding reverse-chronological log of hardware purchased and built for my setup.)

1.
Install VMware, which then installed Windows XP unattended!
2.
/usr/bin/chsh -s /bin/tcsh me
3.
sudo scutil -set HostName newhostname.local
4.
Copy Linux versions of ~/.tcshrc and ~/.emacs and customize as needed
5.
Make Caps Lock another Control key (System Preferences / Keyboard & Mouse / Keyboard / Modifier Keys / CapsLock Key: Control)
6.
sudo /usr/libexec/locate.updatedb [Make locate work - Note that this is arguably obsoleted now by Spotlight]
7.
Automate mounting of samba shares as follows (from the Web):
8.
Install X11 from Optional Installs on the Mac OS X installation disk
9.
Download Xcode 3.0 disk image [have to register as an Apple developer]
10.
Change the root password [seems to be required before you can su]
11.
Add known hosts to /etc/hosts as usual [no app seems to own this]
12.
Check out Subversion repo containing my project-independent personal data
13.
Install MacPorts package: http://guide.macports.org
14.
sudo port selfupdate [port installs binaries in /opt/local/bin so add to path]
15.
sudo port install pure q latexdiff latex2html gnupg
16.
sudo port install octave octave-signal octave-audio sox
17.
Octave note: To compile .oct files, add the following lines
CFLAGS="-m32 ${CFLAGS}"
FFLAGS="-m32 ${FFLAGS}"
CPPFLAGS="-m32 ${CPPFLAGS}"
CXXFLAGS="-m32 ${CXXFLAGS}"
LDFLAGS="-m32 ${LDFLAGS}"
in the file /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.2.3 after the "set -e" line. The problem was that in Snow Leopard compilers try always to build in 64bit, while libraries shipped with Octave are 32 bit. The -m32 flag forces the compiler to build 32bit programs. (From http://www-old.cae.wisc.edu/pipermail/help-octave/2009-October/016456.html)

18.
port search octave [to list all Octave packages]
[Update 12/24/2008:]
[Update 6/15/2010:]

19.
sudo port install openssl [wget needed by older octave-forge build]
20.
mv /usr/bin/texi2html /usr/bin/texi2html-HIDE [older octave-forge build needs the version in /opt/local/bin -- haven't checked all the newly separated packages]
21.
sudo port install xpdf [not really needed, but I have scripts that expect it]
If this fails for you, try the following:
port uninstall xpdf
port uninstall poppler
port install -f xpdf +with_poppler
(There is a bug in which both xpdf and poppler want to install the same file. Since xpdf depends on poppler, poppler wins and xpdf refuses to overwrite the file so its installation fails.) I found I had to do this again after the usual ``port selfupdate; port upgrade outdated''
22.
port install qtplay [command-line audio/mp3 player using Quicktime]
23.
port upgrade outdated [from time to time]
24.
Install Carbon Emacs, which was a lot nicer than the port version (which runs in a Terminal window). Best of all, it uses [command] for meta! -- feels completely normal.
25.
Firefox installed from Web download
26.
defaults write com.apple.finder AppleShowAllFiles TRUE [To see .emacs, etc., in Finder]
27.
Install latest Faust:
28.
As an experiment, I tried installing Fedora 9 in a VMware Fusion virtual machine (under the latest Mac OS X). To my surprise, it worked pretty well, except for a few glitches: I also needed to do the following for VMware Tools:
29.
Installed tcsh (my emacs shell) and octave and their dependencies from Cygwin into Windows virtual machine.
30.
Make it easy to reload PDF files in Preview:
http://www.macosxhints.com/article.php?story=2006010200141989
31.
To open .dvi files written by TEX or LATEX, I placed the following script in ~/bin/dvi2pso:
#!/bin/tcsh -f
# convert .dvi to .ps and open in Preview
# mkdir -p /tmp/dvi2pso
dvips -f $1 -o /tmp/dvi2pso/$1.ps
open /tmp/dvi2pso/$1.ps
To my surprise, I could not set this (executable) file to be the opener for all .dvi files. However, I could do this after the following commands:
cd ~/bin
mkdir -p dvi2pso.app/Contents/MacOS/
cd dvi2pso.app/Contents/MacOS/
ln -s ../../../dvi2pso .
It appears the Finder will only allow full fledged applications to open documents. Maybe this is a security thing.
32.
To automatically reload changed PDF documents in Preview (very helpful when writing LaTeX documents, set up the applescript called ``Reload Preview Document 1.0'' by Trevor Harmon. (For this, inspect (via %1) a PDF document and make sure its opening app is Preview.)
33.
port install xfig [I use xfig all the time under Linux, and I export figures in .fig format from Octave using the print -dfig command. This allows further editing, line thickening, etc. The fig2dev program included with xfig is very useful for converting .fig files to either PDF or EPS under Makefile control.]
34.
After some flailing around in xfig, I stumbled upon the following table of equivalences:

Table 1: Left/middle/right mouse-click equivalences
X11   Mac OS X
left-click = click
middle-click = option-click
right-click = command-click $\eqsp $ two-finger click


35.
Install Xquartz = updated X11 for Mac OS X [http://xquartz.macosforge.org/trac/wiki]
36.
svn checkout svn+ssh://ccrma-gate.stanford.edu/~jos/svnrc/l2hsvn/trunk ./l2h; cd l2h; ./configure; make; make install [fix some latex2html bugs that often bite me]
37.
To be able to see the HP LaserJet 1220 printer on my Linux machine, I first tried CUPS printing:
http://www.trollop.org/articles/2007/10/31/linux-printer-sharing-with-mac-os-x-105-leopard/
http://www.wikihow.com/Share-a-Cups-Printer-With-Apple-Mac-Os-X
but this never worked: ``Network host <cups server hostname> is busy; will retry ...''.
I also tried HP IP Printing under the ``More Printers'' button, entering the IP address of the Linux machine manually (since ``Auto'' failed to find it), and no printers were found. What worked was, when adding a printer, to choose the Windows (!) printing button (as opposed to the ``IP'' button), selecting the Linux host, and finally the printer, which was exported on the local net via Samba. (I chose the ``HP laserjet 1220'' driver instead of the ``HP laserjet 1220 Gutenprint'' driver, which I hope was the best choice.) I also selected ``Print Using Generic PostScript Printer.''
38.
To be able to access my HP LaserJet 1220 printer under VMware Windows (on the Mac Pro), I had to first browse to the printer (or at least its host) under ``My Network Places'' / ``View workgroup computers'' which triggered a login on that host. Only after doing that could I successfully browse to the printer under Control Panel / Printers and Faxes / ``Add a printer'' link. Also, this is needed after every time the connection is broken! I call this a Windows XP bug: ``Add a printer'' should trigger the login while browsing in exactly the same way, but it doesn't. The driver choices for the laserjet 1220 were ``PCL'' and ``PS (MS)''. My understanding from a cursory Web search is that the PCL driver is from HP while any ``MS'' driver is a Microsoft ``native driver.'' I chose PCL.
39.
port install gv [I use it to generate 2up and 4up EPS files, among other things]
40.
Add local to the ``Search Domains'' field of the Network preference pane in System Preferences so that ``ssh hostname.local'' works on my local subnet. This works in one direction only: I can access my (fixed-IP-address) Mac Pro from my (dynamic-IP-address) Macbook Pro, but not the other way around. This is quite inconvenient, and I think whoever designed DHCP without reliable automatically exported name support should be reassigned.
41.
port install mpage [Used to print 2-up via the shell alias 'mpage -2 -H -bLetter -f \!* | lpr -l']
42.
cd <faustsource>/Faust/tools/faust2pd-1.0.2; [change q prefix from /usr/local to /opt/local, leave pd prefix unchanged]; make install; make install-pd; ln -s /opt/local/bin/q /usr/local/bin
43.
Download and install 64-bit version of Pd-extended [surprisingly hard to find in a search result!]
44.
Install Tcl/Tk Aqua (standalone version) (Daniel A. Steffen maintains) [To install Wish.app for use with Mac OS X version of Pd-extended]

45.
For testing MIDI patches in Pd-extended, one must add the exported MIDI device(s) under Pd-extended / Preferences / MIDI Settings. Also, IAC Driver must be activated (see below).

46.
Install the Virtual MIDI Piano Keyboard (vmpk):
Mac universal binary vmpk.app obtained from http://sourceforge.net/vmpk/
(could not compile latest CVS because it requires Qt built with Carbon support)
47.
Install (the smaller) MidiKeys 1.7b
but unfortunately it is compiled for PowerPC only! (and no source)
48.
Argh! MIDI connections via software disabled by default!
Enable software MIDI connections by activating the IAC driver:
49.
port install qt4-mac [needed by faust2coreaudio]
50.
port install aspell-dict-en [needed by aspell (don't know how aspell got installed previously, or why it was installed without any dictionaries, thus rendering it useless and confusing]
51.
port install pure-devel [needed by pd-pure-0.4
52.
port install mercurial [needed by next command:]
53.
hg clone http://freehg.org/u/cozzyd/tabsynth/ [graphics-tablet synthesis control]

54.
cd /usr/local/bin; ln -s qmake-mac qmake [no idea why this was necessary, but it makes faust2coreaudio work ok.]

55.
sudo perl -MCPAN -e shell; install HTML::WikiConverter [for a project]

56.
port deactivate libungif; port install qjackctl [messing with faust2jack on the Mac]

57.
Originally I did port install texlive +letter, and this worked for a good while, but eventually (by Nov. 2010) it became broken (texnansi.enc could not be found by dvips). Thus, ...
58.
port remove texlive I reported the problem to trac.macports.org, and was informed that I needed to install texlive-fonts-extra which contains that file. Another option is to install the texlive +full variant, which MacTeX-2010 is said to do internally. For now I am sticking with MacTeX-2010 because it has an unexpected great feature that MacPorts texlive currently lacks: The MacTex version of latex+dvips appears to automatically crop the generated file to the declared papersize. I'm working on a 6x9 book, and was in the habit of cropping in Adobe Acrobat Pro, but now that time-consuming manual step is no longer necessary. Another cool feature worth mentioning is that it installs a System Preferences panel that allows toggling between the use of MacTeX and texlive; that is, they are compatible and do not overwrite each other. In particular, MacTeX installs all of its programs in its own directory /usr/texbin/ (which you have to add to your shell search $PATH.) Next time I have a TeX-related headbutt, I'll be able to easily try the MacPorts version of texlive.

59.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES [make directory paths visible atop Finder windows]

60.
Download and install Deltopia DeltaWalker. This is a passable replacement (on Mac OS X) for Beyond Compare on Windows. It also has some more advanced features than Beyond Compare since it is based on Eclipse. One can also use FileMerge
(/Developer/Applications/Utilities/FileMerge.app) for this purpose, but I find it harder to use. One can also use Beyond Compare from a Windows virtual machine running on the Mac under VMware Fusion, operating on ``shared folders''; however, copying links changes their apparent size so I don't yet trust it. For a quick file diff, I now prefer opendiff from the command line (which uses FileMerge).

61.
man opendiff



Subsections
Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download mycomputers.pdf
[Comment on this page via email]

``My Computers'', by Julius O. Smith III, Web document.
Copyright © 2014-03-25 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA