Notes by John Nelson G4KLA
6 January 2011
(with acknowledgment to Joe Large W6CQZ for breaking the ground.)
Mac OS X 10.6 (Snow Leopard) differs significantly from Mac OS X 10.5 (Leopard) in that compilations
default to 64-bit operation instead of 32-bit. A new Fortran compiler is needed and must not co-exist
with any previous compiler you might have installed. In addition, some compiler options that were
available previously have now been abandoned. You will need some experience with using Unix commands
but if what follows is too daunting, contact me and I will try and help. (If you want installation
directions for an earlier version of Mac OS X such as 10.4 or 10.5 on either an PowerPC or Intel Mac,
please contact me - email address below.) You need to make sure you have the latest version of the WSJT code.
Please visit the WSJT Home page at http://www.physics.princeton.edu/pulsar/K1JT for details on
how to do this.
Snow Leopard has Python 2.6 installed (64-bit by default) but with old versions of other infrastructure.
We will come to this later. Hint: I suggest you ensure that your path environment parameter contains
the current directory as "."
Note If you already have basic infrastructure installed, go to Step 4.
Step 1. You need to install the Mac Developer Tool - Xcode. Visit
http://developer.apple.com/support/mac/tools and create a (free) ADC account
then visit the Developer Tools in the downloads section and get the latest release
of Xcode Developer Tools. This must be the version for Snow Leopard and will 3.2.3 or later. You will need Fortran.
Step 2. There are several versions that are available but I recommend
http://r.research.att.com/tools. At the time of writing the latest version is
gfortran-4.2-5646.pkg for Snow Leopard. Download this and install.
Step 3. Now you have the basic Mac infrastructure. Next you need support for
python and WSJT code. I suggest you make an installation directory such as WSJT/Installation
into which these various downloads will be kept.
Fast Fourier Transform library Visit http://www.fftw.org and get the latest release which is
currently fftw-3.2.2.tar.gz. A useful way to untar a file and to keep the original download is:
gzip -dc fftw-3.2.2.tar.gz | tar -xvf -
Then:
cd fftw-3.2.2
configure --enable-float CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch -i386 -arch x86_64"
CPP="gcc -E" CXXPP="g++ -E"
make
sudo make install
Numpy Change back to the Installation directory and get numpy as follows.
Visit http://www.scipy.org/Download and get the official release from SourceForge.
This is 1.3.0 and select numpy-1.3.0.tar.gz. Untar this and then (I use tcsh but you can translate this for bash if you must) and
set the envirnoment parameters that are needed to specify the OS X level as well as the architechture of the libraries that will be constructed.
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv CFLAGS "-arch i386 -arch x86_64"
setenv FFLAGS "-m32 -m64"
cd numpy-1.3.0
python setup.py build
(Note: on some builds this procedure fails with a "mathlib" missing error. In this case add an additional parameter
setenv CC "gcc -arch i386 -arch x86_64"
and try the "python setup.py build" command again.)
sudo python setup.py install
This will create /Library/Python/2.6/site-packages/numpy
Scipy Before you install scipy, there is a fix that needs to be made to the basic Mac OS X installation.
An older version of numpy is installed in the /System/Library and scipy cannot be built against this version.
Then
cd /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
sudo mv numpy numpy_old
sudo ln -s /Library/Python/2.6/site-packages/numpy numpy
These two lines rename the numpy directory to numpy_old and then makes a link to the new version of numpy
Now you can get scipy. Change back to the Installation directory.
Visit http://www.scipy.org/Download and get the official release from SourceForge.
This is scipy-0.7.1.tar.gz. Untar this and then:
cd scipy
python setup.py build
sudo python setup.py install
(Other advice can be found at http://www.scipy.org/Installing_SciPy/Mac_OS_X)
Imaging Change back to the Installation directory and visit http://www.pythonware.com/products/pil/
and download the Imaging library (version 0.1.6) for all platforms. Untar this file and then:
cd Imaging-1.1.7
python setup.py build
sudo python setup.py install
libsamplerate Change back to the Installation directory and visit http://www.mega-nerd.com/SRC/download.html
and download libsamplerate-0.1.7.tar.gz. Untar this file and then remove the CC parameter:
unsetenv CC
setenv CFLAGS "-arch i386"
cd libsamplerate-0.1.7
configure
make
sudo make install
portaudio Change back to the Installation directory and visit http://www.portaudio.com/archives/
and download pa_snapshot_v19.tar.gz which is the version I use. There is another v19 issue at http://www.portaudio.com/download.html but I havn't tested this. Untar this file and then:
cd portaudio
configure
make
sudo make install
At this point you can remove the compiler flags, change to the directory containing WSJT code and copy a file containing particular Fortran compiler options into place:
unsetenv CFLAGS
unsetenv FFLAGS
sudo cp gnu.py /Library/Python/2.6/site-packages/numpy/distutils/fcompiler
The basic infrastructure is now installed and you should not need to repeat any of these procedures again. In future, go directly to Step 4 below.
Step 4 At this point you should ensure that Python will be in 32-bit mode. This environment parameter should always be in place when you want to execute WSJT.
setenv VERSIONER_PYTHON_PREFER_32_BIT yes
setenv MACOSX_DEPLOYMENT_TARGET 10.6
Change to the directory containing wsjt code and:
configure_10.6 --with-portaudio-lib-dir=/usr/local/lib --with-portaudio-include-dir=/usr/local/include
make
This should generate the complete package. If you are successful, the final line will read:
mv Audio.so WsjtMod
A special version of the KVASD program has been built for Snow Leopard. This is KVASD_gfortran_Mac. The default code is KVASD_g95 and this has to be
renamed and a link installed to the Mac version.
mv KVASD_g95 KVASD_95_original
ln -s KVASD_gfortran_Mac KVASD_g95
Finally (!!!!) type python wsjt.py and you should be in business.
Last point If you find errors or omissions in this document, or improvements, or need help, please let me know. g4kla at rmnjmn dot demon dot co dot uk