diff --git a/CMakeLists.txt b/CMakeLists.txt index cb9a2c5100..08031b02cf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ set(CMAKE_CXX_STANDARD 20) # Add our custom module search path list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules") +# We are setting up a development environment in MSVC +option(MSVC_DEV "Configuration is for a Visual Studio 2022 dev environment" OFF) + # Install GSL (GNU Scientific Library) with Conan for Windows and Unix-like systems option(CONAN_GSL "Use conan to find GSL" ON) @@ -415,3 +418,9 @@ if(GUI) ) install(SCRIPT ${deploy_script}) endif(GUI) + +# Install for MSVC +if(MSVC_DEV) + include(msvc-dissolve-dev) + setup_msvc() +endif(MSVC_DEV) diff --git a/benchmark/math/interpolator.cpp b/benchmark/math/interpolator.cpp index 0c68caa61a..f672c24f3b 100644 --- a/benchmark/math/interpolator.cpp +++ b/benchmark/math/interpolator.cpp @@ -5,6 +5,7 @@ #include "math/data1D.h" #include #include +#include #include #include diff --git a/cmake/Modules/msvc-dissolve-dev.cmake b/cmake/Modules/msvc-dissolve-dev.cmake new file mode 100644 index 0000000000..f358a9055b --- /dev/null +++ b/cmake/Modules/msvc-dissolve-dev.cmake @@ -0,0 +1,45 @@ + # Find and install dependencies for a Visual Studio 2022 dev environment + function(setup_msvc) + set(SEARCH_IN "${CMAKE_BINARY_DIR}") + set(INSTALLATION_DIR "${SEARCH_IN}") + + set(ALL_INSTALL_FILES "") + + set(CONAN_DEPS ${_conan_requires}) + list(APPEND CONAN_DEPS ${EXTRA_CONAN_REQUIRES}) + + # Find exe, dll and lib paths from Conan packages + foreach (DEPENDENCY IN LISTS CONAN_DEPS) + string(FIND ${DEPENDENCY} "/" SUBSTRING_AT) + string(SUBSTRING ${DEPENDENCY} 0 "${SUBSTRING_AT}" SUB_DIR) + + set(SEARCH_IN ${CMAKE_BINARY_DIR}/${SUB_DIR}) + + file(GLOB CONAN_BIN "${SEARCH_IN}/bin/*.exe" "${SEARCH_IN}/bin/*.dll") + file(GLOB CONAN_LIB "${SEARCH_IN}/lib/*.lib") + + set(CONAN_FILES ${CONAN_BIN}) + list(APPEND CONAN_FILES ${CONAN_LIB}) + + list(APPEND ALL_INSTALL_FILES ${CONAN_FILES}) + endforeach() + + # Find GUI dependencies (FTGL and Freetype) + if(GUI) + set(INSTALLATION_DIR "${CMAKE_BINARY_DIR}/bin") + set(GUI_DEPENDENCIES_DIR "${CMAKE_BINARY_DIR}/../dependencies") + + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/ftgl-install/bin/ftgld.dll") + list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/freetype-install/bin/freetyped.dll") + else() + list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/ftgl-install/bin/ftgl.dll") + list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/freetype-install/bin/freetype.dll") + endif() + endif() + + # Install all dependencies + foreach(DEPENDENCY IN LISTS ALL_INSTALL_FILES) + file(COPY ${DEPENDENCY} DESTINATION "${INSTALLATION_DIR}") + endforeach() + endfunction() \ No newline at end of file diff --git a/develop.ps1 b/develop.ps1 new file mode 100644 index 0000000000..f82a03f3e1 --- /dev/null +++ b/develop.ps1 @@ -0,0 +1,352 @@ +<# + .SYNOPSIS + Script to install dependencies for Dissolve development environment in Visual Studio. + .DESCRIPTION + Installs the following dependencies for Dissolve (separate and prior to Conan-managed packages): + - Qt 6.4.2 + - Freetype + - FTGL + - Antlr4 (Java backend) + - Java JDK + + These packages are installed into a folder called 'dependencies'. + .PARAMETER qtVersion + Qt version to install. Defaults to existing system Qt6 installation if none specified. + .PARAMETER antlrVersion + ANTLR version to install. Defaults to ANTLR 4.13.1. + .PARAMETER release + Flag - install packages for release, otherwise debug. +#> + +param ( + [string]$qtVersion, + [string]$antlrVersion = "4.13.1", + [switch]$release = $false +) + +$build = "Debug" +$binSuffix = "d" + +if ($release) { + $build = "Release" + $binSuffix = "" +} + +$info_colors = @{ + ForegroundColor = "White" + BackgroundColor = "Black" +} + +Write-Host "Building dependencies in $build configuration... " @info_colors + +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 + +$projectDir = Get-Location + +$threading = [bool]::Parse('True') + +$dependencies = "dependencies" +New-Item -ItemType Directory -Path $dependencies -ErrorAction SilentlyContinue + +#Install key dependencies with Chocolatey +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 +iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + +Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 + +Write-Host "Installing key dependencies with Chocolatey... " @info_colors +choco install -y ninja pkgconfiglite cmake + +# Find git, install if not found +try { + & "git" --version + Write-Output "Found system Git..." +} catch { + Write-Output "Could not find system Git - installing with Chocolatey..." + choco install -y git +} + +# Find python, install if not found +try { + & "python" --version + Write-Output "Found system Python..." @info_colors + $pythonVersion = $(python -c "import sys; v = sys.version_info; print(v.major == 3, v.minor == 12)") + $versionParts = $pythonVersion -split " " + if (-not ($versionParts[0] -eq "True" -and $versionParts[1] -eq "True")) { + Write-Output "System Python is version $(python --version) and it is recommended to be == 3.12 - installing with Chocolatey..." @info_colors + choco install -y python --version=3.12.0 + } +} catch { + Write-Output "Could not find system Python - installing with Chocolatey..." @info_colors + choco install -y python --version=3.12.0 +} + +refreshenv + +# Setup Python packages +Write-Host "Creating a local Python virtual environment... " @info_colors +python -m venv msvc-env + +Write-Host "Checking Python compiler type... " @info_colors +if ($(python -c "import sys; print(sys.version)") -match "MSC v\.\d+") +{ + Write-Host " ...Python compiler type evaluated to MSC" @info_colors + $pythonEnvSourceDir = "Scripts" +} +else +{ + Write-Host " ...Python compiler type is not MSC" @info_colors + $pythonEnvSourceDir = "bin" +} + +$activate = "./msvc-env/$pythonEnvSourceDir/Activate.ps1" + +Write-Host "Activating Python virtual environment... " @info_colors +& $activate + +Write-Host "Installing Python packages... " @info_colors +python -m pip install --upgrade pip +python -m pip install aqtinstall conan==1.* + +$systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + +[Environment]::SetEnvironmentVariable("PATH", "$(Join-Path -Path $projectDir -ChildPath "msvc-env\$pythonEnvSourceDir");$systemPath", [EnvironmentVariableTarget]::Machine) +Write-Host "Python packages directory path added to system PATH." @info_colors + +$qt6Dir = "" + +if (-not [string]::IsNullOrEmpty($qtVersion)) +{ + # Install Qt6 + $qtVersion = "6.4.2" + $qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" + New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyContinue + + Write-Host "Installing Qt6... " @info_colors + aqt install-qt --outputdir $qtInstallationDir windows desktop $qtVersion win64_msvc2019_64 -m all + + # Export Qt6_DIR to system environment variables + $qt6Dir = Join-Path -Path $dependencies -ChildPath "qt\$qtVersion\msvc2019_64" + $qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" + + Write-Host "Locating system PATH... " @info_colors + $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + + Write-Host "Adding Qt6 directory to system PATH... " @info_colors + if ($systemPath -notmatch [regex]::Escape($qt6BinDir)) { + [Environment]::SetEnvironmentVariable("PATH", "$(Join-Path -Path $projectDir -ChildPath $qt6BinDir);$systemPath", [EnvironmentVariableTarget]::Machine) + Write-Host "Qt6 binary directory path added to system PATH." @info_colors + } else { + Write-Host "Did not write to PATH: Qt6 binary directory path already exists in system PATH." @info_colors + } +} else { + Write-Host "Attempting to use existing system installation of Qt6... " @info_colors + $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + + if ($systemPath -notmatch [regex]::Escape($qtVersion)) { + Write-Host "Found Qt6 version that is NOT ${qtVersion} in system PATH. It is strongly recommended to use Qt ${qtVersion}" @info_colors + } +} + +# Build/retrieve Freetype +$freetypeVersion = "2.12.1" +$freetypeArchive = "https://download.savannah.gnu.org/releases/freetype/freetype-$freetypeVersion.tar.gz" +$freetypeRepo = "freetype-repo" +$freetypeInstall = "freetype-install" +$freetypeOutput = "freetype.tgz" + +$freetypeInstallDir = (Join-Path -Path $dependencies -ChildPath $freetypeInstall) +New-Item -ItemType Directory -Path $freetypeInstallDir -ErrorAction SilentlyContinue + +$freetypeBuildDir = (Join-Path -Path $dependencies -ChildPath "freetype-build") +New-Item -ItemType Directory -Path $freetypeBuildDir -ErrorAction SilentlyContinue + +Write-Host "Downloading freetype archive... " @info_colors +Invoke-WebRequest -Uri $freetypeArchive -OutFile $freetypeOutput + +Write-Host "Unpacking freetype... " @info_colors +tar -zxvf $freetypeOutput -C $dependencies + +Remove-Item -Path $freetypeOutput -Force +Rename-Item -Path (Join-Path -Path $dependencies -ChildPath "freetype-$freetypeVersion") -NewName $freetypeRepo + +Write-Host "Building freetype (from location: $freetypeBuildDir)... " @info_colors +Set-Location -Path $freetypeBuildDir + +cmake ../$freetypeRepo -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE:STRING=$build -DCMAKE_C_COMPILER=cl -DBUILD_SHARED_LIBS:STRING=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz:bool=true -DCMAKE_DISABLE_FIND_PACKAGE_BZip2:bool=true -DCMAKE_DISABLE_FIND_PACKAGE_PNG:bool=true -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB:bool=true -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec:bool=true -DCMAKE_INSTALL_PREFIX:path=../$freetypeInstall +cmake --build . --target install --config $build + +$freetypeLib = "$freetypeInstall\lib" +$freetypeBin = "$freetypeInstall\bin" + +$freetypeLibPath = Join-Path -Path $projectDir -ChildPath "$dependencies\$freetypeLib" +$freetypeBinPath = Join-Path -Path $projectDir -ChildPath "$dependencies\$freetypeBin" + +$lib = [System.Environment]::GetEnvironmentVariable("LIB", [System.EnvironmentVariableTarget]::Machine) + +if ($lib -notlike "*$freetypeInstall*") { + Write-Host "Setting LIB environment variable with Freetype library... " @info_colors + [System.Environment]::SetEnvironmentVariable("LIB", "$freetypeLibPath;$freetypeBinPath;$lib", [System.EnvironmentVariableTarget]::Machine) +} + +$freetypeIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$freetypeRepo" +$freetype2IncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$freetypeInstall\include\freetype2" + +$include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) + +if ($include -notlike "*$freetypeRepo*") { + Write-Host "Setting INCLUDE environment variable with Freetype includes... " @info_colors + [System.Environment]::SetEnvironmentVariable("INCLUDE", "$freetypeIncludePath;$freetype2IncludePath;$include", [System.EnvironmentVariableTarget]::Machine) +} + +# Build/retrieve FTGL +Set-Location -Path $projectDir + +$ftglUri = "https://github.com/disorderedmaterials/ftgl-2.4.0.git" +$ftglRepo = "ftgl-repo" +$ftglInstall = "ftgl-install" +$freetypeRepoPath = (Join-Path -Path $dependencies -ChildPath $freetypeRepo) + +$ftglInstallDir = (Join-Path -Path $dependencies -ChildPath $ftglInstall) +New-Item -ItemType Directory -Path $ftglInstallDir -ErrorAction SilentlyContinue + +$ftglBuildDir = (Join-Path -Path $dependencies -ChildPath "ftgl-build") +New-Item -ItemType Directory -Path $ftglBuildDir -ErrorAction SilentlyContinue + +$ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-repo") + +Write-Host "Cloning FTGL (DisorderedMaterials fork) repo... " @info_colors +git clone $ftglUri $ftglRepoPath + +Set-Location -Path $projectDir + +$ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\lib" +$ftglBinPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\bin" +$ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include" + +Write-Host "Building FTGL (from location: $ftglBuildDir)... " @info_colors + +if (-not $release) { + Copy-Item -Path "$freetypeBinPath\freetyped.dll" -Destination "$freetypeBinPath\freetype.dll" + Copy-Item -Path "$freetypeLibPath\freetyped.lib" -Destination "$freetypeLibPath\freetype.lib" +} + +Set-Location -Path $ftglBuildDir + +cmake ../$ftglRepo -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE:STRING=$build -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY="$(Join-Path -Path $freetypeLibPath -ChildPath "freetype.lib")" -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" +cmake --build . --target install --config $build + +$ftglLib = "$ftglInstall\lib" +$ftglBin = "$ftglInstall\bin" + +$ftglLibPath = Join-Path -Path $projectDir -ChildPath "$dependencies\$ftglLib" +$ftglBinPath = Join-Path -Path $projectDir -ChildPath "$dependencies\$ftglBin" + +$lib = [System.Environment]::GetEnvironmentVariable("LIB", [System.EnvironmentVariableTarget]::Machine) + +if ($lib -notlike "*$ftglInstall*") { + Write-Host "Setting LIB environment variable with FTGL library... " @info_colors + [System.Environment]::SetEnvironmentVariable("LIB", "$ftglLibPath;$ftglBinPath;$lib", [System.EnvironmentVariableTarget]::Machine) +} + +$ftglInclude = "$ftglRepo\src" +$ftglIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$ftglInclude" + +$include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) + +if ($include -notlike "*$ftglInclude*") { + Write-Host "Setting INCLUDE environment variable with FTGL includes... " @info_colors + [System.Environment]::SetEnvironmentVariable("INCLUDE", "$ftglIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) +} + +# Get ANTLR and Java +Set-Location -Path $projectDir + +$antlrUri = "https://www.antlr.org/download/antlr-$antlrVersion-complete.jar" +$antlrOutput = "antlr-$antlrVersion-complete.jar" + +$javaUri = "https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.zip" +$javaOutput = "java.zip" +$jdkVersion = "21.0.5" + +Set-Location -Path $dependencies + +Write-Host "Downloading ANTLR... " @info_colors +Invoke-WebRequest -Uri $antlrUri -OutFile $antlrOutput + +Write-Host "Downloading Java... " @info_colors +Invoke-WebRequest -Uri $javaUri -OutFile $javaOutput + +Write-Host "Unpacking Java... " @info_colors +Expand-Archive -Path $javaOutput -DestinationPath . -Force +Remove-Item -Path $javaOutput -Force + +$javaSDKPath = Join-Path -Path $projectDir -ChildPath "$dependencies\jdk-$jdkVersion" +$javaExePath = Join-Path -Path $javaSDKPath -ChildPath "bin\java" + +$antlrExePath = "$(Join-Path -Path $projectDir -ChildPath "$dependencies")\$antlrOutput" +New-Item -ItemType Directory -Path $antlrExePath -ErrorAction SilentlyContinue +Move-Item -Path $antlrOutput -Destination $antlrExePath + +# Set Conan +Set-Location -Path $projectDir + +Write-Host "Setting up Conan profile... " @info_colors +conan profile new default --detect +conan profile update settings.compiler="Visual Studio" default +conan profile update settings.compiler.version=17 default + +# Generate Cmake user presets JSON for MSVC Cmake configurations +$out = Join-Path -Path $projectDir -ChildPath "build" +$cacheVariables = @{ + CMAKE_C_COMPILER = "cl" + CMAKE_CXX_COMPILER = "cl" + FTGL_LIBRARY = "$ftglLibPath\ftgl$binSuffix.lib" + FTGL_INCLUDE_DIR = $ftglIncludePath + FREETYPE_LIBRARY = "$freetypeLibPath\freetype$binSuffix.lib" + FREETYPE_INCLUDE_DIRS = "$freetypeIncludePath;$freetype2IncludePath" + ANTLR_EXECUTABLE = $antlrExePath + Java_JAVA_EXECUTABLE = $javaExePath + MULTI_THREADING = $threading + MSVC_DEV = "ON" + CMAKE_PREFIX_PATH = "$qt6Dir" +} + +$cmakeUserPresets = [PSCustomObject]@{ + version = 3 + cmakeMinimumRequired = @{ + major = 3 + minor = 21 + } + configurePresets = @() +} + +$presets = @( + [PSCustomObject]@{ + name = "CLI-$build-MSVC" + displayName = "CLI $build Build" + description = "The preset for a CLI $build build on MSVC" + inherits = @("CLI-$build") + }, + [PSCustomObject]@{ + name = "GUI-$build-MSVC" + displayName = "GUI $build Build" + description = "The preset for a GUI $build build on MSVC" + inherits = @("GUI-$build") + } +) + +foreach ($preset in $presets) { + $preset | Add-Member -MemberType NoteProperty -Name cacheVariables -Value ($cacheVariables + @{ + CONFIG = "$($preset.name)-x64" + }) + $cmakeUserPresets.configurePresets += $preset +} + +Write-Host "Outputting CMakeUserPresets Json for Dissolve MSVC configuration... " @info_colors +$cmakeUserPresetsJson = $cmakeUserPresets | ConvertTo-Json -Depth 10 -Compress + +Set-Content -Path "CMakeUserPresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 + + + diff --git a/web/docs/userguide/developers/docker.md b/web/docs/userguide/developers/docker.md index 4a884a49b9..03bc8114a0 100644 --- a/web/docs/userguide/developers/docker.md +++ b/web/docs/userguide/developers/docker.md @@ -95,9 +95,18 @@ which will hook dissolve's dev environment into the new shell. ## Debugging dissolve inside a container -Using a combination of the X server and the GNU gdb debugger we can step through the container-hosted dissolve code in a visual environment. +For Dissolve CLI, it is straightforward to debug using GDB - run `gdb -tui ./build/bin/dissolve`. -However, for this Docker setup we are running dissolve's GUI via the `nixGLIntel` wrapper so debugging it is a slightly invovled process. +To debug unit tests, navigate to the test data directory with `cd tests/data`, and then execute gdb from there `gdb -tui ../../build/bin/`. + +Depending on the system on which you are running the Docker engine, the host graphics resources may be available to the container +in such a way that it is not necessary to run Dissolve GUI inside the `nixGLIntel` wrapper executable, and we can simply invoke `.\dissolve-gui`. + +This opens up the possibility of directly invoking the `dissolve-gui` executable in the above call to gdb. + +However, this is not guaranteed for all Windows systems, so debugging dissolve GUI could be a more involved process. + +In this example Docker setup we are running dissolve's GUI via the `nixGLIntel` wrapper. First, `exec` into the container with `direnv allow; bash` as the entrypoint as you normally would. diff --git a/web/docs/userguide/developers/vs2022.md b/web/docs/userguide/developers/vs2022.md new file mode 100644 index 0000000000..05bd98ee53 --- /dev/null +++ b/web/docs/userguide/developers/vs2022.md @@ -0,0 +1,75 @@ +--- +title: Setting up a dev environment for the MSVC toolchain (Visual Studio 2022) for Windows +description: Instructions for building, running, and debugging Dissolve in Visual Studio 2022 with CMake, using the developer Powershell tool to install dependencies. +--- + +## Introduction + +Outlined below is a step-by-step guide to setting up a development environment on Windows using Visual Studio 2022. + +### Basic requirements + +Install [Microsoft Visual Studio 2022](https://visualstudio.microsoft.com/vs/features/cplusplus/), and use the Visual Studio Installer application to install the "Desktop Development with C++" workload. + +You will also need the Developer Powershell for VS2022 application in which you can run powershell scripts, which should come packaged with Visual Studio. + +Download the Dissolve Github repository using the full Visual Studio 2022 Git integration for a streamlined development experience. Visual Studio will ask you sign in to GitHub with your credentials if you want to do this. + +### Install dependencies using powershell script + +Open Developer Powershell for VS2022 from Windows as administrator (since system environment variables are modified), and navigate to the Dissolve Visual Studio repo folder. + +Run the following Powershell command to enable scripts: +```shell +Set-ExecutionPolicy Bypass -Scope Process +``` + +There is a pre-packaged Powershell script (develop.ps1) which can be run from the top-level of the Dissolve project directory: +```shell +./develop.ps1 -qtVersion 6.4.2 +``` + +This script can be used to install the following packages into a `dependencies` folder: +- Qt6 +- Freetype +- FTGL +- Antlr4 +- Java + +A specific version of Qt can be specified for installation via the `-qtVersion` parameter (i.e. 6.4.2). +If you have an existing system Qt6 installation, the script can default to using this by ignoring the `-qtVersion` parameter. +Ensure that the system Qt `msvc2019_64` binaries are added to the PATH prior to using your own Qt installation. + +The script defaults to configuring dependencies for `Debug`. If you want to develop in `Release` mode, use the appropriate flag: +```shell +./develop.ps1 -release -qtVersion 6.4.2 +``` + +The output of the script is a custom `CMakeUserPresets.json` which contains configurations for building Dissolve CLI and GUI with CMake. + +### Configure Dissolve in Visual Studio with CMake support + +In Visual Studio, open the Dissolve repo. In the configurations dropdown you should see either +- CLI-Debug (CLI-Debug-MSVC) +- GUI-Debug (GUI-Debug-MSVC) + +or +- CLI-Release (CLI-Release-MSVC) +- GUI-Release (GUI-Release-MSVC) + +listed as available configurations. These are the user presets that we will be targetting to develop Dissolve in Visual Studio. + +Once the preferred preset is selected, right-click the Dissolve `CMakeLists.txt` in the Visual Studio solution explorer, and select `Configure Cache`. +This should start the CMake configuration process, which involves using the Conan package manager to install the remaining dependencies. +Visual Studio may have been set up to do this automatically when the project is opened, or if any saved changes are made to `CMakeLists.txt`. + +Note: on configuration, you may experience a Conan error "locked by another concurrent conan process". Typically this can be resolved using the command `conan remove --locks` in a developer powershell. If this does not work, navigate to your C drive `.conan` folder and delete the `data` sub-directory. + +### Build project + +Once configuration is complete, make sure to select the correct target executable from the `startup item` dropdown in Visual Studio. +This will be either: +- `Dissolve.exe` (CLI version) +- `Dissolve-GUI.exe` (GUI version) + +From the `Build` menu, select `Build `.