Building from Source on Apple Mac
You will need Xcode, MacPorts, HomeBrew, CMake and, Qt. The Xcode install
instructions are included in the MacPorts documentation.
Xcode
There are two parts to install Xcode one is just to install from the Mac AppStore. Then also from
the command line from the MacPorts website to install needed Xcode utils run the following command
$ xcode-select –install
You will need to agree to the Xcode license agreement by issuing the following command:
$ sudo xcodebuild -license
HomeBrew
Install Homebrew with the following command.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/michaelmorgan/.zprofile
$ eval "$(/usr/local/bin/brew shellenv)"
Then install the following:
$ brew install gcc@9
MacPorts
Install MacPorts from instructions here:
https://www.macports.org/install.php
The ports that need to be installed are:
$ sudo port install autoconf
$ sudo port install automake
$ sudo port install libtool
$ sudo port install pkgconfig
$ sudo port install texinfo
$ sudo port install fftw-3-single +gcc9
$ sudo port install asciidoc
$ sudo port install asciidoctor
$ sudo port install libusb-devel
$ sudo port install boost
$ sudo port install qt5
$ sudo port install qt5-qtmultimedia
$ sudo port install qt5-qtwebsockets
Hamlib
First fetch hamlib from the repository, in this case my fork of Hamlib
3 until the official repository has all the fixes we need:
$ mkdir -p ~/hamlib-prefix/build
$ cd ~/hamlib-prefix
$ git clone git://git.code.sf.net/u/bsomervi/hamlib src
$ cd src
$ git checkout integration
$ ./bootstrap
The integration branch is my system testing branch which has all my
latest published changes.
To build:
$ cd ~/hamlib-prefix/build
$ ../src/configure \
–enable-static \
–disable-shared \
–disable-winradio \
–prefix=$HOME/hamlib-prefix \
CFLAGS=”-g -O2 -mmacosx-version-min=10.7 -I/opt/local/include” \
LIBUSB_LIBS=”-L/opt/local/lib -lusb-1.0″
$ make
$ make install-strip
The above commands will build hamlib and install it into
~/hamlib-prefix. If make install-strip
fails, try make install
.
CMake
Download the latest CMake universal 64-bit DMG from
http://www.cmake.org/download/ open the DMG then drag and drop the
application bundle onto the supplied /Applications link.
To complete the install process you need to run the CMake-gui
application as root from a terminal shell as follows:
$ sudo “/Applications/CMake.app/Contents/MacOS/cmake” –install
WSJT-X
First fetch the source from the repository:
$ mkdir -p ~/wsjtx-prefix/build
$ cd ~/wsjtx-prefix
$ svn checkout svn://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx src
*** For the improved version download the src from sourceforge and put
the files from the downloaded file in the src. In the compressed file
go to the src directory then put the files in wsjtx.tgz in the src
folder at cd ~/wsjtx-prefix/src
this links to the Subversion repository in a read-only fashion, if you
intend to contribute to the project then you probably want to get a
developer login and use a read-write checkout. Even if you don’t it
can be upgraded at a later date.
The checkout is of the latest code on the project trunk, i.e. the
development branch. You can easily switch the checkout to another
branch or even a tag if you want to build a prior published
generation. For now we will build the latest development sources. To
configure:
$ cd ~/wsjtx-prefix/build
$
FC=/usr/local/Cellar/gcc@9/9.5.0/bin/gfortran-9 \
cmake \
-D CMAKE_PREFIX_PATH=”/opt/local/libexec/qt5;~/hamlib-prefix;/opt/local” \
-D CMAKE_INSTALL_PREFIX=~/wsjtx-prefix \
-D CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk \
~/wsjtx-prefix/src
Substitute the Mac OS X SDK version you have installed in the above
command if you have a different version from 10.11.
Also make sure the paths for FC is correct also.
The CMAKE_PREFIX_PATH variable specifies where CMake should look first
for other packages, the two elements may be different depending where
you have installed Qt and what version you have (~/local/qt-macx-clang
if you have built Qt from sources as described above in the Qt
section) and where you installed Hamlib (i.e. the –prefix configure
option above in the Hamlib section).
If you already have the fftw3-dev package installed on your system it
may well get selected in preference to the one you built above in the
MacPorts installation. It is unlikely that a prior installation of
libfftw3f is correctly configured for use in a WSJT-X package, the
CMAKE_PREFIX_PATH above is augmented with the MacPorts installation
location (/opt/local) to ensure the correct libfftw3f.dylib and
headers are located.
To build:
$ cmake –build .
$ cmake –build . –target install
which installs the WSJT-X application bundle into ~/wsjtx-prefix
Updating and Rebuilding Hamlib
From time to time new fixes will be pushed to the Hamlib fork
repository integration branch. To pick them up type:
$ cd ~/hamlib-prefix/src
$ git pull
*** If using improved version download the updated src files like above.
To rebuild hamlib with the changed sources:
$ cd ~/hamlib-prefix/build
$ make
$ make install-strip
Updating and Rebuilding WSJT-X
To update to the latest sources type:
$ cd ~/wsjtx-prefix/src
$ svn update
$ cd ~/wsjtx-prefix/build
$ cmake –build .
$ cmake –build . –target install