diff --git a/.appveyor.yml b/.appveyor.yml index c10a31646f..55a5a78f70 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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 @@ -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 @@ -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 @@ -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% - - 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)" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..e3eb4c671a --- /dev/null +++ b/.github/workflows/windows.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index cc4b057609..25c0bfe004 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/share/openPMD/download_samples.ps1 b/share/openPMD/download_samples.ps1 index 3e2f2eae83..5fc8987c4d 100755 --- a/share/openPMD/download_samples.ps1 +++ b/share/openPMD/download_samples.ps1 @@ -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\