B E Z I T O P O

Home
Features
Download
Developers
Links

Bezitopo development takes place on Github. Discussion takes place on the mailing list at devel@lists.bezitopo.org. To subscribe, send an email to Sympa with a blank subject and "subscribe devel" in the body. There is also an IRC channel #bezitopo on Freenode.

General Building

To build Bezitopo, you need CMake and a C++ compiler. If you are packaging Bezitopo, 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.

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
mkdir -p w64
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
cd ../w64
cmake -DCMAKE_TOOLCHAIN_FILE=~/toolchain/mingw64.cmake -DCMAKE_INSTALL_PREFIX=~/mingw-install ~/src/$1

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/bezitopo and run these commands in an xterm:
Building on Debian
you@comp:~/src$ mkdir ~/build
you@comp:~/src$ ~/bin/build bezitopo
you@comp:~/src$ cd ~/build/bezitopo/dbg
you@comp:~/build/bezitopo/dbg$ make -j 3
you@comp:~/build/bezitopo/dbg$ ./viewtin&

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/bezitopo and run these commands in an xterm:
Building on Red Hat
[you@comp src]$ mkdir ~/build
[you@comp src]$ ~/bin/build bezitopo
[you@comp src]$ cd ~/build/bezitopo/dbg
[you@comp dbg]$ make -j 3
[you@comp dbg]$ ./viewtin&

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/bezitopo and run these commands in an xterm:
Building on DragonFly
[you@comp ~/src]$ mkdir ~/build
[you@comp ~/src]$ ~/bin/build bezitopo
[you@comp ~/src]$ cd ~/build/bezitopo/dbg
[you@comp ~/build/bezitopo/dbg]$ make -j 3
[you@comp ~/build/bezitopo/dbg]$ ./viewtin&

Building on Windows with Cygwin

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/bezitopo and run these commands:
Building on Cygwin
you@comp ~/src $ mkdir ~/build
you@comp ~/src $ ~/bin/build bezitopo
you@comp ~/src $ cd ~/build/bezitopo/dbg
you@comp ~/build/bezitopo/dbg $ make -j 3
you@comp ~/build/bezitopo/dbg $ startxwin&
you@comp ~/build/bezitopo/dbg $ DISPLAY=:0;export DISPLAY
you@comp ~/build/bezitopo/dbg $ ./viewtin&

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/bezitopo and run these commands in a bash shell:

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

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/bezitopo 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 bezitopo
C:\Users\you\src>cd ..\build\bezitopo\vs\dbg
C:\Users\you\build\bezitopo\vs\dbg>copy /c/Qt/*/mingw*/bin/Qt5Cored.dll .\
C:\Users\you\build\bezitopo\vs\dbg>copy /c/Qt/*/mingw*/bin/Qt5Guid.dll .\
C:\Users\you\build\bezitopo\vs\dbg>copy /c/Qt/*/mingw*/bin/Qt5Widgetsd.dll .\
C:\Users\you\build\bezitopo\vs\dbg>ninja
C:\Users\you\build\bezitopo\vs\dbg>viewtin

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 bezitest individual tests. To see the list of tests, type bezitest -l.

After adding a new ellipsoid

Run transmer (you have to have fftw3 installed to build it). After much long crunching, you will get a file transmer.dat, which contains the transverse Mercator coefficients for all known ellipsoids. Copy it to the source directory, overwriting the existing file, and commit it.

Pierre Abbat
NC PLS L-5129