Was able to get everything to compile on both Windows & Linux (Ubuntu). Using VS Code for code development and Windows Subsystem for Linux (WSL) to test the Linux build. Building using CMake on both platforms. Windows uses the VS2022 compiler (v17) and Linux utilizing g++.
Packages installed through the (vcpkg)[https://vcpkg.io/en/] package manager:
- fftw3
- mpi (required pre-installing Microsoft MPI)
- openblas
- lapack-reference[blas-select]
Example - .\vcpkg.exe install lapack-reference[blas-select]
Packages installed through the Debian package manager (apt-get):
- libfftw3-dev
- libopenmpi-dev
- libopenblas-dev
- liblapack-dev
Example - sudo apt install libfftw3-dev
VS Code is a handy IDE when Visual Studio is inconvenient. Several extensions make development easier:
- CMake Tools (auto-reconfigure on change, auto-build, debug/run kickoffs etc.)
- C/C++ (Intellisense & debugging)
- Python (auto-complete & debugging)
To get CMake working with C++ debugging it seems I had to change settings in the ~/.vscode/tasks.json file. Specifically I had to provide the path to the VsDevCmd.bat file.
{
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/C",
// The path to VsDevCmd.bat depends on the version of Visual Studio you have installed.
"\"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/VsDevCmd.bat\"",
"&&"
]
}
}
},
...
}
To get CMake working with vcpkg I had to add a custom 'Kit' to target which specifies a CMake toolchain file. This is done by adding an option to ~/.vscode/cmake-kits.json (had to create it.)
[
{
"name": "MSVC 2022 Release - amd64 - vcpkg",
"visualStudio": "f10c0764",
"visualStudioArchitecture": "x64",
"isTrusted": true,
"preferredGenerator": {
"name": "Visual Studio 17 2022",
"platform": "x64",
"toolset": "host=x64"
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
]
Exclusively using the command line to interact with CMake and test the build.