Building WindNinja on Windows using the MSVC compiler and gisinternals.com dependencies - firelab/windninja GitHub Wiki
gisinternals.com builds gdal and most of the dependencies needed for WindNinja. It is simpler than building everything from source, and is preferred. Boost and Qt still need to be built, but all other dependencies are available.
Download GDAL from gisinternals.com
You can choose the proper architecture (x86 or amd64) and compiler version (MSVC 2008-2017).
- Download the proper package from here.
- Unzip the package into a known place, such as
C:\src\x64 - The zip file will create a folder named
release-1600-x64.
You might need to edit release-1600-x64\include\boost\config\auto_link.hpp to find the correct boost libs. For example, to link to boost built with MSVC 2010, change line 136 to:
#define BOOST_LIB_TOOLSET "vc100"
Your GIS_INTERNALS_HOME value will point to C:\src\x64\release-1600-x64.
Build boost
cd into C:\src\x86\src\boost and run
bootstrap
Then, for 32-bit, run
bjam install --prefix=C:/src/x86 --with-date_time --with-program_options --with-test --type=complete
For 64-bit, run:
bjam install --prefix=C:/src/x64 --with-date_time --with-program_options --with-test --type=complete --toolset=msvc-10.0 address-model=64
Building Qt with OpenSSL support
NOTE: Building qt-4.8.5 with VS2013 requires the following changes:
http://stackoverflow.com/questions/18080625/qt-4-8-visual-studio-2013-compiling-error
Download the openssl-1.0.1u-vs2010 binaries to C:\src:
https://www.npcglib.org/~stathis/blog/precompiled-openssl/
From C:\src\x86\src\qt-everywhere-opensource-src-4.8.5 run:
configure -prefix C:\src\x64 -opensource -openssl -I C:\src\openssl-1.0.1u-vs2010\include64 -L C:\src\openssl-1.0.1u-vs2010\lib64
nmake
nmake install
Build WindNinja
The SRTM client API keys for the GUI and CLI must be set. Set the default keys for the CLI in cmake_cli.cpp lines 56 and 58 and for the GUI in line 47 of srtmclient.cpp.
Note: in order to generate a proper NINJA_SCM_VERSION value, git must be installed and GITCOMMAND must be set.
Downloads: https://git-scm.com/downloads
cd into C:\src\windninja\build64 and run:
cmake-gui ../
- Click
Configure. - Check
USE_GIS_INTERNALS. - Click
Configure. - The variable
GIS_INTERNALS_HOMEwill appear. Set it to the value mentioned in the first step. - Click
Configure. There will still be errors. - Add a new entry called
BOOST_ROOT=C:/src/x64and clickConfigureagain. This should set all the other boost paths correctly. - Set the following values:
- NINJA/NINJA_CLI = checked
- NINJA/NINJA_QTGUI = checked
- WITH/WITH_LCP_CLIENT = checked
- WITH/WITH_NOMADS_SUPPORT = checked
- Ungrouped Entries/ENABLE_GMTED = checked
- Ungrouped Entries/FIRELAB_PACKAGE = checked (if building installer)
- Ungrouped Entries/STABILITY = checked
- If necessary, set Ungrouped Entries/GITCOMMAND to
C:/Program Files/Git/cmd/git.exe(default) - BUILD/BUILD_FETCH_DEM = checked
- BUILD/BUILD_TESTING = unchecked
- Click
Configure - Set
QT_QMAKE_EXECUTABLEtoC:/src/x64/bin/qmake.exe - Click
Configure - Append
/DNINJA_ENABLE_CALL_HOMEto theCMAKE/CMAKE_CXX_FLAGSentry. - Click
Configure - Set
FOAM_MINGW_PATHtoC:/src/windninja/OpenFOAM-2.2.x/ - Click
Generate - Run
nmakein the console - Optionally run
nmake package