1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
|
// Status=edited
= Building from source
This guide is for developers building _WSJT-X_, _MAP65_, or _QMAP_ from
source. To install and operate a released version instead, use the platform
packages from the https://github.com/WSJTX/wsjtx/releases[official GitHub
Releases page].
== Know which build you need
The same source can be built for several different purposes. Choose the
simplest path that answers your question:
[%autowidth]
|===
| Goal | Appropriate path
| Edit, compile, and test locally
| Use the platform package manager and the instructions in this chapter.
| Exercise an installed layout or create an unsigned package
| Complete the local build, then use the CMake `install` or `package`
target.
|===
External contributors should fork the public repository; core team members
should use the private development branch assigned to their work. The
https://github.com/WSJTX/wsjtx/blob/master/CONTRIBUTING.md[contribution guide]
explains the repository model and pull-request workflow.
== Common requirements
All platforms require:
* Git and CMake 3.20 or later for the commands as written. The project
configuration retains CMake 3.12 as its minimum for older build
environments. With CMake 3.12, replace `cmake -S . -B build` with
`mkdir -p build && (cd build && cmake ..)`. With CMake 3.12 through 3.19,
replace `ctest --test-dir build --output-on-failure` with
`(cd build && ctest --output-on-failure)`.
* Qt 5 Core, Widgets, Network, Multimedia, SerialPort, PrintSupport, Sql,
LinguistTools, and WebSockets; Test when developer tests are enabled; and
ActiveQt AxContainer on Windows
* C and C++ compilers with C++17 support
* a Fortran compiler, normally `gfortran`
* FFTW 3, including the single-precision `libfftw3f` library
* Boost, libusb, and PortAudio
* the Hamlib revision selected by the project's CI configuration
CMake enables developer tests and User Guide generation by default. User Guide
generation requires Asciidoctor. If you do not need the local guide, configure
with `-DWSJT_GENERATE_DOCS=OFF`.
Use an out-of-source build directory. This keeps generated files out of the
source tree and makes a clean reconfigure as simple as choosing a new directory.
[[SRC_WINDOWS_MSYS2]]
== Building on Windows with MSYS2
The supported Windows developer environment is *MSYS2 MINGW64*. MSYS2 supplies
the compiler, Qt, CMake, and most libraries through its signed package
repositories. WSJT-X builds the CI-selected Hamlib revision separately.
The project intentionally uses MINGW64 as its current Windows compatibility
contract. Do not substitute the MSYS, UCRT64, CLANG64, or another MSYS2 shell:
package names, binary formats, paths, and supported Windows APIs can differ.
NOTE: The MSYS2 Boost package is suitable for local development. Official
Windows builds use a separate Boost configuration to support older
Windows versions; see `.github/workflows/build-windows.yml`.
=== Install and update MSYS2
. Download and run the installer from https://www.msys2.org. The default
location, `C:\msys64`, is suitable.
. Open the *MSYS2 MINGW64* shell.
. Update the base system:
[source,bash]
----
pacman -Syu
----
MSYS2 may ask you to close the terminal during a core update. Close it, reopen
*MSYS2 MINGW64*, and run `pacman -Syu` again until no further core update is
required.
Every command in the remainder of the Windows section runs in that MINGW64
shell. Confirm the environment before installing packages:
[source,bash]
----
echo "$MSYSTEM"
----
The result must be `MINGW64`.
=== Install the local-development dependencies
Install the compiler, build tools, and libraries:
[source,bash]
----
pacman -S --needed \
git make tar autoconf automake libtool \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-gcc-fortran \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-qt5-base \
mingw-w64-x86_64-qt5-multimedia \
mingw-w64-x86_64-qt5-serialport \
mingw-w64-x86_64-qt5-svg \
mingw-w64-x86_64-qt5-tools \
mingw-w64-x86_64-qt5-websockets \
mingw-w64-x86_64-qt5-activeqt \
mingw-w64-x86_64-fftw \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-libusb \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-portaudio \
mingw-w64-x86_64-pkg-config
----
User Guide generation is enabled by default. Install Ruby and Asciidoctor if
you want the guide included in the build:
[source,bash]
----
pacman -S --needed mingw-w64-x86_64-ruby
gem install asciidoctor --no-document
----
If you skip these tools, add `-DWSJT_GENERATE_DOCS=OFF` to the CMake command in
the configure section. The application and automated tests do not require a
locally rendered User Guide.
NSIS is required only when creating an unsigned Windows installer:
[source,bash]
----
pacman -S --needed mingw-w64-x86_64-nsis
----
Check that the MINGW64 programs, rather than programs from another Windows
toolchain, will be used:
[source,bash]
----
missing_tools=0
for tool in gcc g++ gfortran cmake qmake-qt5 dumpcpp-qt5; do
command -v "$tool" || { echo "MISSING: $tool"; missing_tools=1; }
done
if test "$missing_tools" -eq 0; then
gcc --version
gfortran --version
cmake --version
else
echo "Install the missing tools before continuing." >&2
false
fi
----
The MinGW programs should resolve under `/mingw64/bin`. Do not continue until
the check reports a path for every tool and no `MISSING` line.
=== Clone the source
Clone from inside the MINGW64 shell. These commands use a predictable workspace
under the MSYS2 home directory:
[source,bash]
----
mkdir -p ~/wsjtx-dev
cd ~/wsjtx-dev
git -c core.autocrlf=false -c core.longpaths=true \
clone https://github.com/WSJTX/wsjtx.git src
cd src
git config core.autocrlf false
git config core.longpaths true
----
Keeping automatic CRLF conversion disabled prevents generated version metadata
from treating an unchanged checkout as modified. Long-path support accommodates
deep source and generated-file names used by the Windows build.
External contributors should clone their fork instead and add
`https://github.com/WSJTX/wsjtx.git` as the `upstream` remote. Core team
members should use the private repository and the development branch assigned
to their work.
=== Install OmniRig
Install https://www.dxatlas.com/OmniRig/[OmniRig] in Windows. The usual
location is
`C:\Program Files (x86)\Afreet\OmniRig\OmniRig.exe`. WSJT-X does not link
against OmniRig at build time, but `dumpcpp` reads the COM type library
embedded in this executable to generate the ActiveQt interface.
MSYS2 installs this tool as `dumpcpp-qt5`. The build finds that name directly;
do not copy or rename it to `dumpcpp`.
=== Build the CI-selected Hamlib revision
The CI configuration selects the Hamlib revision supported by this WSJT-X
source. Read it from the checked-out tree rather than assuming that the newest
Hamlib branch is compatible:
[source,bash]
----
cd ~/wsjtx-dev/src
HAMLIB_BRANCH=$(awk -F'"' '/hamlib_branch:/ {print $2; exit}' \
.github/workflows/ci.yml)
if test -n "$HAMLIB_BRANCH"; then
echo "Building Hamlib $HAMLIB_BRANCH"
else
echo "hamlib_branch is missing" >&2
false
fi
----
If this check fails, inspect the `hamlib_branch` setting in
`.github/workflows/ci.yml` before continuing.
[source,bash]
----
cd ~/wsjtx-dev
git clone --depth 1 --branch "$HAMLIB_BRANCH" \
https://github.com/Hamlib/Hamlib.git hamlib-src
cd hamlib-src
./bootstrap
./configure --prefix="$HOME/wsjtx-dev/hamlib-prefix" \
--enable-shared --disable-static \
--without-cxx-binding --without-readline \
CFLAGS="-DNDEBUG -g -O2 -fdata-sections -ffunction-sections" \
LDFLAGS="-Wl,--gc-sections"
make -j"$(nproc)"
make install-strip
----
This creates an isolated Hamlib installation under
`~/wsjtx-dev/hamlib-prefix`; it does not replace another Hamlib installation
on the computer.
If the CI pin changes, remove or rename `hamlib-src` and
`hamlib-prefix`, then repeat this section. A shallow clone made for an older
tag may not contain the new revision.
=== Configure and build WSJT-X
Return to the source tree and configure a local developer build. The normal
build includes WSJT-X, MAP65, and QMAP; add `-DWSJT_SKIP_QMAP=ON` to omit QMAP.
[source,bash]
----
cd ~/wsjtx-dev/src
OMNIRIG=$(cygpath "C:/Program Files (x86)/Afreet/OmniRig/OmniRig.exe")
cmake -G "MSYS Makefiles" -S . -B build \
-DCMAKE_PREFIX_PATH="$HOME/wsjtx-dev/hamlib-prefix" \
-DCMAKE_INSTALL_PREFIX=C:/WSJT \
-DOMNIRIG_TYPE_LIB="$OMNIRIG" \
-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -std=legacy" \
-DWSJT_SKIP_MANPAGES=ON \
-DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \
-Wno-dev
cmake --build build -j"$(nproc)"
----
CMake 4.4 may report that `-Wno-dev` is deprecated. This notice is harmless;
the guide keeps the option because it also works with the documented older
CMake versions.
The important options are:
[%autowidth]
|===
| Option | Purpose
| `CMAKE_PREFIX_PATH`
| Locates the Hamlib installation built above.
| `CMAKE_INSTALL_PREFIX`
| Selects the destination used by the install target.
| `OMNIRIG_TYPE_LIB`
| Identifies the OmniRig executable whose COM type library `dumpcpp` reads.
| `CMAKE_Fortran_FLAGS`
| Allows current gfortran to compile the project's legacy Fortran interfaces.
| `WSJT_SKIP_MANPAGES`
| Avoids Unix manpage tooling that is not used by the Windows build.
| `WSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY`
| Builds the normal OpenMP decoder-library variant.
| `WSJT_GENERATE_DOCS=OFF`
| Omits the local User Guide when Asciidoctor is not installed.
| `WSJT_SKIP_QMAP=ON`
| Omits QMAP from the build.
|===
=== Run the automated tests
Tests are enabled by default. Hamlib's DLL must be on `PATH` while Windows
loads test executables that use rig-control code:
[source,bash]
----
cd ~/wsjtx-dev/src
export PATH="$HOME/wsjtx-dev/hamlib-prefix/bin:$PATH"
export QT_QPA_FONTDIR=C:/Windows/Fonts
ctest --test-dir build --output-on-failure
----
Some GUI tests use Qt's offscreen platform, which does not find the Windows
system fonts automatically. `QT_QPA_FONTDIR` lets those tests render text
without installing a separate font package.
To rerun a single test, substitute its name below:
[source,bash]
----
ctest --test-dir build -R '^test_name$' --output-on-failure
----
An ordinary local test run does not require a separate pFUnit installation.
=== Install and run
The build directory is useful for tests, but it is not a self-contained
application layout. Install to the prefix selected during configuration:
[source,bash]
----
cmake --build build --target install
----
This places the application under `C:\WSJT`. Executables and required runtime
DLLs are collected in `C:\WSJT\bin`; program data is installed under
`C:\WSJT\share\wsjtx`. Run `C:\WSJT\bin\wsjtx.exe` from Windows
Explorer, Command Prompt, or the MINGW64 shell.
The install step matters. A build-tree executable can find compiler and Qt DLLs
through the MINGW64 environment, but it does not have the final data-file and
plugin layout. It is suitable for a quick launch only:
[source,bash]
----
export PATH="$HOME/wsjtx-dev/hamlib-prefix/bin:$PATH"
export QT_QPA_PLATFORM_PLUGIN_PATH=/mingw64/share/qt5/plugins
./build/wsjtx.exe
----
Missing Hamlib on `PATH` produces a DLL-load failure. A missing Qt platform
plugin commonly reports that `qwindows.dll` could not be found or loaded.
Even when it starts, the build-tree application is not suitable for normal
operation: features that require installed ephemeris, callsign, country, or
other data files can fail. For example, an FT8 decode can report
`ALLCALL7.TXT is too short or broken?`, and opening Astronomical Data can fail
without the installed ephemeris. Use the installed copy for functional testing.
=== Create an unsigned installer
After installing NSIS, create a package from the configured build:
[source,bash]
----
cmake --build build --target package
----
The installer is written under `build` as `wsjtx-<version>-win64.exe`.
It is unsigned, so Windows SmartScreen may warn about it.
=== Update safely
Update the MSYS2 environment with:
[source,bash]
----
pacman -Syu
----
Update the checked-out branch, then rerun the CMake configure command, build,
and tests:
[source,bash]
----
cd ~/wsjtx-dev/src
git pull --ff-only
----
Rebuild Hamlib when the CI-selected revision changes.
Use a new build directory after a major MSYS2 update changes GCC, gfortran,
CMake, Qt, the MinGW runtime, or foundational libraries. Cached compiler and
dependency paths from an older environment can otherwise produce confusing
configure, link, or runtime failures.
=== Troubleshooting Windows builds
For Windows build failures, check the following:
* `echo "$MSYSTEM"` reports `MINGW64`.
* Every tool check from the dependency section resolves under `/mingw64/bin`.
* `OMNIRIG_TYPE_LIB` names an existing Windows installation of
`OmniRig.exe`.
* `mingw-w64-x86_64-openssl` is installed if CMake reports missing OpenSSL
runtime DLLs.
* `~/wsjtx-dev/hamlib-prefix` contains `include/hamlib/rig.h`,
`lib/libhamlib.dll.a`, and `bin/libhamlib-4.dll`.
After fixing a configuration error, rerun the configure command.
For a useful support report, include:
[source,bash]
----
echo "$MSYSTEM"
git rev-parse --short HEAD
cmake --version
gcc --version
gfortran --version
pacman -Q | sort
----
Also include the complete CMake error or failing command, not only its final
line, and state whether the failure occurred during configure, compile, test,
install, package, or application launch.
== Linux and macOS developer builds
Use the native package manager for local-development dependencies, then build
the CI-selected Hamlib revision into a private workspace. Keeping dependency
source, installed libraries, and generated build files outside the WSJT-X
checkout makes updates and clean rebuilds easier.
=== Install the dependencies
On current Debian or Ubuntu systems, a practical dependency starting point is:
[source,bash]
----
sudo apt update
sudo apt install \
git build-essential cmake gfortran \
qtbase5-dev qttools5-dev qtmultimedia5-dev \
libqt5serialport5-dev libqt5websockets5-dev \
libqt5sql5-sqlite libqt5multimedia5-plugins \
libfftw3-dev libboost-log-dev libusb-1.0-0-dev libudev-dev \
portaudio19-dev autoconf automake libtool pkg-config texinfo \
asciidoctor
----
On macOS, install the Xcode command-line tools and the local developer
dependencies with Homebrew:
[source,bash]
----
xcode-select --install
brew install cmake gcc qt@5 fftw boost libusb portaudio \
autoconf automake libtool pkg-config texinfo asciidoctor
----
=== Clone the source
Clone the public repository, substituting your fork's URL if contributing a
change. If you already have a checkout, change to its root directory instead.
[source,bash]
----
mkdir -p ~/wsjtx-dev
git clone https://github.com/WSJTX/wsjtx.git ~/wsjtx-dev/src
cd ~/wsjtx-dev/src
----
=== Build the CI-selected Hamlib revision
Start in the root of the WSJT-X checkout. Capture its path and read the Hamlib
revision selected by that source:
[source,bash]
----
WSJTX_SOURCE=$(git rev-parse --show-toplevel)
WSJTX_WORKSPACE="$HOME/wsjtx-dev"
mkdir -p "$WSJTX_WORKSPACE"
HAMLIB_BRANCH=$(awk -F'"' '/hamlib_branch:/ {print $2; exit}' \
"$WSJTX_SOURCE/.github/workflows/ci.yml")
if test -n "$HAMLIB_BRANCH"; then
echo "Building Hamlib $HAMLIB_BRANCH"
else
echo "hamlib_branch is missing" >&2
false
fi
----
If this check fails, inspect `.github/workflows/ci.yml` before continuing. The
remaining commands assume the same terminal session. They create Hamlib source
and installation directories beside each other under `~/wsjtx-dev`:
[source,bash]
----
git clone --depth 1 --branch "$HAMLIB_BRANCH" \
https://github.com/Hamlib/Hamlib.git "$WSJTX_WORKSPACE/hamlib-src"
cd "$WSJTX_WORKSPACE/hamlib-src"
./bootstrap
./configure --prefix="$WSJTX_WORKSPACE/hamlib-prefix" \
--enable-shared --disable-static \
--without-cxx-binding --without-readline
make -j"$(getconf _NPROCESSORS_ONLN)"
make install-strip
----
If the CI-selected revision changes, remove or rename `hamlib-src` and
`hamlib-prefix`, then repeat this section.
=== Configure, build, test, and install
These local builds skip manpage generation, which requires additional tools.
On Linux, configure WSJT-X with the explicit source and workspace paths:
[source,bash]
----
cmake -S "$WSJTX_SOURCE" -B "$WSJTX_WORKSPACE/wsjtx-build" \
-DCMAKE_PREFIX_PATH="$WSJTX_WORKSPACE/hamlib-prefix" \
-DWSJT_SKIP_MANPAGES=ON \
-DCMAKE_INSTALL_PREFIX="$HOME/wsjtx-prefix"
cmake --build "$WSJTX_WORKSPACE/wsjtx-build"
ctest --test-dir "$WSJTX_WORKSPACE/wsjtx-build" --output-on-failure
cmake --build "$WSJTX_WORKSPACE/wsjtx-build" --target install
----
On macOS, include the Homebrew library prefixes and select Homebrew's
`gfortran` explicitly.
[source,bash]
----
cmake -S "$WSJTX_SOURCE" -B "$WSJTX_WORKSPACE/wsjtx-build" \
-DCMAKE_PREFIX_PATH="$WSJTX_WORKSPACE/hamlib-prefix;$(brew --prefix qt@5);$(brew --prefix fftw);$(brew --prefix boost);$(brew --prefix libusb);$(brew --prefix portaudio)" \
-DCMAKE_Fortran_COMPILER="$(brew --prefix gcc)/bin/gfortran" \
-DWSJT_SKIP_MANPAGES=ON \
-DCMAKE_INSTALL_PREFIX="$HOME/wsjtx-prefix"
cmake --build "$WSJTX_WORKSPACE/wsjtx-build"
ctest --test-dir "$WSJTX_WORKSPACE/wsjtx-build" --output-on-failure
cmake --build "$WSJTX_WORKSPACE/wsjtx-build" --target install
----
|