Skip to content

Building WindNinja for FlamMap on Windows using the MSVC compiler and gisinternals.com dependencies

Natalie Wagenbrenner edited this page May 18, 2021 · 12 revisions

This is a 64-bit build for FlamMap and avoids compiling the GUI. gisinternals.com builds GDAL and most of the dependencies needed for WindNinja. Boost is the only dependency that needs to be built from source. These instructions were tested on MSVC 2019.

Download GDAL from gisinternals.com

Choose the proper architecture and compiler version (MSVC 2008-2019).

  1. Download the proper package from here.
  2. Unzip the package into a known place, such as C:\src_msvc2019\x64
  3. The zip file will create a folder named release-1928-x64-dev.

Build boost

Download Boost 1.75.0 from here.

The link above also includes instructions for compiling boost; see these instructions for details. Briefly:

cd into C:\src\xx64\src_msvc2019\boost and run the following commands.

bootstrap

b2 --prefix=C:\src_msvc2019\x64 --build-dir=C:\src_msvc2019\x64 --with-date_time --with-program_options --with-test --type=complete toolset=msvc-14.2 architecture=x86 address-model=64 --stagedir=C:\src_msvc2019\x64 install

You should now see several libboost*.lib files in x64\lib and a boost-1_75 folder in x64\include that contains a boost folder with many subfolders containing header files. Move the boost folder with the header files out of boost-1_75 and into x64\include. You should now have a path x64\include\boost with subfolders containing header files.

Build WindNinja

Clone the WindNinja repo to C:\src_msvc2019\windninja. This will clone to a folder called windninja. Create another folder at the same level as the cloned repo called build64. This is where we will build WindNinja. You now have a path called C:\src_msvc2019\windninja\windninja and a path called C:\src_msvc2019\windninja\build64.

cd into the WindNinja source tree and checkout the msvc2019 branch:

git checkout msvc2019

cd into \build64 and run:

cmake-gui ..\windninja

  1. Click Configure.
  2. Choose NMake Makefiles as the generator.
  3. Add a new entry called BOOST_ROOT=C:/src/x64 and click Configure again. This should set all the other boost paths correctly.
  4. Click Configure.
  5. Check USE_GIS_INTERNALS.
  6. Click Configure.
  7. The variable GIS_INTERNALS_HOME will appear. Set it to C:/src_msvc2019/x64/release-1928-x64-dev/release-1928-x64-dev.
  8. Click Configure. There will still be errors.
  9. Set the following values:
    • NINJA/NINJA_CLI = checked
    • NINJA/NINJA_QTGUI = unchecked
    • WITH/WITH_LCP_CLIENT = checked
    • WITH/WITH_NOMADS_SUPPORT = checked
    • Ungrouped Entries/ENABLE_GMTED = checked
    • Ungrouped Entries/STABILITY = checked
    • BUILD/BUILD_TESTING = unchecked
  10. Click Configure
  11. Click Generate
  12. Run nmake in the console