-
Notifications
You must be signed in to change notification settings - Fork 1
Building DASH
The instructions in this page will only work if you have followed the instructions in the Provisioning a build machine page.
Use the following command to clone the dash repository
git clone ssh://[email protected]/ccdc-opensource/dash.git
This will create a directory called dash on your disk.
The following command line snippet will configure the build to:
- Use Ninja to build a Release version of DASH (with full optimisations)
- Use the Intel Fortran Compiler in its default location
- Use a copy of winteracter installed under a custom location (the default is C:\wint)
- Use the
dash
directory as a location for the source code - Use a
bld
directory as a location for the the generated solution and build products - Install DASH under the
install
directory when selecting the INSTALL target
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
"C:\Program Files\CMake\bin\cmake.exe" ^
-G Ninja ^
-S dash ^
-B bld ^
-DWINTERACTER_ROOT=C:\winteracter\winteracter-14.10d ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_Fortran_COMPILER="C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe" ^
-DCMAKE_INSTALL_PREFIX=install
source /opt/intel/oneapi/setvars.sh
cmake \
-G Ninja \
-S dash \
-B bld \
-DWINTERACTER_ROOT=/opt/winteracter/winteracter-linux-14.10d \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_Fortran_COMPILER="/opt/intel/oneapi/compiler/latest/linux/bin/intel64/ifort" \
-DCMAKE_INSTALL_PREFIX=install
The following powershell snippet will compile all fortran code using the build directory bld
configured using the cmake command above
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
"C:\Program Files\CMake\bin\cmake.exe" --build bld
source /opt/intel/oneapi/setvars.sh
cmake --build bld
The following powershell snippet will run the install target, thus installing all required binaries and resource files under the directory specified by the -DCMAKE_INSTALL_PREFIX
setting
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
"C:\Program Files\CMake\bin\cmake.exe" --build bld --target install
source /opt/intel/oneapi/setvars.sh
cmake --build bld --target install
The following powershell snippet will run the package target, thus creating in the bld directory:
- a compressed 7z archive
- an executable MSI installer
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
"C:\Program Files\CMake\bin\cmake.exe" --build bld --target package
The following script will run the package target which will create a compressed 7z archive under the bld directory
source /opt/intel/oneapi/setvars.sh
cmake --build bld --target install
Note: the 2021.4.0 version of Intel oneAPI has a bug that prevents this procedure from working correctly. Intel have fixed this with version 2022.1.0.
Instead of using the Ninja CMake Generator, you need to use the "Visual Studio 16 2019" one like this:
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
"C:\Program Files\CMake\bin\cmake.exe" ^
-G "Visual Studio 16 2019" ^
-S dash ^
-B bld-vs ^
-DWINTERACTER_ROOT=C:\winteracter\winteracter-14.10d ^
-DCMAKE_Fortran_COMPILER="C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe" ^
-DCMAKE_INSTALL_PREFIX=install
This command will generate a DASH Visual Studio solution in the directory you specify with the -B flag (bld-vs if you copy paste the snippet above).
Open the solution, run the ALL_BUILD target to compile all executables and libraries and then run the INSTALL target to generate a complete DASH distribution folder in your install directory.
Right click on the DASH target, select Properties and in the Debug pane, select (your install directory)/bin as the current working directory for DASH. This will allow DASH to find the files it requires
Not doing the above will cause DASH to fail on startup.
These instructions will allow you to debug DASH on Linux.
Follow the instructions above but use -DCMAKE_BUILD_TYPE=Debug \
instead of -DCMAKE_BUILD_TYPE=Release \
when running CMake
Ensure you have the following extensions installed:
- ms-vscode.cpptools
- ms-vscode.cmake-tools
- krvajalm.linter-gfortran
Having gfortran installed is useful for the linter-gfortran extension but not required.
First run the install target to create an install folder. You must set the working directory to the install/bin folder or you'll get an error.
Then add the following configuration to your .vscode/launch.json file.
{
"configurations": [
{
"name": "Run dash",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/install/bin",
"environment": [],
"linux": {
"program": "${workspaceFolder}/bld/bin/DASH",
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "${workspaceFolder}/dash/.devcontainer/gdb-oneapi",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Disable target async",
"text": "set target-async off",
"ignoreFailures": true
}
]
}
}
]
}