Skip to content
Snippets Groups Projects
Commit 52a60be0 authored by Ammar Nejati's avatar Ammar Nejati
Browse files

Doc:Install or build>Build>Windows: Improve the section on building with Ninja

parent ecc8a059
No related branches found
No related tags found
1 merge request!889Update the documentation according to the latest changes
......@@ -79,12 +79,6 @@ Create the folders
and paste the corresponding content from the ZIP files in those two folders.
> #### *Additional: Ninja*
>
> The time to compile can be significantly improved, depending on the hardware, if Ninja is used as a build system.
> To download Ninja, go to [ninja-build.org](https://ninja-build.org) and download the Windows binary via GitHub.
> Add the binaries directory in your `PATH`, f.e. `C:\Program Files\ninja`.
#### System Enviroment Variables
After those installations your `PATH` should contain
......@@ -118,30 +112,38 @@ cmake -G "Visual Studio 16 2019" -A x64 -T host=x64 -DLIB_MAN=OFF -DQTDIR="$QTDI
cmake --build . --config Release
ctest -C Release --parallel 8 --output-on-failure
```
<br>
<details> <summary> <b> Build with Ninja (Experimental) </b> </summary>
Compilation might be accelerated if Ninja is used as a build system.
Download the Ninja binary for Windows from [ninja-build.org](https://ninja-build.org). Add the binaries to a directory in your `PATH`; e.g. `C:\Program Files\ninja`.
To use Ninja as the build system, the compilation cannot be performed in a PowerShell but in the Visual Studio Shell **x64 Native Tools Command Prompt for VS 2019** which you can search for in the start menu.
Use the following commands to build BornAgain:
```
set OPTLIBS=C:/opt/x64
set FFTW3_INCLUDE_DIR=%OPTLIBS%/include
set FFTW3_LIB=%OPTLIBS%/lib/libfftw3-3.lib
set QTDIR=C:/Qt/current/msvc2019_64
set QTCMake_DIR=%QTDIR%/lib/cmake
set BUILD_DIR=buildnj
mkdir "%BUILD_DIR%"
cd "%BUILD_DIR%"
cmake --version
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DQTDIR="%QTDIR%" -DQt5_DIR="%QTCMake_DIR%/Qt5" -DQt5Test_DIR="%QTCMake_DIR%/Qt5Test" -DFFTW3_INCLUDE_DIR="%FFTW3_INCLUDE_DIR%" -DFFTW3_LIBRARY="%FFTW3_LIB%" -DCMAKE_INCLUDE_PATH="%OPTLIBS%/include" -DCMAKE_LIBRARY_PATH="%OPTLIBS%/lib" -DLIB_MAN=OFF -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -B. ..
echo "## BUILD START:" %time%
cmake --build . --config Release --parallel 8
echo "## BUILD END:" %time%
ctest -C Release --parallel 8 --output-on-failure
```
> #### *Additional: Build with Ninja* (Experimental)
>
> To use Ninja as the build system, the compilation cannot be performed in a PowerShell but in the Visual Studio Shell **x64 Native Tools Command Prompt for VS 2019** which you can serach for in the start menu.
> ```
> set OPTLIBS=C:/opt/x64
> set FFTW3_INCLUDE_DIR=%OPTLIBS%/include
> set FFTW3_LIB=%OPTLIBS%/lib/libfftw3-3.lib
> set QTDIR=C:/Qt/current/msvc2019_64
> set QTCMake_DIR=%QTDIR%/lib/cmake
> set BUILD_DIR=buildnj
>
> mkdir "%BUILD_DIR%"
> cd "%BUILD_DIR%"
>
> cmake --version
>
>cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DQTDIR="%QTDIR%" -DQt5_DIR="%QTCMake_DIR%/Qt5" -DQt5Test_DIR="%QTCMake_DIR%/Qt5Test" -DFFTW3_INCLUDE_DIR="%FFTW3_INCLUDE_DIR%" -DFFTW3_LIBRARY="%FFTW3_LIB%" -DCMAKE_INCLUDE_PATH="%OPTLIBS%/include" -DCMAKE_LIBRARY_PATH="%OPTLIBS%/lib" -DLIB_MAN=OFF -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -B. ..
>
>echo "## BUILD START:" %time%
>cmake --build . --config Release --parallel 8
>
>echo "## BUILD END:" %time%
>ctest -C Release --parallel 8 --output-on-failure
> ```
</details>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment