PerfectTIN

Home
Features
Download
Developers
Links

PerfectTIN development takes place on Github. There is not yet a mailing list or IRC channel for PerfectTIN; if you'd like to get involved, contact me and I'll set one up.

General Building

To build PerfectTIN, you need CMake and a C++ compiler. If you are packaging PerfectTIN, it is fine to put the build directory inside the source directory, but if you are developing it, you should use an out-of-source build.

If you're going to use PLY files, build and install Plytapus before you build PerfectTIN. The instructions are the same, except for the name of the program.

Building on Unix and the like

I use the following file to make build directories for building on Linux and BSD:

~/bin/build
#!/bin/sh
mkdir -p ~/build/$1
cd ~/build/$1
mkdir -p dbg
mkdir -p rel
mkdir -p ins
cd dbg
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~ ~/src/$1
cd ../rel
cmake -DCMAKE_INSTALL_PREFIX=~ ~/src/$1
cd ../ins
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ~/src/$1
~/src/$1

You can use Ninja instead of Make (add -GNinja to each line) or add a subdirectory for fuzzing with American Fuzzy Lop (add -DCMAKE_C_COMPILER=afl-clang -DCMAKE_CXX_COMPILER=afl-clang++ or the same with afl-gcc to the cmake command).

Building on Debian and derivatives

To build on Debian, Ubuntu, or anything else using the Debian package manager, install the following packages:

Create the ~/bin/build file above. Clone the repo into ~/src/perfecttin and run these commands in an xterm:
Building on Debian
you@comp:~/src$ mkdir ~/build
you@comp:~/src$ ~/bin/build perfecttin
you@comp:~/src$ cd ~/build/perfecttin/dbg
you@comp:~/build/perfecttin/dbg$ make -j 3
you@comp:~/build/perfecttin/dbg$ ./perfecttin-gui&

Building on Red Hat and derivatives

Don't try to build on RHEL/CentOS 7. The versions of CMake and g++ are too old. It may be possible to build by hacking the repositories, but it is not worth the hassle. I have not tried RHEL/CentOS 8.

To build on Red Hat, Fedora, CentOS, or anything else using the Red Hat package manager, install the following packages:

Create the ~/bin/build file above. Clone the repo into ~/src/perfecttin and run these commands in an xterm:
Building on Red Hat
[you@comp src]$ mkdir ~/build
[you@comp src]$ ~/bin/build perfecttin
[you@comp src]$ cd ~/build/perfecttin/dbg
[you@comp dbg]$ make -j 3
[you@comp dbg]$ ./perfecttin-gui&

Building on FreeBSD and DragonFly BSD

To build on systems using the ports or DPorts collection, install the following packages:

Create the ~/bin/build file above. Clone the repo into ~/src/perfecttin and run these commands in an xterm:
Building on DragonFly
[you@comp ~/src]$ mkdir ~/build
[you@comp ~/src]$ ~/bin/build perfecttin
[you@comp ~/src]$ cd ~/build/perfecttin/dbg
[you@comp ~/build/perfecttin/dbg]$ make -j 3
[you@comp ~/build/perfecttin/dbg]$ ./perfecttin-gui&

Building on Windows with Cygwin

Instructions for Windows are not updated from Bezitopo

To build on Cygwin, install the following packages:

Create the ~/bin/build file above, but without the three w64 lines. Clone the repo into ~/src/perfecttin and run these commands:
Building on Cygwin
you@comp ~/src $ mkdir ~/build
you@comp ~/src $ ~/bin/build perfecttin
you@comp ~/src $ cd ~/build/perfecttin/dbg
you@comp ~/build/perfecttin/dbg $ make -j 3
you@comp ~/build/perfecttin/dbg $ startxwin&
you@comp ~/build/perfecttin/dbg $ DISPLAY=:0;export DISPLAY
you@comp ~/build/perfecttin/dbg $ ./perfecttin-gui&

Building on Windows

I use the following file to make build directories for building on Windows:

~/AppData/Local/Microsoft/WindowsApps/build.cmd
@echo off
setlocal mkdir %HOMEDRIVE%%HOMEPATH%\build\%1
cd %HOMEDRIVE%%HOMEPATH%\build\%1
mkdir vs
mkdir mingw
cd mingw
set Qt5_DIR=C:\Qt\5.13.0\mingw73_64\lib\cmake\Qt5
set CC=gcc
set CXX=g++
mkdir dbg
mkdir rel
mkdir ins
cd dbg
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%HOMEDRIVE%%HOMEPATH% %HOMEDRIVE%%HOMEPATH%\src\%1
cd ..\rel
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%HOMEDRIVE%%HOMEPATH% %HOMEDRIVE%%HOMEPATH%\src\%1
cd ..\ins
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local %HOMEDRIVE%%HOMEPATH%\src\%1
cd ..\..\vs
set Qt5_DIR=C:\Qt\5.13.0\msvc2017_64\lib\cmake\Qt5
set CC=cl
set CXX=cl
mkdir dbg
mkdir rel
mkdir ins
cd dbg
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%HOMEDRIVE%%HOMEPATH% %HOMEDRIVE%%HOMEPATH%\src\%1
cd ../rel
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%HOMEDRIVE%%HOMEPATH% %HOMEDRIVE%%HOMEPATH%\src\%1
cd ../ins
cmake -GNinja -DCMAKE_BUILD_TYPE=Release %HOMEDRIVE%%HOMEPATH%\src\%1

Building with MinGW

Install the following Chocolatey packages:

Install Qt, selecting the MinGW build. Create the build.cmd file above, setting the Qt and MinGW version numbers to what you installed. Clone the repo into ~/src/perfecttin and run these commands in a bash shell:

Building on Windows with MinGW
you@comp MINGW64 ~/src
$
mkdir ~/build
you@comp MINGW64 ~/src
$
build perfecttin
you@comp MINGW64 ~/src
$
cd ~/build/perfecttin/mingw/dbg
you@comp MINGW64 ~/build/perfecttin/mingw/dbg
$
cp /c/Qt/*/mingw*/bin/Qt5Cored.dll ./
you@comp MINGW64 ~/build/perfecttin/mingw/dbg
$
cp /c/Qt/*/mingw*/bin/Qt5Guid.dll ./
you@comp MINGW64 ~/build/perfecttin/mingw/dbg
$
cp /c/Qt/*/mingw*/bin/Qt5Widgetsd.dll ./
you@comp MINGW64 ~/build/perfecttin/mingw/dbg
$
ninja
you@comp MINGW64 ~/build/perfecttin/mingw/dbg
$
./perfecttin-gui&

If you're building an install or release build, omit the 'd' from the library names; it stands for "debug". There is no Qt5LinguistTools.dll file; the above three are sufficient. WindeployQt copies the libraries to the build directory, but for the install or release build on MinGW, it copies the wrong ones, the debug ones.

Building with MSVC++

Install the following Chocolatey packages:

Install Visual Studio. Install Qt, selecting the MSVC build. Create the build.cmd file above, setting the Qt and MSVC version numbers to what you installed. Clone the repo into ~/src/perfecttin and run these commands in a 64-bit Visual Studio shell:

Building on Windows with MSVC++
C:\Users\you\src>mkdir \Users\you\build
C:\Users\you\src>build perfecttin
C:\Users\you\src>cd ..\build\perfecttin\vs\dbg
C:\Users\you\build\perfecttin\vs\dbg>copy /c/Qt/*/mingw*/bin/Qt5Cored.dll .\
C:\Users\you\build\perfecttin\vs\dbg>copy /c/Qt/*/mingw*/bin/Qt5Guid.dll .\
C:\Users\you\build\perfecttin\vs\dbg>copy /c/Qt/*/mingw*/bin/Qt5Widgetsd.dll .\
C:\Users\you\build\perfecttin\vs\dbg>ninja
C:\Users\you\build\perfecttin\vs\dbg>perfecttin-gui

If you're building an install or release build, omit the 'd' from the library names; it stands for "debug". There is no Qt5LinguistTools.dll file; the above three are sufficient.

Unlike MinGW, MSVC does not support ten-byte floating point. This produces slightly less accuracy on spirals, but you're unlikely to notice, as the spirals have to be much longer and curlier than any actually used in a road to make any difference.

First time on a new OS or processor

After building, run the test. You can type make test or testptin individual tests. To see the list of tests, type testptin -l.

Pierre Abbat
NC PLS L-5129