Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 9 additions & 24 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
environment:
matrix:
- TARGET_ARCH: x86
CONDA_PY: 36
CONDA_INSTALL_LOCN: C:\\Miniconda36
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
platform: x86
SHARED: ON

- TARGET_ARCH: x64
CONDA_PY: 37
CONDA_PY: 3.7
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
platform: x64
SHARED: ON
SHARED: OFF

- TARGET_ARCH: x86
CONDA_PY: 37
CONDA_PY: 3.7
CONDA_INSTALL_LOCN: C:\\Miniconda37
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
platform: x86
SHARED: ON

- TARGET_ARCH: x64
CONDA_PY: 36
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
platform: x64
SHARED: OFF

configuration:
# - Debug
- Release
Expand Down Expand Up @@ -91,7 +77,6 @@ install:

# Add path, activate `conda` and update conda.
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: conda update --yes --quiet conda

- cmd: set PYTHONUNBUFFERED=1

Expand All @@ -101,9 +86,9 @@ install:
- cmd: conda config --append channels conda-forge

# Configure the VM.
- cmd: conda install -n root --quiet --yes numpy>=1.15 cmake hdf5
# ADIOS2 build only for 64bit Windows and Python 3.6+
- cmd: if "%TARGET_ARCH%"=="x64" if %CONDA_PY% GEQ 36 conda install -n root --quiet --yes adios2
- cmd: conda install -n root --quiet --yes numpy cmake hdf5 python=%CONDA_PY%
# ADIOS2 build only for 64bit Windows
- cmd: if "%TARGET_ARCH%"=="x64" conda install -n root --quiet --yes adios2 python=%CONDA_PY%

before_build:
- cmd: cd C:\projects\openpmd-api
Expand All @@ -121,12 +106,12 @@ before_build:
# - cmd: if "%TARGET_ARCH%"=="x64" "C:\Program Files (x86)\Microsoft Visual Studio 15.9\VC\vcvarsall.bat" amd64

# CMake configure
- cmd: cmake -G "%OPENPMD_CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_SHARED_LIBS=%SHARED% -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX="%CONDA_INSTALL_LOCN%" -DCMAKE_INSTALL_BINDIR="Library\bin" ".."
- cmd: cmake -G "%OPENPMD_CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_SHARED_LIBS=%SHARED% -DBUILD_TESTING=ON -DopenPMD_USE_PYTHON=ON -DPython_EXECUTABLE="%CONDA_INSTALL_LOCN%\python.exe" -DCMAKE_INSTALL_PREFIX="%CONDA_INSTALL_LOCN%" -DCMAKE_INSTALL_BINDIR="Library\bin" ".."

build_script:
- cmd: cmake --build . --config %CONFIGURATION%
- cmd: cmake --build . --config %CONFIGURATION% -j 2
- cmd: cmake --build . --config %CONFIGURATION% --target install

test_script:
- cmd: ctest -V -C %CONFIGURATION%
Copy link
Member Author

@ax3l ax3l Oct 22, 2021

Choose a reason for hiding this comment

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

This probably only works because we install first 😅
CTest Python path is still a bit flaky for multi-config generators. Ok for a follow-up PR.

- cmd: python -c "import openpmd_api; print(openpmd_api.__version__); print(openpmd_api.variants)"
- cmd: call %CONDA_INSTALL_LOCN%\python.exe -c "import openpmd_api; print(openpmd_api.__version__); print(openpmd_api.variants)"
57 changes: 57 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 🪟 Windows

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-windows
cancel-in-progress: true

jobs:
build_win_msvc:
name: MSVC w/o MPI
runs-on: windows-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- name: Build & Install
run: |
python3.exe -m pip install --upgrade pip
python3.exe -m pip install --upgrade numpy

pwsh "share\openPMD\download_samples.ps1" build
cmake -S . -B build `
-DCMAKE_BUILD_TYPE=Debug `
-DopenPMD_USE_MPI=OFF
cmake --build build --config Debug --parallel 2
cmake --build build --config Debug --target install

# add before install, and fix Python path:
# ctest --test-dir build -C Debug --output-on-failure


build_win_clang:
name: Clang w/o MPI
runs-on: windows-2019
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build & Install
shell: cmd
run: |
python3.exe -m pip install --upgrade pip
python3.exe -m pip install --upgrade numpy

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
pwsh "share\openPMD\download_samples.ps1" build
cmake -S . -B build ^
-G "Ninja" ^
-DCMAKE_C_COMPILER=clang-cl ^
-DCMAKE_CXX_COMPILER=clang-cl ^
-DCMAKE_BUILD_TYPE=Release ^
-DopenPMD_USE_MPI=OFF
cmake --build build --config Release --parallel 2
cmake --build build --config Debug --target install

# add before install, and fix Python path:
# ctest --test-dir build -C Debug --output-on-failure
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,8 @@ if(openPMD_BUILD_TESTING)
endforeach()

# openpmd-pipe (python) test
if( openPMD_HAVE_HDF5
if( NOT WIN32
AND openPMD_HAVE_HDF5
AND (openPMD_HAVE_ADIOS2 OR openPMD_HAVE_ADIOS1)
AND EXAMPLE_DATA_FOUND
)
Expand Down
2 changes: 2 additions & 0 deletions share/openPMD/download_samples.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Param(
)

$orgdir = $(Get-Location | Foreach-Object { $_.Path })

$null = New-Item -Type Directory -Force $bdir
cd $bdir

New-item -ItemType directory -Name samples\git-sample\thetaMode\
Expand Down