Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Powershell script to install dependencies for MSVC #2021

Open
wants to merge 91 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
bdfa7c1
powershell script to install dependencies
RobBuchananCompPhys Nov 27, 2024
42d77b1
updated script
RobBuchananCompPhys Nov 27, 2024
cbbbfec
add flag to use existing system qt
RobBuchananCompPhys Nov 27, 2024
56ca8fd
only install qt6 via python if not system qt
RobBuchananCompPhys Nov 27, 2024
3c2494b
flag bool
RobBuchananCompPhys Nov 28, 2024
ad699ee
ftgl paths, fix antlr executable path
RobBuchananCompPhys Nov 29, 2024
00a1078
use correct ftgl paths
RobBuchananCompPhys Nov 29, 2024
ab06f47
pretty format output json
RobBuchananCompPhys Nov 29, 2024
3dddf28
pretty format output json 2
RobBuchananCompPhys Nov 29, 2024
68ca640
don't bother with json formatting for now
RobBuchananCompPhys Nov 29, 2024
f15cee7
add java executable to path
RobBuchananCompPhys Nov 29, 2024
320da75
ammend ftgl path
RobBuchananCompPhys Nov 29, 2024
bf03bf6
ammend ftgl paths
RobBuchananCompPhys Nov 29, 2024
3fd2e80
check python compiler version
RobBuchananCompPhys Nov 30, 2024
fe24b6a
properly activate python environment
RobBuchananCompPhys Dec 1, 2024
2b711eb
update freetype lib paths
RobBuchananCompPhys Dec 1, 2024
1e19986
revert to previous freetype paths for ftgl build
RobBuchananCompPhys Dec 1, 2024
f4f0d02
console output
RobBuchananCompPhys Dec 1, 2024
19848ab
more console output
RobBuchananCompPhys Dec 1, 2024
b9793d1
paths to conan packages
RobBuchananCompPhys Dec 2, 2024
74ef87d
enclose object field in quotation marks
RobBuchananCompPhys Dec 2, 2024
f9d3fe3
try to build without supplying unused cmake variables
RobBuchananCompPhys Dec 3, 2024
3ed2431
allow debug and release dependencies
RobBuchananCompPhys Dec 6, 2024
c3ea2fa
fix path variable error
RobBuchananCompPhys Dec 6, 2024
dcd4a4d
capture installation config as cmake variable
RobBuchananCompPhys Dec 6, 2024
87aa007
install
RobBuchananCompPhys Dec 10, 2024
512b043
correct dependency locations for building CLI version
RobBuchananCompPhys Dec 10, 2024
d96c810
fix no newline eof
RobBuchananCompPhys Dec 10, 2024
41e4300
warning colors, warn if qt version incorrect
RobBuchananCompPhys Dec 11, 2024
ed5d5ce
install dissolve gui dependencies
RobBuchananCompPhys Dec 11, 2024
c96eaf6
modularise visual studio workflow
RobBuchananCompPhys Dec 11, 2024
cca7b94
install choco
RobBuchananCompPhys Dec 11, 2024
709af8e
missing header file (was in issue in visual studio build)
RobBuchananCompPhys Dec 11, 2024
7ee7cca
reformat includes
RobBuchananCompPhys Dec 11, 2024
22f5371
reformat cmake
RobBuchananCompPhys Dec 11, 2024
9de60b1
developer docs
RobBuchananCompPhys Dec 11, 2024
867a928
remove unused python package
RobBuchananCompPhys Dec 12, 2024
4c99480
proper qt bin location
RobBuchananCompPhys Dec 12, 2024
70773a0
attempt to overcome Freetype not found by passing FREETYPE_LIBRARY as…
RobBuchananCompPhys Dec 12, 2024
6b78c69
freetype lib path
RobBuchananCompPhys Dec 12, 2024
71b57f2
sensible font..
RobBuchananCompPhys Dec 19, 2024
be607bc
enhance package management and paths
RobBuchananCompPhys Dec 20, 2024
dbbbba5
keep python compiler condition
RobBuchananCompPhys Dec 20, 2024
0ffd1b9
get cmake, assert python 3.12
RobBuchananCompPhys Jan 8, 2025
1120a98
ammend python 3.12 install string
RobBuchananCompPhys Jan 8, 2025
bf09110
more freetype (gui build)
RobBuchananCompPhys Jan 8, 2025
9eb060d
fix typo in freetype path
RobBuchananCompPhys Jan 8, 2025
c077ced
github ci workflow
RobBuchananCompPhys Jan 9, 2025
0b191b4
ammed github ci workflow
RobBuchananCompPhys Jan 9, 2025
879bdf0
isolate powershell script output in ci
RobBuchananCompPhys Jan 9, 2025
775a62a
ci visual studio build
RobBuchananCompPhys Jan 9, 2025
0ed94b7
explicitly use cl in ci build
RobBuchananCompPhys Jan 9, 2025
395022c
try with different compiler path
RobBuchananCompPhys Jan 9, 2025
732d241
try with different compiler path 2
RobBuchananCompPhys Jan 9, 2025
b22a6ea
try with different compiler path 3 (env var)
RobBuchananCompPhys Jan 9, 2025
f695352
restore to previous, leave out qt installation temporarily for speed
RobBuchananCompPhys Jan 9, 2025
0ed94b2
check if cli works in one line
RobBuchananCompPhys Jan 9, 2025
cd063be
check if cli works in one line 2
RobBuchananCompPhys Jan 9, 2025
81b7d49
nope.
RobBuchananCompPhys Jan 9, 2025
f78a355
try with custom msvc-dev-cmd action
RobBuchananCompPhys Jan 10, 2025
7f0cb4e
shell
RobBuchananCompPhys Jan 10, 2025
6bda9e5
fix duplicate item
RobBuchananCompPhys Jan 10, 2025
ca8f467
check env vars
RobBuchananCompPhys Jan 10, 2025
cc1410d
add path to conan
RobBuchananCompPhys Jan 10, 2025
b12ffda
add path to conan 2
RobBuchananCompPhys Jan 10, 2025
bf39a14
add path to conan 3
RobBuchananCompPhys Jan 10, 2025
15acf1f
cached conan
RobBuchananCompPhys Jan 10, 2025
b6cd58e
try with visual studio x64 command line environemnt
RobBuchananCompPhys Jan 10, 2025
167085d
remove # chars
RobBuchananCompPhys Jan 10, 2025
f689e36
quotes
RobBuchananCompPhys Jan 10, 2025
b5b55ec
go back to using pwsh
RobBuchananCompPhys Jan 10, 2025
5ecd64a
try with chocolatey refreshenv
RobBuchananCompPhys Jan 10, 2025
7df8525
see directory contents
RobBuchananCompPhys Jan 14, 2025
ea33f2d
see path to conan, does cl work
RobBuchananCompPhys Jan 14, 2025
39ff10f
can we find conan
RobBuchananCompPhys Jan 14, 2025
f056bb7
is there even a conan
RobBuchananCompPhys Jan 14, 2025
b622253
try with bash
RobBuchananCompPhys Jan 14, 2025
d28d6a4
build dissolve cli
RobBuchananCompPhys Jan 14, 2025
d488fa3
can we get path vars directly
RobBuchananCompPhys Jan 14, 2025
427a68a
add some checks on script
RobBuchananCompPhys Jan 14, 2025
39a55f4
add some checks on script 2
RobBuchananCompPhys Jan 14, 2025
1f7a347
add some checks on script 3 and try and build gui
RobBuchananCompPhys Jan 14, 2025
c2925a9
fix typo
RobBuchananCompPhys Jan 14, 2025
64b70d4
try and build gui dissolve in workflow
RobBuchananCompPhys Jan 14, 2025
ad2d085
submodule
RobBuchananCompPhys Jan 15, 2025
619da33
update docs
RobBuchananCompPhys Jan 15, 2025
5c63864
build fails on unit test - try release
RobBuchananCompPhys Jan 15, 2025
c4d65d5
manage dependency version by argument
RobBuchananCompPhys Jan 16, 2025
95be49e
env vars
RobBuchananCompPhys Jan 16, 2025
3e75dea
env vars 2
RobBuchananCompPhys Jan 16, 2025
dc79a33
env vars 3
RobBuchananCompPhys Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/msvc-developer.yml
Original file line number Diff line number Diff line change
@@ -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:

Develop:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Develop MSVC
uses: "./.github/workflows/visual-studio"
with:
publishType: 'none'
40 changes: 40 additions & 0 deletions .github/workflows/visual-studio/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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
Comment on lines +3 to +12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inputs:
publishType:
type: choice
default: 'none'
options:
- none
- continuous
- release
- legacy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just been taking a look at your changelog PR, and I can see there is a bit of harmonisation to do on my part here - agree that making these parameters into script arguments is a good idea

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My temptation would be to make make using the system qt the default option and the having a flag to specify installing a specific Qt version with that version as a parameter. Then the correct Qt version can easily be passed in on the CI. It also feels like a better default in that, if I don't have Qt installed and forget the flag, I could run it again with the flag to install Qt, but the current setup makes it easy to accidentally install two versions of Qt and doesn't provide any method for rectifying that problem.


runs:
using: "composite"
steps:

- name: 'Set up MSVC toolchain'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: 'Install dependencies'
shell: pwsh
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


- 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-Release-MSVC
cmake --build build
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -410,3 +413,9 @@ if(GUI)
)
install(SCRIPT ${deploy_script})
endif(GUI)

# Install for MSVC
if(MSVC_DEV)
include(msvc-dissolve-dev)
setup_msvc()
endif(MSVC_DEV)
1 change: 1 addition & 0 deletions benchmark/math/interpolator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "math/data1D.h"
#include <algorithm>
#include <benchmark/benchmark.h>
#include <numeric>
#include <random>
#include <vector>

Expand Down
45 changes: 45 additions & 0 deletions cmake/Modules/msvc-dissolve-dev.cmake
Original file line number Diff line number Diff line change
@@ -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()
Loading
Loading