Skip to content

Commit

Permalink
Merge pull request ornladios#4266 from vicentebolea/use-conda-deps-wi…
Browse files Browse the repository at this point in the history
…ndows

ci,windows: Use conda for all deps
  • Loading branch information
vicentebolea authored Jul 26, 2024
2 parents c75e1c5 + 01de3d1 commit b8761e2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ jobs:
matrix:
os: [win2019, win2022]
shared: [shared]
parallel: [serial, ompi]
parallel: [serial, msmpi]
include:
- os: win2019
image: windows-2019
Expand Down
15 changes: 4 additions & 11 deletions scripts/ci/cmake/ci-win2019-vs2019-msmpi.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
# Client maintainer: chuck.atkins@kitware.com

set(ENV{CC} cl)
set(ENV{CXX} cl)
set(ENV{CFLAGS} /WX)
set(ENV{CXXFLAGS} /WX)

include(ProcessorCount)
ProcessorCount(NCPUS)
math(EXPR N2CPUS "${NCPUS}*2")

set(dashboard_cache "
BUILD_TESTING:BOOL=ON
ADIOS2_BUILD_EXAMPLES:BOOL=ON
ADIOS2_USE_BZip2:BOOL=OFF
ADIOS2_USE_Fortran:BOOL=OFF
ADIOS2_USE_MPI:STRING=ON
MPIEXEC_MAX_NUMPROCS:STRING=${N2CPUS}
ADIOS2_USE_MPI:BOOL=ON
ADIOS2_USE_Python=OFF
")

set(CTEST_TEST_ARGS PARALLEL_LEVEL 1)
#set(CTEST_CMAKE_GENERATOR "Ninja")
set(CTEST_TEST_TIMEOUT 500)
set(CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
set(CTEST_CMAKE_GENERATOR_PLATFORM "x64")
list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}")
Expand Down
19 changes: 0 additions & 19 deletions scripts/ci/cmake/ci-win2019-vs2019-ompi.cmake

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ set(ENV{CXX} cl)
set(ENV{CFLAGS} /WX)
set(ENV{CXXFLAGS} /WX)

# Tests need to find hdf5.dll
set(ENV{PATH} "$ENV{PATH};C:/hdf5/HDF5-1.14.2.1-win64/bin")

set(dashboard_cache "
BUILD_TESTING:BOOL=ON
ADIOS2_BUILD_EXAMPLES:BOOL=ON
Expand All @@ -15,7 +12,7 @@ ADIOS2_USE_Fortran:BOOL=OFF
ADIOS2_USE_MPI:BOOL=ON
ADIOS2_USE_HDF5:STRING=ON
ADIOS2_USE_HDF5_VOL:STRING=OFF
HDF5_ROOT:PATH=C:/hdf5/HDF5-1.14.2.1-win64
ADIOS2_USE_Python=OFF
")

set(CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
Expand Down
1 change: 0 additions & 1 deletion scripts/ci/cmake/ci-win2022-vs2022-serial.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ADIOS2_USE_MPI:BOOL=OFF
ADIOS2_USE_HDF5:STRING=ON
ADIOS2_USE_Python:BOOL=OFF
ADIOS2_USE_HDF5_VOL:STRING=OFF
HDF5_ROOT:PATH=C:/hdf5/HDF5-1.14.2.1-win64
")

set(CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
Expand Down
1 change: 0 additions & 1 deletion scripts/ci/cmake/ci-win2022-vs2022-static-serial.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ADIOS2_USE_MPI:BOOL=OFF
ADIOS2_USE_HDF5:STRING=OFF
ADIOS2_USE_Python:BOOL=OFF
ADIOS2_USE_HDF5_VOL:STRING=OFF
# HDF5_ROOT:PATH=C:/hdf5/HDF5-1.14.2.1-win64
")

set(CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
Expand Down
7 changes: 7 additions & 0 deletions scripts/ci/gh-actions/conda-env-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: adios2
variables:
CMAKE_PREFIX_PATH: "C:/Miniconda/envs/adios2/Library;$CMAKE_PREFIX_PATH"
dependencies:
- c-blosc2
- numpy>=1.19
- hdf5
83 changes: 5 additions & 78 deletions scripts/ci/gh-actions/windows-setup.ps1
Original file line number Diff line number Diff line change
@@ -1,92 +1,19 @@
$ErrorActionPreference = "Stop"

Write-Host "::group::Updating pip"
python3 -m pip install --upgrade pip
Write-Host "::endgroup::"

Write-Host "::group::Installing NumPy"
pip install "numpy>=1.19"
Write-Host "::endgroup::"

Write-Host "::group::Setup CONDA"
$Env:Path += ";$Env:CONDA\condabin"
conda.bat init powershell
conda.bat init bash
Write-Host "::endgroup::"

Write-Host "::group::Installing c-blosc2"
conda.bat install -y conda-forge::c-blosc2
Write-Host "::group::Installing common deps"
conda.bat env create -f "gha\scripts\ci\gh-actions\conda-env-win.yml"
Write-Host "::endgroup::"

if($Env:GH_YML_MATRIX_PARALLEL -eq "ompi")
if($Env:GH_YML_MATRIX_PARALLEL -eq "msmpi")
{
# This is taken from the MSMPI VCPKG
$baseurl = "https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623"
$version = "10.1.12498"

$tempdir = $Env:RUNNER_TEMP
$msmpisdk = Join-Path $tempdir msmpisdk.msi
$msmpisetup = Join-Path $tempdir msmpisetup.exe

Write-Host "::group::Downloading Microsoft MPI SDK $version"
Invoke-WebRequest "$baseurl/msmpisdk.msi" -OutFile $msmpisdk
Write-Host "::endgroup::"
Write-Host "::group::Installing Microsoft MPI SDK $version"
Start-Process msiexec.exe -ArgumentList "/quiet /passive /qn /i $msmpisdk" -Wait
Write-Host "::endgroup::"

Write-Host "::group::Downloading Microsoft MPI Runtime $version"

Invoke-WebRequest "$baseurl/msmpisetup.exe" -OutFile $msmpisetup
Write-Host "::endgroup::"
Write-Host "::group::Installing Microsoft MPI Runtime $version"
Start-Process $msmpisetup -ArgumentList "-unattend" -Wait
Write-Host "::endgroup::"

if ($Env:GITHUB_ENV) {
Write-Host '::group::Adding environment variables to $GITHUB_ENV'
$envlist = @("MSMPI_BIN", "MSMPI_INC", "MSMPI_LIB32", "MSMPI_LIB64")
foreach ($name in $envlist) {
$value = [Environment]::GetEnvironmentVariable($name, "Machine")
Write-Host "$name=$value"
Add-Content $Env:GITHUB_ENV "$name=$value"
}
Write-Host "::endgroup::"
}

if ($Env:GITHUB_PATH) {
Write-Host '::group::Adding $MSMPI_BIN to $GITHUB_PATH'
$MSMPI_BIN = [Environment]::GetEnvironmentVariable("MSMPI_BIN", "Machine")
Add-Content $Env:GITHUB_PATH $MSMPI_BIN
Write-Host "::endgroup::"
}

Write-Host "::group::Installing mpi4py"
pip install "mpi4py>=1.03"
Write-Host "::group::Installing msmpi"
conda.bat install -n adios2 -c conda-forge -y "msmpi" "mpi4py"
Write-Host "::endgroup::"
}

if ($Env:GH_YML_MATRIX_COMPILER -eq "vs2022")
{
$url = "https://github.com/HDFGroup/hdf5/releases/download/hdf5-1_14_1-2/hdf5-1_14_1-2-win_vs2022.zip"

$tempdir = $Env:RUNNER_TEMP
$hdf5Zip = Join-Path $tempdir hdf5-1_14_1-2-win_vs2022.zip
$installDir = "C:\hdf5"
$extractDir = Join-Path $tempdir hdf5
$innerZip = Join-Path $extractDir HDF5-1.14.2.1-win64.zip

Write-Host "::group::Downloading windows HDF5 release $url"
Invoke-WebRequest $url -OutFile $hdf5Zip
Write-Host "::endgroup::"

Write-Host "::group::Extracting outer windows HDF5 release $hdf5Zip"
Expand-Archive $hdf5Zip -DestinationPath $tempDir -Force
Write-Host "::endgroup::"

Write-Host "::group::Extracting inner windows HDF5 release $innerZip"
Expand-Archive $innerZip -DestinationPath $installDir -Force
Write-Host "::endgroup::"

# Now the HDF5_DIR can be set to: C:\hdf5\HDF5-1.14.2.1-win64\cmake
}
5 changes: 2 additions & 3 deletions scripts/ci/setup-run/ci-Windows.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
set +u
# We do not use conda cmake, thus we have to hint cmake where is
# conda root dir.
export CMAKE_PREFIX_PATH="C:/Miniconda/Library;$CMAKE_PREFIX_PATH"

conda activate adios2

0 comments on commit b8761e2

Please sign in to comment.