### Compile SPLAT! RF coverage software on 64-bit Windows

How to compile SPLAT! analysis tool by John Magliacane (KD2BD) on 64-bit Windows 10 with MSYS2

SPLAT! is a cross-platform, open-source software that can be used to analyse a radio link between two locations and to generate coverage maps of RF transmitters. Coverage maps are calculated using Longley-Rice Irregular Terrain Model (ITM) algorithm. SPLAT! can predict RF coverage for any frequencies between 20 MHz and 20 GHz. It is thus useful for ham radio, broadcast radio, terrestrial television and wireless networks. Although it is cross-platform, up-to-date binaries for Windows are hard to find. On the other hand, for Linux users, it is available in the repositories of the major distributions.

I wrote in a previous post about SPLAT! and how to compile it with MinGW. At that time, the compiler package I used was only available for 32-bit architecture. Since most systems are now 64-bit, I had to use a different compiler package to get 64-bit SPLAT! binaries. Here is the good news: you can either follow this tutorial or you can jump to the end of this post and grab the precompiled binaries (SPLAT! is licensed under GPL v2).

You have to install a development environment, build a dependency, edit SPLAT! sources to fix file naming and you'll be able to successfully build the software.

## MSYS2 and BZip2

Get the "one click installer" for MSYS2 and... install it with the default options (the default installation folder is C:\msys64). Launch MSYS2 MSYS (that's how you'll find it in Start Menu). It's time to update and install required development packages:

pacman -Syu

After this command it may prompt you to install updates. Accept it (Y) keeping in mind that it may automatically close to update and you have to open it again. Let's install packages from repositories (just hit Enter when asked for a selection):

pacman -S base-devel gcc zlib-devel

Unfortunately, there is a required dependency that can be installed with the package manager: BZip2. You have to compile it from source. These are the commands that will download (1st), extract (2nd), build (4th) and install (5th) BZip2.

wget https://www.sourceware.org/pub/bzip2/bzip2-latest.tar.gz
tar -xvf ./bzip2-latest.tar.gz
cd ./bzip2-1.0.8/
make
make install PREFIX=/usr

cd ..

## SPLAT!

Let's download SPLAT! and extract it. Note that tar may print an error regarding a symlink (that's fine - no symlinks on Windows).

wget https://www.qsl.net/kd2bd/splat-1.4.2.tar.bz2
tar -xvf ./splat-1.4.2.tar.bz2
cd ./splat-1.4.2

Now, as I previously told you, there are some issues with SPLAT! file naming. It uses characters that are not valid on Windows. Install Notepad++ because:

You must replace all occurrences of "%d:%d:%d:%d" with something Windows compatible such as "%d_%d_%d_%d". The files of interest are splat.cpp and srtm2sdf.cpp from utils subfolder.

The second file is in utils subfolder which can be found in splat-1.4.2 folder from C:\msys64\home\your_username. There is also another issue:

Find in srtm2sdf.c a line that looks like (it is line 160 in version 1.4.2):
infile=open(filename, O_RDONLY);
and replace it with something like:
infile=open(filename, O_RDONLY | O_BINARY);

When you are done, you can return to MSYS2 command line and build SPLAT!:

./configure

For SPLAT! with normal resolution you may safely use 8 x 8 degrees as maximum analysis region. However, SPLAT! HD compilation failed on my system when using 7 x 7 or 8 x 8.

SPLAT! HD build configuration

When compilation is done, it will prompt you to run installation script. That works for Linux, but on Windows, it will copy SPLAT! executables inside MSYS2 install. And if you uninstall MSYS2 you lose SPLAT! too. Therefore, copy the entire splat-1.4.2 directory in a safe place and keep all EXE files, including the utils folder with its executables.

## Binaries

If you're having troubles compiling from source, here are precompiled binaries for both 32-bit and 64-bit Windows: