From bdfa7c17a7fe97e41c217b3b2f7abb49a6a98b60 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 27 Nov 2024 16:31:28 +0000 Subject: [PATCH 01/91] powershell script to install dependencies --- develop.ps1 | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 develop.ps1 diff --git a/develop.ps1 b/develop.ps1 new file mode 100644 index 0000000000..20f098a4e0 --- /dev/null +++ b/develop.ps1 @@ -0,0 +1,186 @@ +[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 +choco install -y git ninja wget pkgconfiglite + +$gitExePath = where.exe git + +# Setup Python packages +python -m venv msvc-env +./msvc-env/Scripts/Activate.ps1 +python -m pip install --upgrade pip +python -m pip install conan aqtinstall conan==1.* + +# Install Qt6 +$qtVersion = "6.4.2" +$qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" +New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyContinue + +aqt install-qt --outputdir $qtInstallationDir windows desktop $qtVersion win64_msvc2019_64 -m all + +$qt6Dir = Join-Path -Path $dependencies -ChildPath "qt\$qtVersion\msvc_2019_64" +$qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" + +$systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + +#if ($systemPath -notmatch [regex]::Escape($qt6BinDir)) { +# [Environment]::SetEnvironmentVariable("PATH", "$qt6BinDir;$systemPath", [EnvironmentVariableTarget]::Machine) +# Write-Output "Qt6 binary directory path added to system PATH." +#} else { +# Write-Output "Did not write to PATH: Qt6 binary directory path already exists in system PATH." +#} + +# Build/retrieve Freetype +$freetypeVersion = "2.12.1" +$freetypeArchive = "https://download.savannah.gnu.org/releases/freetype/freetype-$freetypeVersion.tar.gz" +$freetypeRepo = "freetype-latest" +$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 + +Invoke-WebRequest -Uri $freetypeArchive -OutFile $freetypeOutput + +tar -zxvf $freetypeOutput -C $dependencies + +Remove-Item -Path $freetypeOutput -Force +Rename-Item -Path (Join-Path -Path $dependencies -ChildPath "freetype-$freetypeVersion") -NewName $freetypeRepo + +Set-Location -Path $freetypeBuildDir + +cmake ../$freetypeRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -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 Release + +# Build/retrieve FTGL +Set-Location -Path $projectDir + +$ftglUri = "https://github.com/disorderedmaterials/ftgl-2.4.0.git" +$ftglRepo = "ftgl-latest" +$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-latest") +& "$gitExePath" clone $ftglUri $ftglRepoPath + +Set-Location -Path $projectDir + +$freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" +$freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" + +Set-Location -Path $ftglBuildDir + +cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=../$freetypeInstall/lib -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" +cmake --build . --target install --config Release + +# Get ANTLR and Java +Set-Location -Path $projectDir + +$antlrVersion = "4.13.1" +$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 + +Invoke-WebRequest -Uri $antlrUri -OutFile $antlrOutput +Invoke-WebRequest -Uri $javaUri -OutFile $javaOutput +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" + +$antlrExePath = Join-Path -Path $projectDir -ChildPath "$dependencies\antlr" +New-Item -ItemType Directory -Path $antlrExePath -ErrorAction SilentlyContinue +Move-Item -Path $antlrOutput -Destination $antlrExePath + +# Set Conan +Set-Location -Path $projectDir +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" + ANTLR_EXECUTABLE = $antlrExePath + Java_JAVA_EXECUTABLE = $javaExePath + CMAKE_CXX_COMPILER = "cl" + MULTI_THREADING = $threading + CMAKE_INSTALL_PREFIX = $out +} + +$cmakeUserPresets = [PSCustomObject]@{ + version = 3 + cmakeMinimumRequired = @{ + major = 3 + minor = 21 + } + configurePresets = @() +} + +$presets = @( + [PSCustomObject]@{ + name = "CLI-Release-MSVC" + displayName = "CLI Release Build" + description = "The preset for a CLI production build without tests on MSVC" + inherits = @("CLI-Release") + #cacheVariables = @{} + }, + [PSCustomObject]@{ + name = "CLI-Debug-MSVC" + displayName = "CLI Debug Build" + description = "The preset for a CLI debug build with tests on MSVC" + inherits = @("CLI-Debug") + #cacheVariables = @{} + }, + [PSCustomObject]@{ + name = "GUI-Release-MSVC" + displayName = "GUI Release Build" + description = "The preset for a GUI production build without tests on MSVC" + inherits = @("GUI-Release") + #cacheVariables = @{} + }, + [PSCustomObject]@{ + name = "GUI-Debug-MSVC" + displayName = "GUI Debug Build" + description = "The preset for a GUI debug build with tests on MSVC" + inherits = @("GUI-Debug") + #cacheVariables = @{} + } +) + +foreach ($preset in $presets) { + $preset | Add-Member -MemberType NoteProperty -Name cacheVariables -Value $cacheVariables + $cmakeUserPresets.configurePresets += $preset +} + +$cmakeUserPresetsJson = $cmakeUserPresets | ConvertTo-Json -Depth 10 -Compress + +Set-Content -Path "CMakeUserPresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 + + + + + From 42d77b18f261331d1e5123d3fbf93aa20d4246b9 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 27 Nov 2024 16:34:18 +0000 Subject: [PATCH 02/91] updated script --- develop.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 20f098a4e0..a4f990aefa 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -146,28 +146,24 @@ $presets = @( displayName = "CLI Release Build" description = "The preset for a CLI production build without tests on MSVC" inherits = @("CLI-Release") - #cacheVariables = @{} }, [PSCustomObject]@{ name = "CLI-Debug-MSVC" displayName = "CLI Debug Build" description = "The preset for a CLI debug build with tests on MSVC" inherits = @("CLI-Debug") - #cacheVariables = @{} }, [PSCustomObject]@{ name = "GUI-Release-MSVC" displayName = "GUI Release Build" description = "The preset for a GUI production build without tests on MSVC" inherits = @("GUI-Release") - #cacheVariables = @{} }, [PSCustomObject]@{ name = "GUI-Debug-MSVC" displayName = "GUI Debug Build" description = "The preset for a GUI debug build with tests on MSVC" inherits = @("GUI-Debug") - #cacheVariables = @{} } ) From cbbbfec102e320fb8d88912ee1f4a7f079eb39f5 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 27 Nov 2024 19:07:26 +0000 Subject: [PATCH 03/91] add flag to use existing system qt --- develop.ps1 | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index a4f990aefa..1b5734fe20 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -1,3 +1,8 @@ +# Use existing Qt installation (requires Qt6_DIR environment variable to be set) +param ( + [switch]$systemqt = $true +) + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 $projectDir = Get-Location @@ -25,17 +30,21 @@ New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyConti aqt install-qt --outputdir $qtInstallationDir windows desktop $qtVersion win64_msvc2019_64 -m all -$qt6Dir = Join-Path -Path $dependencies -ChildPath "qt\$qtVersion\msvc_2019_64" -$qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" +if (-not $systemqt) { + # Export Qt6_DIR to system environment variables + $qt6Dir = Join-Path -Path $dependencies -ChildPath "qt\$qtVersion\msvc_2019_64" + $qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" + -$systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) -#if ($systemPath -notmatch [regex]::Escape($qt6BinDir)) { -# [Environment]::SetEnvironmentVariable("PATH", "$qt6BinDir;$systemPath", [EnvironmentVariableTarget]::Machine) -# Write-Output "Qt6 binary directory path added to system PATH." -#} else { -# Write-Output "Did not write to PATH: Qt6 binary directory path already exists in system PATH." -#} + if ($systemPath -notmatch [regex]::Escape($qt6BinDir)) { + [Environment]::SetEnvironmentVariable("PATH", "$qt6BinDir;$systemPath", [EnvironmentVariableTarget]::Machine) + Write-Output "Qt6 binary directory path added to system PATH." + } else { + Write-Output "Did not write to PATH: Qt6 binary directory path already exists in system PATH." + } +} # Build/retrieve Freetype $freetypeVersion = "2.12.1" From 56ca8fda944f2b80a4e6b249ced3a86e4df71b83 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 27 Nov 2024 19:10:57 +0000 Subject: [PATCH 04/91] only install qt6 via python if not system qt --- develop.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 1b5734fe20..1272baba75 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -23,14 +23,14 @@ python -m venv msvc-env python -m pip install --upgrade pip python -m pip install conan aqtinstall conan==1.* -# Install Qt6 -$qtVersion = "6.4.2" -$qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" -New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyContinue +if (-not $systemqt) { + # Install Qt6 + $qtVersion = "6.4.2" + $qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" + New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyContinue -aqt install-qt --outputdir $qtInstallationDir windows desktop $qtVersion win64_msvc2019_64 -m all + aqt install-qt --outputdir $qtInstallationDir windows desktop $qtVersion win64_msvc2019_64 -m all -if (-not $systemqt) { # Export Qt6_DIR to system environment variables $qt6Dir = Join-Path -Path $dependencies -ChildPath "qt\$qtVersion\msvc_2019_64" $qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" From 3c2494ba7b9dd4f61176ff56df3fba57b0776f03 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 28 Nov 2024 09:30:27 +0000 Subject: [PATCH 05/91] flag bool --- develop.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 1272baba75..93f58a4021 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -1,6 +1,6 @@ -# Use existing Qt installation (requires Qt6_DIR environment variable to be set) +# Flag: Use existing Qt installation (requires Qt6_DIR environment variable to be set) param ( - [switch]$systemqt = $true + [switch]$systemqt = $false ) [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 From ad699eee9ed1aa27a150e3a3651d6054049b85e6 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 10:52:16 +0000 Subject: [PATCH 06/91] ftgl paths, fix antlr executable path --- develop.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 93f58a4021..61c35252b7 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -90,6 +90,9 @@ $ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-latest") Set-Location -Path $projectDir +$ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\lib" +$ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include\FTGL" + $freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" $freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" @@ -119,7 +122,7 @@ Remove-Item -Path $javaOutput -Force $javaSDKPath = Join-Path -Path $projectDir -ChildPath "$dependencies\jdk-$jdkVersion" $javaExePath = Join-Path -Path $javaSDKPath -ChildPath "bin" -$antlrExePath = Join-Path -Path $projectDir -ChildPath "$dependencies\antlr" +$antlrExePath = "$(Join-Path -Path $projectDir -ChildPath "$dependencies")\$antlrOutput" New-Item -ItemType Directory -Path $antlrExePath -ErrorAction SilentlyContinue Move-Item -Path $antlrOutput -Destination $antlrExePath @@ -133,9 +136,11 @@ conan profile update settings.compiler.version=17 default $out = Join-Path -Path $projectDir -ChildPath "build" $cacheVariables = @{ CMAKE_C_COMPILER = "cl" + CMAKE_CXX_COMPILER = "cl" + FTGL_LIBRARY = $ftglLibPath + FTGL_INCLUDE_DIR = $ftglLibPath ANTLR_EXECUTABLE = $antlrExePath Java_JAVA_EXECUTABLE = $javaExePath - CMAKE_CXX_COMPILER = "cl" MULTI_THREADING = $threading CMAKE_INSTALL_PREFIX = $out } From 00a10789146bf49d9c65a6a4bb44f3eb7aee037d Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 11:09:12 +0000 Subject: [PATCH 07/91] use correct ftgl paths --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 61c35252b7..d034bf7ceb 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -138,7 +138,7 @@ $cacheVariables = @{ CMAKE_C_COMPILER = "cl" CMAKE_CXX_COMPILER = "cl" FTGL_LIBRARY = $ftglLibPath - FTGL_INCLUDE_DIR = $ftglLibPath + FTGL_INCLUDE_DIR = $ftglIncludePath ANTLR_EXECUTABLE = $antlrExePath Java_JAVA_EXECUTABLE = $javaExePath MULTI_THREADING = $threading From ab06f47bb6fcd48354756d53f602fbd8d083aa62 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 11:29:51 +0000 Subject: [PATCH 08/91] pretty format output json --- develop.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index d034bf7ceb..8f34c388a2 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -21,7 +21,7 @@ $gitExePath = where.exe git python -m venv msvc-env ./msvc-env/Scripts/Activate.ps1 python -m pip install --upgrade pip -python -m pip install conan aqtinstall conan==1.* +python -m pip install pprintjson conan aqtinstall conan==1.* if (-not $systemqt) { # Install Qt6 @@ -187,10 +187,13 @@ foreach ($preset in $presets) { } $cmakeUserPresetsJson = $cmakeUserPresets | ConvertTo-Json -Depth 10 -Compress +$unformattedJson = "presets.json" -Set-Content -Path "CMakeUserPresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 +Set-Content -Path $unformattedJson -Value $cmakeUserPresetsJson -Encoding UTF8 +python -c "from pprintjson import pprintjson; import json, sys; pprintjson(json.load(open('$unformattedJson')), indent=4)" > CMakeUserPresets.json +Remove-Item -Path $unformattedJson -Force From 3dddf288c3f742dca4f4890e18a0ece6467ec1d4 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 11:47:20 +0000 Subject: [PATCH 09/91] pretty format output json 2 --- develop.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 8f34c388a2..2c22e9c0aa 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -187,13 +187,12 @@ foreach ($preset in $presets) { } $cmakeUserPresetsJson = $cmakeUserPresets | ConvertTo-Json -Depth 10 -Compress -$unformattedJson = "presets.json" -Set-Content -Path $unformattedJson -Value $cmakeUserPresetsJson -Encoding UTF8 +Set-Content -Path "userpresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 -python -c "from pprintjson import pprintjson; import json, sys; pprintjson(json.load(open('$unformattedJson')), indent=4)" > CMakeUserPresets.json +python -c "from pprintjson import pprintjson; import json, sys; pprintjson(json.load(open('userpresets.json')), indent=4)" > CMakeUserPresets.json -Remove-Item -Path $unformattedJson -Force +Remove-Item -Path "userpresets.json" -Force From 68ca640ae7c9529dac03a9dd3779b63574e1703c Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 11:56:19 +0000 Subject: [PATCH 10/91] don't bother with json formatting for now --- develop.ps1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 2c22e9c0aa..2de2b8f3f5 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -188,11 +188,7 @@ foreach ($preset in $presets) { $cmakeUserPresetsJson = $cmakeUserPresets | ConvertTo-Json -Depth 10 -Compress -Set-Content -Path "userpresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 - -python -c "from pprintjson import pprintjson; import json, sys; pprintjson(json.load(open('userpresets.json')), indent=4)" > CMakeUserPresets.json - -Remove-Item -Path "userpresets.json" -Force +Set-Content -Path "CMakeUserPresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 From f15cee7e649e4cb2de8fdc187d660c72160a494e Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 12:19:58 +0000 Subject: [PATCH 11/91] add java executable to path --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 2de2b8f3f5..d95a73c3b1 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -120,7 +120,7 @@ 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" +$javaExePath = Join-Path -Path $javaSDKPath -ChildPath "bin\java" $antlrExePath = "$(Join-Path -Path $projectDir -ChildPath "$dependencies")\$antlrOutput" New-Item -ItemType Directory -Path $antlrExePath -ErrorAction SilentlyContinue From 320da75360de957df1dde54b00635dc6e06c0972 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 13:03:53 +0000 Subject: [PATCH 12/91] ammend ftgl path --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index d95a73c3b1..2e8f434dbf 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -91,7 +91,7 @@ $ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-latest") Set-Location -Path $projectDir $ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\lib" -$ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include\FTGL" +$ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include" $freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" $freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" From bf03bf61d1fe6ae16ad5fd19909e9696062ec961 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 29 Nov 2024 13:13:30 +0000 Subject: [PATCH 13/91] ammend ftgl paths --- develop.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 2e8f434dbf..2c002750f7 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -91,6 +91,7 @@ $ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-latest") 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" $freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" @@ -137,7 +138,7 @@ $out = Join-Path -Path $projectDir -ChildPath "build" $cacheVariables = @{ CMAKE_C_COMPILER = "cl" CMAKE_CXX_COMPILER = "cl" - FTGL_LIBRARY = $ftglLibPath + FTGL_LIBRARY = "$ftglLibPath\ftgl.lib;$ftglBinPath\ftgl.dll" FTGL_INCLUDE_DIR = $ftglIncludePath ANTLR_EXECUTABLE = $antlrExePath Java_JAVA_EXECUTABLE = $javaExePath From 3fd2e80628375f26f42e3df829621764879e4a41 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Sat, 30 Nov 2024 11:49:37 +0000 Subject: [PATCH 14/91] check python compiler version --- develop.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 2c002750f7..dc0186908a 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -19,11 +19,22 @@ $gitExePath = where.exe git # Setup Python packages python -m venv msvc-env -./msvc-env/Scripts/Activate.ps1 + +if ($(python -c "import sys; print(sys.version)") -match "MSC v\.\d+") +{ + $pythonEnvSourceDir = "Scripts" +} +else +{ + $pythonEnvSourceDir = "bin" +} + +./msvc-env/$pythonEnvSourceDir/Activate.ps1 python -m pip install --upgrade pip python -m pip install pprintjson conan aqtinstall conan==1.* -if (-not $systemqt) { +if (-not $systemqt) +{ # Install Qt6 $qtVersion = "6.4.2" $qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" From fe24b6a2264952fb1de6182d6837e9577ccfcedd Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Sun, 1 Dec 2024 15:45:14 +0000 Subject: [PATCH 15/91] properly activate python environment --- develop.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index dc0186908a..c2d3d76764 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -29,7 +29,8 @@ else $pythonEnvSourceDir = "bin" } -./msvc-env/$pythonEnvSourceDir/Activate.ps1 +$activate = "./msvc-env/$pythonEnvSourceDir/Activate.ps1" +& $activate python -m pip install --upgrade pip python -m pip install pprintjson conan aqtinstall conan==1.* From 2b711ebc8d19ad4b63bf8ad451ec7b3c451caa16 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Sun, 1 Dec 2024 16:40:44 +0000 Subject: [PATCH 16/91] update freetype lib paths --- develop.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index c2d3d76764..40d561901e 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -106,12 +106,14 @@ $ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftgl $ftglBinPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\bin" $ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include" -$freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" -$freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" +#$freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" +#$freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" + +$freetypeLibPath = "$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\lib\freetype;$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\bin\freetype" Set-Location -Path $ftglBuildDir -cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=../$freetypeInstall/lib -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" +cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=$freetypeLibPath -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" cmake --build . --target install --config Release # Get ANTLR and Java From 1e199863f363034c88591adcbaae851e4d9a3d9a Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Sun, 1 Dec 2024 19:54:24 +0000 Subject: [PATCH 17/91] revert to previous freetype paths for ftgl build --- develop.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 40d561901e..c2d3d76764 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -106,14 +106,12 @@ $ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftgl $ftglBinPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\bin" $ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include" -#$freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" -#$freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" - -$freetypeLibPath = "$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\lib\freetype;$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\bin\freetype" +$freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" +$freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" Set-Location -Path $ftglBuildDir -cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=$freetypeLibPath -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" +cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=../$freetypeInstall/lib -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" cmake --build . --target install --config Release # Get ANTLR and Java From f4f0d022bebc41edee5d3ba8e490706cd45eba14 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Sun, 1 Dec 2024 20:32:13 +0000 Subject: [PATCH 18/91] console output --- develop.ps1 | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index c2d3d76764..6f4ac6c2dc 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -3,6 +3,11 @@ param ( [switch]$systemqt = $false ) +$colors = @{ + ForegroundColor = "White" + BackgroundColor = "Cyan" +} + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 $projectDir = Get-Location @@ -13,24 +18,34 @@ $dependencies = "dependencies" New-Item -ItemType Directory -Path $dependencies -ErrorAction SilentlyContinue #Install key dependencies with Chocolatey +Write-Host "Installing key dependencies with Chocolatey... " @colors choco install -y git ninja wget pkgconfiglite +Write-Host "Locating git executable... " @colors $gitExePath = where.exe git # Setup Python packages +Write-Host "Creating a local Python virtual environment... " @colors python -m venv msvc-env +Write-Host "Checking Python compiler type... " @colors if ($(python -c "import sys; print(sys.version)") -match "MSC v\.\d+") { + Write-Host " Python...compiler type evaluated to MSC" $pythonEnvSourceDir = "Scripts" } else { + Write-Host " Python...compiler type is not MSC" $pythonEnvSourceDir = "bin" } $activate = "./msvc-env/$pythonEnvSourceDir/Activate.ps1" + +Write-Host "Activating virtual environment with the command: $activate... " @colors & $activate + +Write-Host "Installing Python packages... " @colors python -m pip install --upgrade pip python -m pip install pprintjson conan aqtinstall conan==1.* @@ -41,20 +56,22 @@ if (-not $systemqt) $qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyContinue + Write-Host "Installing Qt6... " @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\msvc_2019_64" $qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" - + Write-Host "Locating system PATH... " @colors $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + Write-Host "Adding Qt6 directory to system PATH... " @colors if ($systemPath -notmatch [regex]::Escape($qt6BinDir)) { [Environment]::SetEnvironmentVariable("PATH", "$qt6BinDir;$systemPath", [EnvironmentVariableTarget]::Machine) - Write-Output "Qt6 binary directory path added to system PATH." + Write-Host "Qt6 binary directory path added to system PATH." @colors } else { - Write-Output "Did not write to PATH: Qt6 binary directory path already exists in system PATH." + Write-Host "Did not write to PATH: Qt6 binary directory path already exists in system PATH." @colors } } @@ -71,13 +88,16 @@ New-Item -ItemType Directory -Path $freetypeInstallDir -ErrorAction SilentlyCont $freetypeBuildDir = (Join-Path -Path $dependencies -ChildPath "freetype-build") New-Item -ItemType Directory -Path $freetypeBuildDir -ErrorAction SilentlyContinue +Write-Host "Downloading freetype archive... " @colors Invoke-WebRequest -Uri $freetypeArchive -OutFile $freetypeOutput +Write-Host "Unpacking freetype... " @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)... " @colors Set-Location -Path $freetypeBuildDir cmake ../$freetypeRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -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 @@ -98,6 +118,8 @@ $ftglBuildDir = (Join-Path -Path $dependencies -ChildPath "ftgl-build") New-Item -ItemType Directory -Path $ftglBuildDir -ErrorAction SilentlyContinue $ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-latest") + +Write-Host "Cloning FTGL (DisorderedMaterials fork) repo... " @colors & "$gitExePath" clone $ftglUri $ftglRepoPath Set-Location -Path $projectDir @@ -109,6 +131,7 @@ $ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ $freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" $freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" +Write-Host "Building FTGL (from location: $ftglBuildDir)... " @colors Set-Location -Path $ftglBuildDir cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=../$freetypeInstall/lib -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" @@ -127,8 +150,13 @@ $jdkVersion = "21.0.5" Set-Location -Path $dependencies +Write-Host "Downloading ANTLR... " @colors Invoke-WebRequest -Uri $antlrUri -OutFile $antlrOutput + +Write-Host "Downloading Java... " @colors Invoke-WebRequest -Uri $javaUri -OutFile $javaOutput + +Write-Host "Unpacking Java... " @colors Expand-Archive -Path $javaOutput -DestinationPath . -Force Remove-Item -Path $javaOutput -Force @@ -141,6 +169,8 @@ Move-Item -Path $antlrOutput -Destination $antlrExePath # Set Conan Set-Location -Path $projectDir + +Write-Host "Setting up Conan profile... " @colors conan profile new default --detect conan profile update settings.compiler="Visual Studio" default conan profile update settings.compiler.version=17 default @@ -199,6 +229,7 @@ foreach ($preset in $presets) { $cmakeUserPresets.configurePresets += $preset } +Write-Host "Outputting CMakeUserPresets Json for Dissolve MSVC configuration... " @colors $cmakeUserPresetsJson = $cmakeUserPresets | ConvertTo-Json -Depth 10 -Compress Set-Content -Path "CMakeUserPresets.json" -Value $cmakeUserPresetsJson -Encoding UTF8 From 19848abc8bc84f61fd7fbe184b7c3178af88bca3 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Sun, 1 Dec 2024 20:37:23 +0000 Subject: [PATCH 19/91] more console output --- develop.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 6f4ac6c2dc..5f3ca67d4e 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -31,12 +31,12 @@ python -m venv msvc-env Write-Host "Checking Python compiler type... " @colors if ($(python -c "import sys; print(sys.version)") -match "MSC v\.\d+") { - Write-Host " Python...compiler type evaluated to MSC" + Write-Host " Python...compiler type evaluated to MSC" @colors $pythonEnvSourceDir = "Scripts" } else { - Write-Host " Python...compiler type is not MSC" + Write-Host " Python...compiler type is not MSC" @colors $pythonEnvSourceDir = "bin" } From b9793d144b66b2a696ee94fd5b142bfc901589aa Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Mon, 2 Dec 2024 21:22:07 +0000 Subject: [PATCH 20/91] paths to conan packages --- develop.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/develop.ps1 b/develop.ps1 index 5f3ca67d4e..9c2e3e0d8d 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -186,6 +186,11 @@ $cacheVariables = @{ Java_JAVA_EXECUTABLE = $javaExePath MULTI_THREADING = $threading CMAKE_INSTALL_PREFIX = $out + fmt_DIR = "$out\fmt\include" + antlr4-runtime_DIR = "$out\antlr4-cppruntime" + toml11_DIR = "$out\toml11\include" + pugixml_DIR = "$out\pugixml" + CLI11_DIR = "$out\CLI11\include" } $cmakeUserPresets = [PSCustomObject]@{ From 74ef87da486bdd8b9645bc821f155e3854d43ee7 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Mon, 2 Dec 2024 21:43:44 +0000 Subject: [PATCH 21/91] enclose object field in quotation marks --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 9c2e3e0d8d..2f6e18e4a6 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -187,7 +187,7 @@ $cacheVariables = @{ MULTI_THREADING = $threading CMAKE_INSTALL_PREFIX = $out fmt_DIR = "$out\fmt\include" - antlr4-runtime_DIR = "$out\antlr4-cppruntime" + "antlr4-runtime_DIR" = "$out\antlr4-cppruntime" toml11_DIR = "$out\toml11\include" pugixml_DIR = "$out\pugixml" CLI11_DIR = "$out\CLI11\include" From f9d3fe37fea0a6ee1cb0fc91b2c44dd1dd78ee75 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 3 Dec 2024 11:36:26 +0000 Subject: [PATCH 22/91] try to build without supplying unused cmake variables --- develop.ps1 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 2f6e18e4a6..5f3ca67d4e 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -186,11 +186,6 @@ $cacheVariables = @{ Java_JAVA_EXECUTABLE = $javaExePath MULTI_THREADING = $threading CMAKE_INSTALL_PREFIX = $out - fmt_DIR = "$out\fmt\include" - "antlr4-runtime_DIR" = "$out\antlr4-cppruntime" - toml11_DIR = "$out\toml11\include" - pugixml_DIR = "$out\pugixml" - CLI11_DIR = "$out\CLI11\include" } $cmakeUserPresets = [PSCustomObject]@{ From 3ed243137ca632ecfdd28503fdaf9373869dece1 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 6 Dec 2024 14:15:32 +0000 Subject: [PATCH 23/91] allow debug and release dependencies --- develop.ps1 | 125 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 88 insertions(+), 37 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 5f3ca67d4e..4a7cec8837 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -1,13 +1,24 @@ # Flag: Use existing Qt installation (requires Qt6_DIR environment variable to be set) param ( - [switch]$systemqt = $false + [switch]$systemqt = $false, + [switch]$release = $false ) +$build = "Debug" +$binSuffix = "d" + +if ($release) { + $build = "Release" + $binSuffix = "" +} + $colors = @{ ForegroundColor = "White" BackgroundColor = "Cyan" } +Write-Host "Building dependencies in $build configuration... " @colors + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 $projectDir = Get-Location @@ -31,12 +42,12 @@ python -m venv msvc-env Write-Host "Checking Python compiler type... " @colors if ($(python -c "import sys; print(sys.version)") -match "MSC v\.\d+") { - Write-Host " Python...compiler type evaluated to MSC" @colors + Write-Host " ...Python compiler type evaluated to MSC" @colors $pythonEnvSourceDir = "Scripts" } else { - Write-Host " Python...compiler type is not MSC" @colors + Write-Host " ...Python compiler type is not MSC" @colors $pythonEnvSourceDir = "bin" } @@ -73,12 +84,14 @@ if (-not $systemqt) } else { Write-Host "Did not write to PATH: Qt6 binary directory path already exists in system PATH." @colors } -} +} else { + Write-Host "Attempting to use existing system installation of Qt6... " @colors +} # Build/retrieve Freetype $freetypeVersion = "2.12.1" $freetypeArchive = "https://download.savannah.gnu.org/releases/freetype/freetype-$freetypeVersion.tar.gz" -$freetypeRepo = "freetype-latest" +$freetypeRepo = "freetype-repo" $freetypeInstall = "freetype-install" $freetypeOutput = "freetype.tgz" @@ -100,14 +113,36 @@ Rename-Item -Path (Join-Path -Path $dependencies -ChildPath "freetype-$freetypeV Write-Host "Building freetype (from location: $freetypeBuildDir)... " @colors Set-Location -Path $freetypeBuildDir -cmake ../$freetypeRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -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 Release +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... " @colors + [System.Environment]::SetEnvironmentVariable("LIB", "$freetypeLibPath;$freetypeBinPath;$lib", [System.EnvironmentVariableTarget]::Machine) +} + +$freetypeIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$freetypeRepo" + +$include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) + +if ($lib -notlike "*$freetypeRepo*") { + Write-Host "Setting INCLUDE environment variable with Freetype includes... " @colors + [System.Environment]::SetEnvironmentVariable("INCLUDE", "$freetypeIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) +} # Build/retrieve FTGL Set-Location -Path $projectDir $ftglUri = "https://github.com/disorderedmaterials/ftgl-2.4.0.git" -$ftglRepo = "ftgl-latest" +$ftglRepo = "ftgl-repo" $ftglInstall = "ftgl-install" $freetypeRepoPath = (Join-Path -Path $dependencies -ChildPath $freetypeRepo) @@ -117,7 +152,7 @@ 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-latest") +$ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-repo") Write-Host "Cloning FTGL (DisorderedMaterials fork) repo... " @colors & "$gitExePath" clone $ftglUri $ftglRepoPath @@ -128,14 +163,39 @@ $ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftgl $ftglBinPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\bin" $ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftglInstall\include" -$freetypeBinDir = Join-Path -Path $freetypeInstallDir -ChildPath "bin" -$freetypeLibDir = Join-Path -Path $freetypeInstallDir -ChildPath "lib" - Write-Host "Building FTGL (from location: $ftglBuildDir)... " @colors + +if (-not $release) { + Copy-Item -Path "$freetypeLibPath\freetyped.lib" -Destination "$freetypeLibPath\freetype.lib" +} + Set-Location -Path $ftglBuildDir -cmake ../$ftglRepo -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_INSTALL_PREFIX:path=../$ftglInstall -DFREETYPE_LIBRARY=../$freetypeInstall/lib -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" -cmake --build . --target install --config Release +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=../$freetypeInstall/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... " @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 ($lib -notlike "*$ftglInclude*") { + Write-Host "Setting INCLUDE environment variable with FTGL includes... " @colors + [System.Environment]::SetEnvironmentVariable("INCLUDE", "$ftglIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) +} # Get ANTLR and Java Set-Location -Path $projectDir @@ -180,12 +240,12 @@ $out = Join-Path -Path $projectDir -ChildPath "build" $cacheVariables = @{ CMAKE_C_COMPILER = "cl" CMAKE_CXX_COMPILER = "cl" - FTGL_LIBRARY = "$ftglLibPath\ftgl.lib;$ftglBinPath\ftgl.dll" + FTGL_LIBRARY = "$ftglLibPath\ftgl$binSuffix.lib" FTGL_INCLUDE_DIR = $ftglIncludePath ANTLR_EXECUTABLE = $antlrExePath Java_JAVA_EXECUTABLE = $javaExePath MULTI_THREADING = $threading - CMAKE_INSTALL_PREFIX = $out + MSVC_DEV = "ON" } $cmakeUserPresets = [PSCustomObject]@{ @@ -199,33 +259,24 @@ $cmakeUserPresets = [PSCustomObject]@{ $presets = @( [PSCustomObject]@{ - name = "CLI-Release-MSVC" - displayName = "CLI Release Build" - description = "The preset for a CLI production build without tests on MSVC" - inherits = @("CLI-Release") - }, - [PSCustomObject]@{ - name = "CLI-Debug-MSVC" - displayName = "CLI Debug Build" - description = "The preset for a CLI debug build with tests on MSVC" - inherits = @("CLI-Debug") - }, - [PSCustomObject]@{ - name = "GUI-Release-MSVC" - displayName = "GUI Release Build" - description = "The preset for a GUI production build without tests on MSVC" - inherits = @("GUI-Release") + name = "CLI-$build-MSVC" + displayName = "CLI $build Build" + description = "The preset for a CLI $build build on MSVC" + inherits = @("CLI-$build") }, [PSCustomObject]@{ - name = "GUI-Debug-MSVC" - displayName = "GUI Debug Build" - description = "The preset for a GUI debug build with tests on MSVC" - inherits = @("GUI-Debug") + 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 + $installPrefix = Join-Path -Path $out -ChildPath "install\$($preset.name)" + $preset | Add-Member -MemberType NoteProperty -Name cacheVariables -Value ($cacheVariables + @{ + CMAKE_INSTALL_PREFIX = $installPrefix + }) $cmakeUserPresets.configurePresets += $preset } From c3ea2fa34580714e3d15f44661c8c69f56a51610 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 6 Dec 2024 15:40:29 +0000 Subject: [PATCH 24/91] fix path variable error --- develop.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 4a7cec8837..1e961355be 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -133,7 +133,7 @@ $freetypeIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$f $include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) -if ($lib -notlike "*$freetypeRepo*") { +if ($include -notlike "*$freetypeRepo*") { Write-Host "Setting INCLUDE environment variable with Freetype includes... " @colors [System.Environment]::SetEnvironmentVariable("INCLUDE", "$freetypeIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) } @@ -192,7 +192,7 @@ $ftglIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$ftglI $include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) -if ($lib -notlike "*$ftglInclude*") { +if ($include -notlike "*$ftglInclude*") { Write-Host "Setting INCLUDE environment variable with FTGL includes... " @colors [System.Environment]::SetEnvironmentVariable("INCLUDE", "$ftglIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) } From dcd4a4dea20c343ed0c541be8856bc77c84fadd9 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 6 Dec 2024 16:05:12 +0000 Subject: [PATCH 25/91] capture installation config as cmake variable --- develop.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 1e961355be..30fe0f5863 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -273,9 +273,8 @@ $presets = @( ) foreach ($preset in $presets) { - $installPrefix = Join-Path -Path $out -ChildPath "install\$($preset.name)" $preset | Add-Member -MemberType NoteProperty -Name cacheVariables -Value ($cacheVariables + @{ - CMAKE_INSTALL_PREFIX = $installPrefix + CONFIG = "$($preset.name)-x64" }) $cmakeUserPresets.configurePresets += $preset } From 87aa00735a5f209b113da0ce357dca07c926ea53 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 10 Dec 2024 13:19:40 +0000 Subject: [PATCH 26/91] install --- CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c444ad0e3b..3b6b0e41ef 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ set(CMAKE_CXX_STANDARD 17) # 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) @@ -410,3 +413,34 @@ if(GUI) ) install(SCRIPT ${deploy_script}) endif(GUI) + +# Install for MSVC +if(MSVC_DEV) + set(SEARCH_IN "${CMAKE_BINARY_DIR}") + + set(INSTALLATION_DIR "${SEARCH_IN}/out/${CONFIG}") + + file(GLOB DISSOLVE_BUILD_PRODUCTS "${SEARCH_IN}/*.exe" "${SEARCH_IN}/*.lib" "${SEARCH_IN}/*.dll") + + install(FILES ${DISSOLVE_BUILD_PRODUCTS} DESTINATION "${INSTALLATION_DIR}") + + 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/*.dll") + + set(CONAN_FILES ${CONAN_BIN}) + list(APPEND CONAN_FILES ${CONAN_LIB}) + + install(FILES ${CONAN_FILES} DESTINATION "${INSTALLATION_DIR}") + endforeach() + +endif(MSVC_DEV) \ No newline at end of file From 512b043a24c3f9e15705f622b1afa3211254a901 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 10 Dec 2024 14:48:38 +0000 Subject: [PATCH 27/91] correct dependency locations for building CLI version --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b6b0e41ef..41801b59e5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,12 +418,10 @@ endif(GUI) if(MSVC_DEV) set(SEARCH_IN "${CMAKE_BINARY_DIR}") - set(INSTALLATION_DIR "${SEARCH_IN}/out/${CONFIG}") + set(INSTALLATION_DIR "${SEARCH_IN}") - file(GLOB DISSOLVE_BUILD_PRODUCTS "${SEARCH_IN}/*.exe" "${SEARCH_IN}/*.lib" "${SEARCH_IN}/*.dll") + set(ALL_INSTALL_FILES "") - install(FILES ${DISSOLVE_BUILD_PRODUCTS} DESTINATION "${INSTALLATION_DIR}") - set(CONAN_DEPS ${_conan_requires}) list(APPEND CONAN_DEPS ${EXTRA_CONAN_REQUIRES}) @@ -435,12 +433,19 @@ if(MSVC_DEV) 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/*.dll") + file(GLOB CONAN_LIB "${SEARCH_IN}/lib/*.lib") set(CONAN_FILES ${CONAN_BIN}) list(APPEND CONAN_FILES ${CONAN_LIB}) - install(FILES ${CONAN_FILES} DESTINATION "${INSTALLATION_DIR}") + list(APPEND ALL_INSTALL_FILES ${CONAN_FILES}) endforeach() + if(GUI) + set(INSTALLATION_DIR "${SEARCH_IN}/bin") + endif() + + foreach(DEPENDENCY IN LISTS ALL_INSTALL_FILES) + file(COPY ${DEPENDENCY} DESTINATION "${INSTALLATION_DIR}") + endforeach() endif(MSVC_DEV) \ No newline at end of file From d96c8103573de6fabb9b4248299e68e5843ef335 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 10 Dec 2024 16:17:16 +0000 Subject: [PATCH 28/91] fix no newline eof --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41801b59e5..11fa6063bd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -448,4 +448,4 @@ if(MSVC_DEV) foreach(DEPENDENCY IN LISTS ALL_INSTALL_FILES) file(COPY ${DEPENDENCY} DESTINATION "${INSTALLATION_DIR}") endforeach() -endif(MSVC_DEV) \ No newline at end of file +endif(MSVC_DEV) From 41e43008dd6d76ca4ead8d0caf42a047a14084cb Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 12:08:34 +0000 Subject: [PATCH 29/91] warning colors, warn if qt version incorrect --- develop.ps1 | 72 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 30fe0f5863..7edd9c77a8 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -12,12 +12,17 @@ if ($release) { $binSuffix = "" } -$colors = @{ +$info_colors = @{ ForegroundColor = "White" BackgroundColor = "Cyan" } -Write-Host "Building dependencies in $build configuration... " @colors +$warn_colors = @{ + ForegroundColor = "White" + BackgroundColor = "Red" +} + +Write-Host "Building dependencies in $build configuration... " @info_colors [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 @@ -29,34 +34,34 @@ $dependencies = "dependencies" New-Item -ItemType Directory -Path $dependencies -ErrorAction SilentlyContinue #Install key dependencies with Chocolatey -Write-Host "Installing key dependencies with Chocolatey... " @colors +Write-Host "Installing key dependencies with Chocolatey... " @info_colors choco install -y git ninja wget pkgconfiglite -Write-Host "Locating git executable... " @colors +Write-Host "Locating git executable... " @info_colors $gitExePath = where.exe git # Setup Python packages -Write-Host "Creating a local Python virtual environment... " @colors +Write-Host "Creating a local Python virtual environment... " @info_colors python -m venv msvc-env -Write-Host "Checking Python compiler type... " @colors +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" @colors + Write-Host " ...Python compiler type evaluated to MSC" @info_colors $pythonEnvSourceDir = "Scripts" } else { - Write-Host " ...Python compiler type is not MSC" @colors + Write-Host " ...Python compiler type is not MSC" @info_colors $pythonEnvSourceDir = "bin" } $activate = "./msvc-env/$pythonEnvSourceDir/Activate.ps1" -Write-Host "Activating virtual environment with the command: $activate... " @colors +Write-Host "Activating virtual environment with the command: $activate... " @info_colors & $activate -Write-Host "Installing Python packages... " @colors +Write-Host "Installing Python packages... " @info_colors python -m pip install --upgrade pip python -m pip install pprintjson conan aqtinstall conan==1.* @@ -67,25 +72,30 @@ if (-not $systemqt) $qtInstallationDir = Join-Path -Path $dependencies -ChildPath "qt" New-Item -ItemType Directory -Path $qtInstallationDir -ErrorAction SilentlyContinue - Write-Host "Installing Qt6... " @colors + 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\msvc_2019_64" $qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" - Write-Host "Locating system PATH... " @colors + Write-Host "Locating system PATH... " @info_colors $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) - Write-Host "Adding Qt6 directory to system PATH... " @colors + Write-Host "Adding Qt6 directory to system PATH... " @info_colors if ($systemPath -notmatch [regex]::Escape($qt6BinDir)) { - [Environment]::SetEnvironmentVariable("PATH", "$qt6BinDir;$systemPath", [EnvironmentVariableTarget]::Machine) - Write-Host "Qt6 binary directory path added to system PATH." @colors + [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." @colors + 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... " @colors + 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}" @warn_colors + } } # Build/retrieve Freetype @@ -101,16 +111,16 @@ New-Item -ItemType Directory -Path $freetypeInstallDir -ErrorAction SilentlyCont $freetypeBuildDir = (Join-Path -Path $dependencies -ChildPath "freetype-build") New-Item -ItemType Directory -Path $freetypeBuildDir -ErrorAction SilentlyContinue -Write-Host "Downloading freetype archive... " @colors +Write-Host "Downloading freetype archive... " @info_colors Invoke-WebRequest -Uri $freetypeArchive -OutFile $freetypeOutput -Write-Host "Unpacking freetype... " @colors +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)... " @colors +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 @@ -125,7 +135,7 @@ $freetypeBinPath = Join-Path -Path $projectDir -ChildPath "$dependencies\$freet $lib = [System.Environment]::GetEnvironmentVariable("LIB", [System.EnvironmentVariableTarget]::Machine) if ($lib -notlike "*$freetypeInstall*") { - Write-Host "Setting LIB environment variable with Freetype library... " @colors + Write-Host "Setting LIB environment variable with Freetype library... " @info_colors [System.Environment]::SetEnvironmentVariable("LIB", "$freetypeLibPath;$freetypeBinPath;$lib", [System.EnvironmentVariableTarget]::Machine) } @@ -134,7 +144,7 @@ $freetypeIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$f $include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) if ($include -notlike "*$freetypeRepo*") { - Write-Host "Setting INCLUDE environment variable with Freetype includes... " @colors + Write-Host "Setting INCLUDE environment variable with Freetype includes... " @info_colors [System.Environment]::SetEnvironmentVariable("INCLUDE", "$freetypeIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) } @@ -154,7 +164,7 @@ New-Item -ItemType Directory -Path $ftglBuildDir -ErrorAction SilentlyContinue $ftglRepoPath = (Join-Path -Path $dependencies -ChildPath "ftgl-repo") -Write-Host "Cloning FTGL (DisorderedMaterials fork) repo... " @colors +Write-Host "Cloning FTGL (DisorderedMaterials fork) repo... " @info_colors & "$gitExePath" clone $ftglUri $ftglRepoPath Set-Location -Path $projectDir @@ -163,7 +173,7 @@ $ftglLibPath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ftgl $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)... " @colors +Write-Host "Building FTGL (from location: $ftglBuildDir)... " @info_colors if (-not $release) { Copy-Item -Path "$freetypeLibPath\freetyped.lib" -Destination "$freetypeLibPath\freetype.lib" @@ -183,7 +193,7 @@ $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... " @colors + Write-Host "Setting LIB environment variable with FTGL library... " @info_colors [System.Environment]::SetEnvironmentVariable("LIB", "$ftglLibPath;$ftglBinPath;$lib", [System.EnvironmentVariableTarget]::Machine) } @@ -193,7 +203,7 @@ $ftglIncludePath = Join-Path -Path $projectDir -ChildPath "$dependencies\$ftglI $include = [System.Environment]::GetEnvironmentVariable("INCLUDE", [System.EnvironmentVariableTarget]::Machine) if ($include -notlike "*$ftglInclude*") { - Write-Host "Setting INCLUDE environment variable with FTGL includes... " @colors + Write-Host "Setting INCLUDE environment variable with FTGL includes... " @info_colors [System.Environment]::SetEnvironmentVariable("INCLUDE", "$ftglIncludePath;$include", [System.EnvironmentVariableTarget]::Machine) } @@ -210,13 +220,13 @@ $jdkVersion = "21.0.5" Set-Location -Path $dependencies -Write-Host "Downloading ANTLR... " @colors +Write-Host "Downloading ANTLR... " @info_colors Invoke-WebRequest -Uri $antlrUri -OutFile $antlrOutput -Write-Host "Downloading Java... " @colors +Write-Host "Downloading Java... " @info_colors Invoke-WebRequest -Uri $javaUri -OutFile $javaOutput -Write-Host "Unpacking Java... " @colors +Write-Host "Unpacking Java... " @info_colors Expand-Archive -Path $javaOutput -DestinationPath . -Force Remove-Item -Path $javaOutput -Force @@ -230,7 +240,7 @@ Move-Item -Path $antlrOutput -Destination $antlrExePath # Set Conan Set-Location -Path $projectDir -Write-Host "Setting up Conan profile... " @colors +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 @@ -279,7 +289,7 @@ foreach ($preset in $presets) { $cmakeUserPresets.configurePresets += $preset } -Write-Host "Outputting CMakeUserPresets Json for Dissolve MSVC configuration... " @colors +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 From ed5d5cea7e6503a8e3394f4dab26a40e850bb764 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 12:09:42 +0000 Subject: [PATCH 30/91] install dissolve gui dependencies --- CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11fa6063bd..8f0f6120ca 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -417,7 +417,6 @@ endif(GUI) # Install for MSVC if(MSVC_DEV) set(SEARCH_IN "${CMAKE_BINARY_DIR}") - set(INSTALLATION_DIR "${SEARCH_IN}") set(ALL_INSTALL_FILES "") @@ -425,7 +424,7 @@ if(MSVC_DEV) set(CONAN_DEPS ${_conan_requires}) list(APPEND CONAN_DEPS ${EXTRA_CONAN_REQUIRES}) - # Find exe, dll and lib paths from conan packages + # 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) @@ -441,10 +440,21 @@ if(MSVC_DEV) list(APPEND ALL_INSTALL_FILES ${CONAN_FILES}) endforeach() + # Find GUI dependencies (FTGL and Freetype) if(GUI) - set(INSTALLATION_DIR "${SEARCH_IN}/bin") + 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() From c96eaf6c05531686e0e5ce738e57c5481aa0c742 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 12:37:29 +0000 Subject: [PATCH 31/91] modularise visual studio workflow --- CMakeLists.txt | 44 ++------------------------ cmake/Modules/msvc-dissolve-dev.cmake | 45 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 42 deletions(-) create mode 100644 cmake/Modules/msvc-dissolve-dev.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f0f6120ca..822c40136c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,46 +416,6 @@ endif(GUI) # Install for MSVC if(MSVC_DEV) - 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() + include(msvc-dissolve-dev) + setup_msvc() endif(MSVC_DEV) 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 From cca7b94a9aa6401039cf0d0feb1610d6c452be22 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 12:58:42 +0000 Subject: [PATCH 32/91] install choco --- develop.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 7edd9c77a8..17fe2b3a9b 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -34,8 +34,11 @@ $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')) + Write-Host "Installing key dependencies with Chocolatey... " @info_colors -choco install -y git ninja wget pkgconfiglite +choco install -y git ninja pkgconfiglite Write-Host "Locating git executable... " @info_colors $gitExePath = where.exe git From 709af8edd78cc78f86edcbe65cde97ffb711d8be Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 13:00:41 +0000 Subject: [PATCH 33/91] missing header file (was in issue in visual studio build) --- benchmark/math/interpolator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmark/math/interpolator.cpp b/benchmark/math/interpolator.cpp index 2771bb6539..097adf6389 100644 --- a/benchmark/math/interpolator.cpp +++ b/benchmark/math/interpolator.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace Benchmarks { From 7ee7ccab7a68ed2f1102185c3e767a627314d3e4 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 13:05:57 +0000 Subject: [PATCH 34/91] reformat includes --- benchmark/math/interpolator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/math/interpolator.cpp b/benchmark/math/interpolator.cpp index 097adf6389..80b5b6879a 100644 --- a/benchmark/math/interpolator.cpp +++ b/benchmark/math/interpolator.cpp @@ -5,9 +5,9 @@ #include "math/data1D.h" #include #include +#include #include #include -#include namespace Benchmarks { From 22f5371c1e156772faed0283faae164bd564b040 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 13:10:42 +0000 Subject: [PATCH 35/91] reformat cmake --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 822c40136c..91d5341f3e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,6 +416,6 @@ endif(GUI) # Install for MSVC if(MSVC_DEV) - include(msvc-dissolve-dev) - setup_msvc() + include(msvc-dissolve-dev) + setup_msvc() endif(MSVC_DEV) From 9de60b10991b8ce1dddb63cf08317021e962c6ca Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 11 Dec 2024 14:11:58 +0000 Subject: [PATCH 36/91] developer docs --- web/docs/userguide/developers/vs2022.md | 70 +++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 web/docs/userguide/developers/vs2022.md diff --git a/web/docs/userguide/developers/vs2022.md b/web/docs/userguide/developers/vs2022.md new file mode 100644 index 0000000000..dca0701529 --- /dev/null +++ b/web/docs/userguide/developers/vs2022.md @@ -0,0 +1,70 @@ +--- +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, 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 +``` + +This script can be used to install the following packages into a `dependencies` folder: +- Qt version 6.4.2 +- Freetype +- FTGL +- Antlr4 +- Java + +If you have an existing system Qt6 installation, the script can default to using this by passing the `-systemqt` flag to the script. +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 +``` + +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`. + +### 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 `. From 867a9288077a6a54cbfcf32a13dd3eda5a7bbc59 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 12 Dec 2024 09:29:41 +0000 Subject: [PATCH 37/91] remove unused python package --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 17fe2b3a9b..9391cb899c 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -66,7 +66,7 @@ Write-Host "Activating virtual environment with the command: $activate... " @inf Write-Host "Installing Python packages... " @info_colors python -m pip install --upgrade pip -python -m pip install pprintjson conan aqtinstall conan==1.* +python -m pip install conan aqtinstall conan==1.* if (-not $systemqt) { From 4c99480fd71fb1bc6d2fe185f67a911a604381b6 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 12 Dec 2024 10:13:41 +0000 Subject: [PATCH 38/91] proper qt bin location --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 9391cb899c..e2c0fd2588 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -79,7 +79,7 @@ if (-not $systemqt) 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\msvc_2019_64" + $qt6Dir = Join-Path -Path $dependencies -ChildPath "qt\$qtVersion\msvc2019_64" $qt6BinDir = Join-Path -Path $qt6Dir -ChildPath "bin" Write-Host "Locating system PATH... " @info_colors From 70773a0f93da198f6f1ced9b6e268e8ef874f649 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 12 Dec 2024 11:48:53 +0000 Subject: [PATCH 39/91] attempt to overcome Freetype not found by passing FREETYPE_LIBRARY as string --- develop.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index e2c0fd2588..e5eb7af21b 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -179,12 +179,13 @@ $ftglIncludePath = Join-Path -Path "$(Get-Location)" -ChildPath "$dependencies\$ 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=../$freetypeInstall/lib -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" +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="../$freetypeInstall/lib" -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" cmake --build . --target install --config $build $ftglLib = "$ftglInstall\lib" From 6b78c69023c99947f5df033d91dba94780de5447 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 12 Dec 2024 12:56:36 +0000 Subject: [PATCH 40/91] freetype lib path --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index e5eb7af21b..d101af14c6 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -185,7 +185,7 @@ if (-not $release) { 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="../$freetypeInstall/lib" -DFREETYPE_INCLUDE_DIRS="$(Join-Path -Path $projectDir -ChildPath $freetypeInstallDir)\include\freetype2" +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" From 71b57f2b0be8c6efd20a255411781c02a439eb18 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 19 Dec 2024 15:39:22 +0000 Subject: [PATCH 41/91] sensible font.. --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index d101af14c6..3865a385c7 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -14,7 +14,7 @@ if ($release) { $info_colors = @{ ForegroundColor = "White" - BackgroundColor = "Cyan" + BackgroundColor = "Black" } $warn_colors = @{ From be607bca20485ad11a97dd38225ebf1a9a8c6b93 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 20 Dec 2024 20:47:40 +0000 Subject: [PATCH 42/91] enhance package management and paths --- develop.ps1 | 58 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 3865a385c7..bcfddeb917 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -37,38 +37,56 @@ New-Item -ItemType Directory -Path $dependencies -ErrorAction SilentlyContinue [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 git ninja pkgconfiglite +choco install -y ninja pkgconfiglite + +# 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 >= 10)") + $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.10 - installing with Chocolatey..." @warn_colors + choco install -y python + } +} catch { + Write-Output "Could not find system Python - installing with Chocolatey..." @info_colors + choco install -y python +} -Write-Host "Locating git executable... " @info_colors -$gitExePath = where.exe git +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" +$activate = "./msvc-env/Scripts/Activate.ps1" -Write-Host "Activating virtual environment with the command: $activate... " @info_colors +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 conan aqtinstall conan==1.* +python -m pip install aqtinstall conan==1.* + +$systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + +[Environment]::SetEnvironmentVariable("PATH", "$(Join-Path -Path $projectDir -ChildPath "msvc-env\Scripts");$systemPath", [EnvironmentVariableTarget]::Machine) +Write-Host "Python packages directory path added to system PATH." @info_colors -if (-not $systemqt) +if (-not $systemqt) { # Install Qt6 $qtVersion = "6.4.2" @@ -168,7 +186,7 @@ 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 -& "$gitExePath" clone $ftglUri $ftglRepoPath +git clone $ftglUri $ftglRepoPath Set-Location -Path $projectDir From dbbbba5023eeb14ba579060629201f3d347fc04d Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 20 Dec 2024 20:53:18 +0000 Subject: [PATCH 43/91] keep python compiler condition --- develop.ps1 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index bcfddeb917..b9031d4be5 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -72,7 +72,19 @@ refreshenv Write-Host "Creating a local Python virtual environment... " @info_colors python -m venv msvc-env -$activate = "./msvc-env/Scripts/Activate.ps1" +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 @@ -83,7 +95,7 @@ python -m pip install aqtinstall conan==1.* $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) -[Environment]::SetEnvironmentVariable("PATH", "$(Join-Path -Path $projectDir -ChildPath "msvc-env\Scripts");$systemPath", [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 if (-not $systemqt) From 0ffd1b9ce069c042ed7bd8038d360e8449de191c Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 8 Jan 2025 14:08:45 +0000 Subject: [PATCH 44/91] get cmake, assert python 3.12 --- develop.ps1 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index b9031d4be5..7e4badcd72 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -17,11 +17,6 @@ $info_colors = @{ BackgroundColor = "Black" } -$warn_colors = @{ - ForegroundColor = "White" - BackgroundColor = "Red" -} - Write-Host "Building dependencies in $build configuration... " @info_colors [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 @@ -40,7 +35,7 @@ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocola Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 Write-Host "Installing key dependencies with Chocolatey... " @info_colors -choco install -y ninja pkgconfiglite +choco install -y ninja pkgconfiglite cmake # Find git, install if not found try { @@ -55,15 +50,15 @@ try { 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 >= 10)") + $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.10 - installing with Chocolatey..." @warn_colors - choco install -y python + 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 + choco install -y python --version==3.12.0 } refreshenv @@ -127,7 +122,7 @@ if (-not $systemqt) $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}" @warn_colors + Write-Host "Found Qt6 version that is NOT ${qtVersion} in system PATH. It is strongly recommended to use Qt ${qtVersion}" @info_colors } } From 1120a98b07dbc0d80dd105f4d7cc469b1f961af7 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 8 Jan 2025 14:28:49 +0000 Subject: [PATCH 45/91] ammend python 3.12 install string --- develop.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/develop.ps1 b/develop.ps1 index 7e4badcd72..554776e7b7 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -54,11 +54,11 @@ try { $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 + 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 + choco install -y python --version=3.12.0 } refreshenv From bf091102cc4d38e60f405ad8b06909ac4ea4e1b5 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 8 Jan 2025 17:29:40 +0000 Subject: [PATCH 46/91] more freetype (gui build) --- develop.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 554776e7b7..158a40311e 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -93,6 +93,8 @@ $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariable [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 $systemqt) { # Install Qt6 @@ -168,12 +170,13 @@ if ($lib -notlike "*$freetypeInstall*") { } $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;$include", [System.EnvironmentVariableTarget]::Machine) + [System.Environment]::SetEnvironmentVariable("INCLUDE", "$freetypeIncludePath;$freetype2IncludePath;$include", [System.EnvironmentVariableTarget]::Machine) } # Build/retrieve FTGL @@ -281,10 +284,13 @@ $cacheVariables = @{ CMAKE_CXX_COMPILER = "cl" FTGL_LIBRARY = "$ftglLibPath\ftgl$binSuffix.lib" FTGL_INCLUDE_DIR = $ftglIncludePath + FREETYPE_LIBRARY = "$freetypelLibPath\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]@{ From 9eb060dda6b47827dbf13f7d97e517fd0dcfadd2 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 8 Jan 2025 19:49:43 +0000 Subject: [PATCH 47/91] fix typo in freetype path --- develop.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.ps1 b/develop.ps1 index 158a40311e..ad85f61e0c 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -284,7 +284,7 @@ $cacheVariables = @{ CMAKE_CXX_COMPILER = "cl" FTGL_LIBRARY = "$ftglLibPath\ftgl$binSuffix.lib" FTGL_INCLUDE_DIR = $ftglIncludePath - FREETYPE_LIBRARY = "$freetypelLibPath\freetype$binSuffix.lib" + FREETYPE_LIBRARY = "$freetypeLibPath\freetype$binSuffix.lib" FREETYPE_INCLUDE_DIRS = "$freetypeIncludePath;$freetype2IncludePath" ANTLR_EXECUTABLE = $antlrExePath Java_JAVA_EXECUTABLE = $javaExePath From c077cedff75ae4892a1e34e943fb8a4b3ffd95f8 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 16:30:35 +0000 Subject: [PATCH 48/91] github ci workflow --- .github/workflows/msvc-developer.yml | 27 ++++++++++++ .github/workflows/visual-studio/action.yml | 48 ++++++++++++++++++++++ develop.ps1 | 14 +++++++ 3 files changed, 89 insertions(+) create mode 100644 .github/workflows/msvc-developer.yml create mode 100644 .github/workflows/visual-studio/action.yml diff --git a/.github/workflows/msvc-developer.yml b/.github/workflows/msvc-developer.yml new file mode 100644 index 0000000000..3f28f14041 --- /dev/null +++ b/.github/workflows/msvc-developer.yml @@ -0,0 +1,27 @@ +name: Test MSVC (Visual Studio 2022) Developer Build + +on: + pull_request: + paths: + - 'develop.ps1' + branches: + - '*' + + push: + paths: + - 'develop.ps1' + branches: + - 'develop' + - 'release/**' + +jobs: + + BuildWeb: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Develop MSVC + uses: "./.github/workflows/visual-studio" + with: + publishType: 'none' diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml new file mode 100644 index 0000000000..701646493f --- /dev/null +++ b/.github/workflows/visual-studio/action.yml @@ -0,0 +1,48 @@ +name: Develop MSVC +description: Set up Dissolve CLI and GUI Visual Studio dev environment. + +inputs: + publishType: + type: choice + default: 'none' + options: + - none + - continuous + - release + - legacy + +runs: + using: "composite" + steps: + + - name: 'Run developer powershell script' + shell: pwsh + run: Set-Location ${{ github.workspace }} + + - name: 'Run developer powershell script' + shell: pwsh + run: ./develop.ps1 + + - name: 'Find dependencies' + shell: pwsh + run: | + Set-Location build + + if (Test-Path "./dependencies") { + Write-Host "Found dependencies." + } else { + Write-Host "Could NOT find dependencies." + exit 1 + } + + - name: 'Configure Dissolve for Visual Studio using CMake' + shell: pwsh + run: | + mkdir build + Set-Location build + cmake .. -G "Visual Studio 17 2022" -A x64 + + - name: 'Build Dissolve for Visual Studio using CMake' + shell: pwsh + run: | + cmake --build . --config Debug diff --git a/develop.ps1 b/develop.ps1 index ad85f61e0c..1d0cdf6a67 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -1,3 +1,17 @@ +<# + .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'. +#> + # Flag: Use existing Qt installation (requires Qt6_DIR environment variable to be set) param ( [switch]$systemqt = $false, From 0b191b4d28a8a041c07dcbd1a12305a4da9dcc5b Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 16:38:05 +0000 Subject: [PATCH 49/91] ammed github ci workflow --- .github/workflows/msvc-developer.yml | 2 +- .github/workflows/visual-studio/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msvc-developer.yml b/.github/workflows/msvc-developer.yml index 3f28f14041..db67c75db2 100644 --- a/.github/workflows/msvc-developer.yml +++ b/.github/workflows/msvc-developer.yml @@ -16,7 +16,7 @@ on: jobs: - BuildWeb: + Develop: runs-on: windows-latest steps: - name: Checkout diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 701646493f..ae268a5d74 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -26,7 +26,7 @@ runs: - name: 'Find dependencies' shell: pwsh run: | - Set-Location build + Set-Location ${{ github.workspace }} if (Test-Path "./dependencies") { Write-Host "Found dependencies." From 879bdf0412d45d4844ef32760c2b9452b0f290a2 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 16:55:06 +0000 Subject: [PATCH 50/91] isolate powershell script output in ci --- .github/workflows/visual-studio/action.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index ae268a5d74..d8c2bde9f2 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -34,15 +34,16 @@ runs: Write-Host "Could NOT find dependencies." exit 1 } - - - name: 'Configure Dissolve for Visual Studio using CMake' + + - name: 'Find dependencies' shell: pwsh run: | - mkdir build - Set-Location build - cmake .. -G "Visual Studio 17 2022" -A x64 + Set-Location ${{ github.workspace }} - - name: 'Build Dissolve for Visual Studio using CMake' - shell: pwsh - run: | - cmake --build . --config Debug + if (Test-Path "CMakeUserPresets.json") { + Write-Host "Found CMakeUserPresets.json - Content: " + Get-Content "CMakeUserPresets.json" | ConvertFrom-Json | ConvertTo-Json -Depth 10 + } else { + Write-Host "Could NOT find CMakeUserPresets.json" + exit 1 + } From 775a62a8202748543a6c58ec43575ea01aeeb664 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 17:01:04 +0000 Subject: [PATCH 51/91] ci visual studio build --- .github/workflows/visual-studio/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index d8c2bde9f2..260fdd68a8 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -35,7 +35,7 @@ runs: exit 1 } - - name: 'Find dependencies' + - name: 'Find CMake user presets' shell: pwsh run: | Set-Location ${{ github.workspace }} @@ -47,3 +47,11 @@ runs: Write-Host "Could NOT find CMakeUserPresets.json" exit 1 } + + - name: 'Configure Dissolve for Visual Studio using CMake' + shell: pwsh + run: cmake --preset GUI-Debug-MSVC + + - name: 'Build Dissolve for Visual Studio using CMake' + shell: pwsh + run: cmake --build ./out/build \ No newline at end of file From 0ed94b75dd3acdd000b70a45219c85728f92c844 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 18:38:54 +0000 Subject: [PATCH 52/91] explicitly use cl in ci build --- .github/workflows/visual-studio/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 260fdd68a8..be207982c1 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -50,8 +50,12 @@ runs: - name: 'Configure Dissolve for Visual Studio using CMake' shell: pwsh - run: cmake --preset GUI-Debug-MSVC + run: | + Set-Location ${{ github.workspace }} + cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl - name: 'Build Dissolve for Visual Studio using CMake' shell: pwsh - run: cmake --build ./out/build \ No newline at end of file + run: | + Set-Location ${{ github.workspace }} + cmake --build ./out/build \ No newline at end of file From 395022cf475d37568cef932c7319974afad38f59 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 18:47:39 +0000 Subject: [PATCH 53/91] try with different compiler path --- .github/workflows/visual-studio/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index be207982c1..78f37b2161 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -52,7 +52,8 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl + $msvcCompiler = C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe + cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=$msvcCompiler -DCMAKE_C_COMPILER=$msvcCompiler - name: 'Build Dissolve for Visual Studio using CMake' shell: pwsh From 732d241ac168d334086d392635887553e351541e Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 18:57:29 +0000 Subject: [PATCH 54/91] try with different compiler path 2 --- .github/workflows/visual-studio/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 78f37b2161..4d9628a315 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -52,7 +52,7 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - $msvcCompiler = C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe + $msvcCompiler = "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe" cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=$msvcCompiler -DCMAKE_C_COMPILER=$msvcCompiler - name: 'Build Dissolve for Visual Studio using CMake' From b22a6ea223d56043b392856a49779223b7f16bc0 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 19:16:51 +0000 Subject: [PATCH 55/91] try with different compiler path 3 (env var) --- .github/workflows/visual-studio/action.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 4d9628a315..1330a44a8d 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -17,11 +17,14 @@ runs: - name: 'Run developer powershell script' shell: pwsh - run: Set-Location ${{ github.workspace }} + run: | + Set-Location ${{ github.workspace }} + $env:Path += ";C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe" + Write-Host "Updated PATH to: $env:Path" - name: 'Run developer powershell script' shell: pwsh - run: ./develop.ps1 + run: ./develop.ps1 -systemqt - name: 'Find dependencies' shell: pwsh @@ -52,8 +55,10 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - $msvcCompiler = "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe" - cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=$msvcCompiler -DCMAKE_C_COMPILER=$msvcCompiler + #$msvcCompiler = "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe" + & "cl" /? # TEST CL + + cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl - name: 'Build Dissolve for Visual Studio using CMake' shell: pwsh From f695352ef88adfe7f6aa5b80dbd321905cb54970 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 19:21:58 +0000 Subject: [PATCH 56/91] restore to previous, leave out qt installation temporarily for speed --- .github/workflows/visual-studio/action.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 1330a44a8d..f4e0fc53bf 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -15,13 +15,6 @@ runs: using: "composite" steps: - - name: 'Run developer powershell script' - shell: pwsh - run: | - Set-Location ${{ github.workspace }} - $env:Path += ";C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe" - Write-Host "Updated PATH to: $env:Path" - - name: 'Run developer powershell script' shell: pwsh run: ./develop.ps1 -systemqt @@ -55,10 +48,7 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - #$msvcCompiler = "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe" - & "cl" /? # TEST CL - - cmake --preset GUI-Debug-MSVC -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl + cmake --preset GUI-Debug-MSVC - name: 'Build Dissolve for Visual Studio using CMake' shell: pwsh From 0ed94b28bd45a77a81d453f5a3e973996f4ed2dd Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 20:07:19 +0000 Subject: [PATCH 57/91] check if cli works in one line --- .github/workflows/visual-studio/action.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index f4e0fc53bf..44efb0a72b 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -48,10 +48,11 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - cmake --preset GUI-Debug-MSVC + #cmake --preset GUI-Debug-MSVC + cmake --build build --config CLI-Debug-MSVC - - name: 'Build Dissolve for Visual Studio using CMake' - shell: pwsh - run: | - Set-Location ${{ github.workspace }} - cmake --build ./out/build \ No newline at end of file +# - name: 'Build Dissolve for Visual Studio using CMake' +# shell: pwsh +# run: | +# Set-Location ${{ github.workspace }} +# cmake --build ./out/build \ No newline at end of file From cd063be27e5d7054493c7532437c551e23fd9f82 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 20:11:52 +0000 Subject: [PATCH 58/91] check if cli works in one line 2 --- .github/workflows/visual-studio/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 44efb0a72b..2aac0a9260 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -49,6 +49,7 @@ runs: run: | Set-Location ${{ github.workspace }} #cmake --preset GUI-Debug-MSVC + mkdir build cmake --build build --config CLI-Debug-MSVC # - name: 'Build Dissolve for Visual Studio using CMake' From 81b7d495de98021afce96d656a34150e8798786b Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 9 Jan 2025 20:48:06 +0000 Subject: [PATCH 59/91] nope. --- .github/workflows/visual-studio/action.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 2aac0a9260..e72238f948 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -48,12 +48,10 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - #cmake --preset GUI-Debug-MSVC - mkdir build - cmake --build build --config CLI-Debug-MSVC + cmake --preset GUI-Debug-MSVC -# - name: 'Build Dissolve for Visual Studio using CMake' -# shell: pwsh -# run: | -# Set-Location ${{ github.workspace }} -# cmake --build ./out/build \ No newline at end of file + - name: 'Build Dissolve for Visual Studio using CMake' + shell: pwsh + run: | + Set-Location ${{ github.workspace }} + cmake --build ./out/build \ No newline at end of file From f78a355ea8df75c55b776c0246234bbec1aaeb97 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 10:02:08 +0000 Subject: [PATCH 60/91] try with custom msvc-dev-cmd action --- .github/workflows/visual-studio/action.yml | 50 ++++++---------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index e72238f948..a02d36e282 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -15,43 +15,19 @@ runs: using: "composite" steps: - - name: 'Run developer powershell script' - shell: pwsh - run: ./develop.ps1 -systemqt - - - name: 'Find dependencies' - shell: pwsh - run: | - Set-Location ${{ github.workspace }} - - if (Test-Path "./dependencies") { - Write-Host "Found dependencies." - } else { - Write-Host "Could NOT find dependencies." - exit 1 - } - - - name: 'Find CMake user presets' - shell: pwsh - run: | - Set-Location ${{ github.workspace }} - - if (Test-Path "CMakeUserPresets.json") { - Write-Host "Found CMakeUserPresets.json - Content: " - Get-Content "CMakeUserPresets.json" | ConvertFrom-Json | ConvertTo-Json -Depth 10 - } else { - Write-Host "Could NOT find CMakeUserPresets.json" - exit 1 - } - - - name: 'Configure Dissolve for Visual Studio using CMake' - shell: pwsh - run: | + - name: 'Set up MSVC toolchain' + uses: ilammy/msvc-dev-cmd@v1 + + - name: 'Install dependencies' + uses: pwsh + run: | Set-Location ${{ github.workspace }} - cmake --preset GUI-Debug-MSVC + ./develop.ps1 -systemqt - - name: 'Build Dissolve for Visual Studio using CMake' - shell: pwsh - run: | + - name: 'Configure and build dissolve' + uses: pwsh + run: | Set-Location ${{ github.workspace }} - cmake --build ./out/build \ No newline at end of file + cmake --preset CLI-Debug-MSVC + mkdir build + cmake --build build \ No newline at end of file From 7f0cb4e9919da8ec1275a3db4ccc2ca3f9d17cf4 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 10:07:00 +0000 Subject: [PATCH 61/91] shell --- .github/workflows/visual-studio/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index a02d36e282..f2db524992 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -19,13 +19,13 @@ runs: uses: ilammy/msvc-dev-cmd@v1 - name: 'Install dependencies' - uses: pwsh + shell: pwsh run: | Set-Location ${{ github.workspace }} ./develop.ps1 -systemqt - name: 'Configure and build dissolve' - uses: pwsh + shell: pwsh run: | Set-Location ${{ github.workspace }} cmake --preset CLI-Debug-MSVC From 6bda9e540f01752b25e4d4e8a15d26d4880aef48 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 10:15:22 +0000 Subject: [PATCH 62/91] fix duplicate item --- .github/workflows/visual-studio/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index f2db524992..a74bf31131 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,5 +29,4 @@ runs: run: | Set-Location ${{ github.workspace }} cmake --preset CLI-Debug-MSVC - mkdir build cmake --build build \ No newline at end of file From ca8f467a37111e663e9e2c6dd0b8b87c77add0e8 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 10:41:57 +0000 Subject: [PATCH 63/91] check env vars --- .github/workflows/visual-studio/action.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index a74bf31131..d30e442eda 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -24,9 +24,11 @@ runs: Set-Location ${{ github.workspace }} ./develop.ps1 -systemqt - - name: 'Configure and build dissolve' - shell: pwsh - run: | - Set-Location ${{ github.workspace }} + Write-Output "Machine env vars:" + Write-Output "$([Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine))" + + Write-Output "Process env vars" + Write-Output "$([Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Process))" + cmake --preset CLI-Debug-MSVC cmake --build build \ No newline at end of file From cc1410dabf2e5628055e078af215e8d8ad3c392f Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 10:54:37 +0000 Subject: [PATCH 64/91] add path to conan --- .github/workflows/visual-studio/action.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index d30e442eda..cae04b3b62 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -23,12 +23,5 @@ runs: run: | Set-Location ${{ github.workspace }} ./develop.ps1 -systemqt - - Write-Output "Machine env vars:" - Write-Output "$([Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine))" - - Write-Output "Process env vars" - Write-Output "$([Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Process))" - - cmake --preset CLI-Debug-MSVC + cmake --preset CLI-Debug-MSVC -DCONAN_BIN="${{ github.workspace }}\msvc-env\Scripts" cmake --build build \ No newline at end of file From b12ffda7cbd76662f0f8758df8d9ffce17068c6f Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 11:00:08 +0000 Subject: [PATCH 65/91] add path to conan 2 --- .github/workflows/visual-studio/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index cae04b3b62..212590a53d 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -23,5 +23,10 @@ runs: run: | Set-Location ${{ github.workspace }} ./develop.ps1 -systemqt + + - name: 'Configure and build' + shell: pwsh + run: | + Set-Location ${{ github.workspace }} cmake --preset CLI-Debug-MSVC -DCONAN_BIN="${{ github.workspace }}\msvc-env\Scripts" cmake --build build \ No newline at end of file From bf39a144b511dae87438b454eea634c20a4eacbe Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 11:27:13 +0000 Subject: [PATCH 66/91] add path to conan 3 --- .github/workflows/visual-studio/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 212590a53d..94eb9be024 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -28,5 +28,7 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - cmake --preset CLI-Debug-MSVC -DCONAN_BIN="${{ github.workspace }}\msvc-env\Scripts" + $conanPath = "${{ github.workspace }}\msvc-env\Scripts" + Write-Output "CONAN PATH ---> $($conanPath)" + cmake --preset CLI-Debug-MSVC -DCMAKE_PREFIX_PATH=$conanPath cmake --build build \ No newline at end of file From 15acf1fd4f32ec79c0a303ae90747e55a25a6655 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 11:39:09 +0000 Subject: [PATCH 67/91] cached conan --- .github/workflows/visual-studio/action.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 94eb9be024..7dc5a66745 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -24,11 +24,23 @@ runs: Set-Location ${{ github.workspace }} ./develop.ps1 -systemqt - - name: 'Configure and build' + - name: 'Retrieve Conan Cache' + id: cache-conan + uses: actions/cache@v4 + with: + key: windows-conan-${{ env.conanHash }} + path: | + ~\.conan + ~\.conancache + + - name: 'Configure and build with CMake' shell: pwsh run: | Set-Location ${{ github.workspace }} - $conanPath = "${{ github.workspace }}\msvc-env\Scripts" - Write-Output "CONAN PATH ---> $($conanPath)" - cmake --preset CLI-Debug-MSVC -DCMAKE_PREFIX_PATH=$conanPath + + # Set conan cache location + conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache" + + # Configure and build + cmake --preset CLI-Debug-MSVC cmake --build build \ No newline at end of file From b6cd58eeb225dd2f701b2508f2b0d128ffab271b Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 16:28:07 +0000 Subject: [PATCH 68/91] try with visual studio x64 command line environemnt --- .github/workflows/visual-studio/action.yml | 25 ++++++++-------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 7dc5a66745..6c139974a1 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -17,6 +17,8 @@ runs: - name: 'Set up MSVC toolchain' uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - name: 'Install dependencies' shell: pwsh @@ -24,23 +26,14 @@ runs: Set-Location ${{ github.workspace }} ./develop.ps1 -systemqt - - name: 'Retrieve Conan Cache' - id: cache-conan - uses: actions/cache@v4 - with: - key: windows-conan-${{ env.conanHash }} - path: | - ~\.conan - ~\.conancache - - name: 'Configure and build with CMake' - shell: pwsh - run: | - Set-Location ${{ github.workspace }} - - # Set conan cache location - conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache" + shell: cmd + run: | + # Initialise x64 environment + cmd /c "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxillary/Build/vcvars64.bat" - # Configure and build + # Configure cmake --preset CLI-Debug-MSVC + + # Build cmake --build build \ No newline at end of file From 167085da5ca3d9072e08fcfe3923a4d9a75b9989 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 16:35:07 +0000 Subject: [PATCH 69/91] remove # chars --- .github/workflows/visual-studio/action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 6c139974a1..e8a86bce80 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,11 +29,6 @@ runs: - name: 'Configure and build with CMake' shell: cmd run: | - # Initialise x64 environment cmd /c "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxillary/Build/vcvars64.bat" - - # Configure cmake --preset CLI-Debug-MSVC - - # Build cmake --build build \ No newline at end of file From f689e360a3c6b84967143943792b4a01dc002a41 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 16:50:47 +0000 Subject: [PATCH 70/91] quotes --- .github/workflows/visual-studio/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index e8a86bce80..31b7af4501 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,6 +29,6 @@ runs: - name: 'Configure and build with CMake' shell: cmd run: | - cmd /c "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxillary/Build/vcvars64.bat" + cmd /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxillary\Build\vcvars64.bat" cmake --preset CLI-Debug-MSVC cmake --build build \ No newline at end of file From b5b55ec4b60d1e8dd819adb11684c652984e2d23 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 16:57:56 +0000 Subject: [PATCH 71/91] go back to using pwsh --- .github/workflows/visual-studio/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 31b7af4501..c152770b47 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -27,8 +27,8 @@ runs: ./develop.ps1 -systemqt - name: 'Configure and build with CMake' - shell: cmd + shell: pwsh run: | - cmd /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxillary\Build\vcvars64.bat" + & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxillary\Build\vcvars64.bat" cmake --preset CLI-Debug-MSVC cmake --build build \ No newline at end of file From 5ecd64a5ad1a62d167f48eefe5697ab1c04f7063 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Fri, 10 Jan 2025 17:04:18 +0000 Subject: [PATCH 72/91] try with chocolatey refreshenv --- .github/workflows/visual-studio/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index c152770b47..abc1799487 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,6 +29,7 @@ runs: - name: 'Configure and build with CMake' shell: pwsh run: | - & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxillary\Build\vcvars64.bat" + Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 + refreshenv cmake --preset CLI-Debug-MSVC cmake --build build \ No newline at end of file From 7df8525d8db7b6be6591597956ee59e692416b98 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 14:04:54 +0000 Subject: [PATCH 73/91] see directory contents --- .github/workflows/visual-studio/action.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index abc1799487..7cf1e7e28f 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,7 +29,4 @@ runs: - name: 'Configure and build with CMake' shell: pwsh run: | - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 - refreshenv - cmake --preset CLI-Debug-MSVC - cmake --build build \ No newline at end of file + Get-ChildItem \ No newline at end of file From ea33f2d2740eacd9bc5880571f6aee8bbe3bdae9 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 14:10:44 +0000 Subject: [PATCH 74/91] see path to conan, does cl work --- .github/workflows/visual-studio/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 7cf1e7e28f..61e42277ed 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,4 +29,6 @@ runs: - name: 'Configure and build with CMake' shell: pwsh run: | - Get-ChildItem \ No newline at end of file + Get-ChildItem + Write-Output "$(Join-Path -Path ${{ github.workspace }} -ChildPath "msvc-env\Scripts" )" + cl \ No newline at end of file From 39ff10f4f2c93a6f27cc9838792f4888e5c9fbb5 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 14:26:57 +0000 Subject: [PATCH 75/91] can we find conan --- .github/workflows/visual-studio/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 61e42277ed..86de93b312 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -31,4 +31,5 @@ runs: run: | Get-ChildItem Write-Output "$(Join-Path -Path ${{ github.workspace }} -ChildPath "msvc-env\Scripts" )" - cl \ No newline at end of file + cl + where.exe conan \ No newline at end of file From f056bb70415e48a16067928c808da814deb65f10 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 14:33:42 +0000 Subject: [PATCH 76/91] is there even a conan --- .github/workflows/visual-studio/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 86de93b312..59d4c93637 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -32,4 +32,5 @@ runs: Get-ChildItem Write-Output "$(Join-Path -Path ${{ github.workspace }} -ChildPath "msvc-env\Scripts" )" cl - where.exe conan \ No newline at end of file + cd msvc-env/Scripts + Get-ChildItem \ No newline at end of file From b622253111d0df60ef3414acf7a9ba3006e2e3f4 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 14:43:25 +0000 Subject: [PATCH 77/91] try with bash --- .github/workflows/visual-studio/action.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 59d4c93637..dd40223532 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -27,10 +27,7 @@ runs: ./develop.ps1 -systemqt - name: 'Configure and build with CMake' - shell: pwsh + shell: bash run: | - Get-ChildItem - Write-Output "$(Join-Path -Path ${{ github.workspace }} -ChildPath "msvc-env\Scripts" )" - cl - cd msvc-env/Scripts - Get-ChildItem \ No newline at end of file + export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" + cmake --preset CLI-Debug-MSVC \ No newline at end of file From d28d6a49ccfdbeac310b6c223549e09f285ac5f5 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 15:46:28 +0000 Subject: [PATCH 78/91] build dissolve cli --- .github/workflows/visual-studio/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index dd40223532..aee92c8e18 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -30,4 +30,5 @@ runs: shell: bash run: | export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" - cmake --preset CLI-Debug-MSVC \ No newline at end of file + cmake --preset CLI-Debug-MSVC + cmake --build build \ No newline at end of file From d488fa33507d3b736c824b1718cbf4277bc08cf0 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 15:56:00 +0000 Subject: [PATCH 79/91] can we get path vars directly --- .github/workflows/visual-studio/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index aee92c8e18..58e8aa4794 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -29,6 +29,7 @@ runs: - name: 'Configure and build with CMake' shell: bash run: | - export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" - cmake --preset CLI-Debug-MSVC - cmake --build build \ No newline at end of file + echo "$PATH" + #export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" + #cmake --preset CLI-Debug-MSVC + #cmake --build build \ No newline at end of file From 427a68a56035b8b6ea60682a23e577197e0651d5 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 16:26:25 +0000 Subject: [PATCH 80/91] add some checks on script --- .github/workflows/visual-studio/action.yml | 33 +++++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 58e8aa4794..3dce354fe4 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -22,14 +22,33 @@ runs: - name: 'Install dependencies' shell: pwsh + with: + key: windows-qt-${{ env.qtVersion }} run: | Set-Location ${{ github.workspace }} + + # Run installation script ./develop.ps1 -systemqt + + # Check paths are correct + $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + Write-Output "$systemPath" + $qt6Path = "dissolve\dependencies\qt\qt\${{ env.qtVersion }}\msvc2019_64" + $pythonEnvPath = "dissolve\dependencies\msvc-env\Scripts" + + if ($systemPath -notlike "*$qt6Path*") { + Write-Output "Qt6 not found in PATH" + exit 1 + } + + if ($systemPath -notlike "*$pythonEnvPath*") { + Write-Output "Python env not found in PATH" + exit 1 + } - - name: 'Configure and build with CMake' - shell: bash - run: | - echo "$PATH" - #export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" - #cmake --preset CLI-Debug-MSVC - #cmake --build build \ No newline at end of file +# - name: 'Configure and build with CMake' +# shell: bash +# run: | +# export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" +# cmake --preset CLI-Debug-MSVC +# cmake --build build \ No newline at end of file From 39a55f4a746731904454c40495e42af320438f9c Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 16:33:01 +0000 Subject: [PATCH 81/91] add some checks on script 2 --- .github/workflows/visual-studio/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 3dce354fe4..eb2716da50 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -22,8 +22,6 @@ runs: - name: 'Install dependencies' shell: pwsh - with: - key: windows-qt-${{ env.qtVersion }} run: | Set-Location ${{ github.workspace }} From 1f7a347948a0f80fea53b05f5f739f2735c8daf5 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 16:42:16 +0000 Subject: [PATCH 82/91] add some checks on script 3 and try and build gui --- .github/workflows/visual-studio/action.yml | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index eb2716da50..e61ebafbe9 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -26,27 +26,27 @@ runs: Set-Location ${{ github.workspace }} # Run installation script - ./develop.ps1 -systemqt + ./develop.ps1 # Check paths are correct $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) Write-Output "$systemPath" - $qt6Path = "dissolve\dependencies\qt\qt\${{ env.qtVersion }}\msvc2019_64" + $qt6Path = "dissolve\dependencies\qt\${{ env.qtVersion }}\msvc2019_64" $pythonEnvPath = "dissolve\dependencies\msvc-env\Scripts" - if ($systemPath -notlike "*$qt6Path*") { - Write-Output "Qt6 not found in PATH" + if ($systemPath -notlike "*$pythonEnvPath*") { + Write-Output "Python env not found in PATH" exit 1 } - if ($systemPath -notlike "*$pythonEnvPath*") { - Write-Output "Python env not found in PATH" + if ($systemPath -notlike "*$qt6Path*") { + Write-Output "Qt6 not found in PATH" exit 1 } -# - name: 'Configure and build with CMake' -# shell: bash -# run: | -# export PATH="${{ github.workspace }}\msvc-env\Scripts;$PATH" -# cmake --preset CLI-Debug-MSVC -# cmake --build build \ No newline at end of file + - name: 'Configure and build with CMake' + shell: bash + run: | + export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ env.qtVersion }}\msvc2019_64;$PATH" + cmake --preset GUI-Debug-MSVC + cmake --build build \ No newline at end of file From c2925a98e4df04db0a96b8a7e2b2e8d208f647f9 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 16:51:59 +0000 Subject: [PATCH 83/91] fix typo --- .github/workflows/visual-studio/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index e61ebafbe9..dc66369a63 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -28,11 +28,11 @@ runs: # Run installation script ./develop.ps1 - # Check paths are correct + # Check paths have been exported $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) Write-Output "$systemPath" $qt6Path = "dissolve\dependencies\qt\${{ env.qtVersion }}\msvc2019_64" - $pythonEnvPath = "dissolve\dependencies\msvc-env\Scripts" + $pythonEnvPath = "dissolve\msvc-env\Scripts" if ($systemPath -notlike "*$pythonEnvPath*") { Write-Output "Python env not found in PATH" From 64b70d4928aa0364a2f67220bd920b14096ee7c3 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Tue, 14 Jan 2025 18:48:42 +0000 Subject: [PATCH 84/91] try and build gui dissolve in workflow --- .github/workflows/visual-studio/action.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index dc66369a63..6b3a8c0f91 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -24,29 +24,12 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - - # Run installation script ./develop.ps1 - # Check paths have been exported - $systemPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) - Write-Output "$systemPath" - $qt6Path = "dissolve\dependencies\qt\${{ env.qtVersion }}\msvc2019_64" - $pythonEnvPath = "dissolve\msvc-env\Scripts" - - if ($systemPath -notlike "*$pythonEnvPath*") { - Write-Output "Python env not found in PATH" - exit 1 - } - - if ($systemPath -notlike "*$qt6Path*") { - Write-Output "Qt6 not found in PATH" - exit 1 - } - name: 'Configure and build with CMake' shell: bash run: | - export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ env.qtVersion }}\msvc2019_64;$PATH" + export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ env.qtVersion }}\msvc2019_64\bin;$PATH" cmake --preset GUI-Debug-MSVC cmake --build build \ No newline at end of file From ad2d085404fc388bb28bb7774898fd52b1b0e67c Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 15 Jan 2025 09:38:50 +0000 Subject: [PATCH 85/91] submodule --- .github/workflows/visual-studio/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 6b3a8c0f91..176e98c2da 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -30,6 +30,7 @@ runs: - name: 'Configure and build with CMake' shell: bash run: | + git submodule update --init --recursive export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ env.qtVersion }}\msvc2019_64\bin;$PATH" cmake --preset GUI-Debug-MSVC cmake --build build \ No newline at end of file From 619da33d75da1fbb1b4890c19689c0243a45c7f8 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 15 Jan 2025 11:40:04 +0000 Subject: [PATCH 86/91] update docs --- web/docs/userguide/developers/docker.md | 13 +++++++++++-- web/docs/userguide/developers/vs2022.md | 8 ++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) 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 index dca0701529..88d9ffa999 100644 --- a/web/docs/userguide/developers/vs2022.md +++ b/web/docs/userguide/developers/vs2022.md @@ -9,7 +9,7 @@ Outlined below is a step-by-step guide to setting up a development environment o ### Basic requirements -Install Microsoft Visual Studio 2022, and use the Visual Studio Installer application to install the "Desktop Development with C++" workload. +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. @@ -58,7 +58,11 @@ or 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`. +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 From 5c63864ea0bfef071f358c93023065130dd0aebc Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Wed, 15 Jan 2025 11:41:38 +0000 Subject: [PATCH 87/91] build fails on unit test - try release --- .github/workflows/visual-studio/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 176e98c2da..b0eb36d6ed 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -24,7 +24,7 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - ./develop.ps1 + ./develop.ps1 -release - name: 'Configure and build with CMake' @@ -32,5 +32,5 @@ runs: run: | git submodule update --init --recursive export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ env.qtVersion }}\msvc2019_64\bin;$PATH" - cmake --preset GUI-Debug-MSVC + cmake --preset GUI-Release-MSVC cmake --build build \ No newline at end of file From c4d65d512f6f57fb594e0efd0f4c065cbc5a96e4 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 16 Jan 2025 16:29:05 +0000 Subject: [PATCH 88/91] manage dependency version by argument --- .github/workflows/visual-studio/action.yml | 2 +- develop.ps1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index b0eb36d6ed..3c70852ce3 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -24,7 +24,7 @@ runs: shell: pwsh run: | Set-Location ${{ github.workspace }} - ./develop.ps1 -release + ./develop.ps1 -release -qtVersion ${{ env.qtVersion }} -antlrVersion ${{ env.antlrVersion }} - name: 'Configure and build with CMake' diff --git a/develop.ps1 b/develop.ps1 index 1d0cdf6a67..199d7b16d7 100644 --- a/develop.ps1 +++ b/develop.ps1 @@ -14,7 +14,8 @@ # Flag: Use existing Qt installation (requires Qt6_DIR environment variable to be set) param ( - [switch]$systemqt = $false, + [string]$qtVersion, + [string]$antlrVersion = "4.13.1", [switch]$release = $false ) @@ -109,7 +110,7 @@ Write-Host "Python packages directory path added to system PATH." @info_colors $qt6Dir = "" -if (-not $systemqt) +if (-not [string]::IsNullOrEmpty($qtVersion)) { # Install Qt6 $qtVersion = "6.4.2" @@ -256,7 +257,6 @@ if ($include -notlike "*$ftglInclude*") { # Get ANTLR and Java Set-Location -Path $projectDir -$antlrVersion = "4.13.1" $antlrUri = "https://www.antlr.org/download/antlr-$antlrVersion-complete.jar" $antlrOutput = "antlr-$antlrVersion-complete.jar" From 95be49e2cc74181b38d40ee9c42ee296cff2f837 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 16 Jan 2025 17:40:19 +0000 Subject: [PATCH 89/91] env vars --- .github/workflows/visual-studio/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index 3c70852ce3..cc67444a95 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -22,9 +22,12 @@ runs: - name: 'Install dependencies' shell: pwsh + env: + qtVersion: ${{ env.qtVersion }} + antlrVersion: ${{ env.antlrVersion }} run: | Set-Location ${{ github.workspace }} - ./develop.ps1 -release -qtVersion ${{ env.qtVersion }} -antlrVersion ${{ env.antlrVersion }} + ./develop.ps1 -release -qtVersion $env:qtVersion -antlrVersion $env:antlrVersion }} - name: 'Configure and build with CMake' From 3e75dea4ed8a5de3dea7951ca0105141d0b5add1 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 16 Jan 2025 17:41:05 +0000 Subject: [PATCH 90/91] env vars 2 --- .github/workflows/visual-studio/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index cc67444a95..e333847356 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -27,7 +27,7 @@ runs: antlrVersion: ${{ env.antlrVersion }} run: | Set-Location ${{ github.workspace }} - ./develop.ps1 -release -qtVersion $env:qtVersion -antlrVersion $env:antlrVersion }} + ./develop.ps1 -release -qtVersion $env:qtVersion -antlrVersion $env:antlrVersion - name: 'Configure and build with CMake' From dc79a33c0f20146b186df3040d350fff71e12137 Mon Sep 17 00:00:00 2001 From: RobBuchananCompPhys Date: Thu, 16 Jan 2025 20:31:59 +0000 Subject: [PATCH 91/91] env vars 3 --- .github/workflows/visual-studio/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/visual-studio/action.yml b/.github/workflows/visual-studio/action.yml index e333847356..33c3599015 100644 --- a/.github/workflows/visual-studio/action.yml +++ b/.github/workflows/visual-studio/action.yml @@ -22,11 +22,12 @@ runs: - name: 'Install dependencies' shell: pwsh - env: - qtVersion: ${{ env.qtVersion }} - antlrVersion: ${{ env.antlrVersion }} run: | Set-Location ${{ github.workspace }} + $env:qtVersion = "${{ env.qtVersion }}" + Write-Output "Qt version is: $env:qtVersion" + $env:antlrVersion = "${{ env.antlrVersion }}" + Write-Output "ANTLR version is: $env:antlrVersion" ./develop.ps1 -release -qtVersion $env:qtVersion -antlrVersion $env:antlrVersion