Welcome to mirror list, hosted at ThFree Co, Russian Federation.

windows.yml « workflows « .github - github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 648887aece8c13c50367a47c2d31a564aa0e4f39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Windows

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  MKL_URL: "https://romang.blob.core.windows.net/mariandev/ci/mkl-2020.1-windows-static.zip"

jobs:
  build-windows:
    strategy:
      matrix:
        include:
          # Windows CPU-only build
          - name: "Windows CPU-only"
            cuda: ""
            gpu: false
          # Windows CPU+GPU build
          - name: "Windows CPU+CUDA"
            cuda: "10.2"
            gpu: true

    runs-on: windows-2019
    name: ${{ matrix.name }}

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        submodules: recursive

    - name: Download MKL
      run: |
        # Wget retries downloading files and is faster than Invoke-WebRequest
        C:\msys64\usr\bin\wget.exe -nv ${{ env.MKL_URL }} -O mkl.zip
        Expand-Archive -Force mkl.zip ${{ github.workspace }}\mkl
        # Set MKLROOT environment variable so that CMake can find MKL
        echo "MKLROOT=${{ github.workspace }}\mkl" | Out-File -FilePath $env:GITHUB_ENV  -Encoding utf8 -Append
      shell: powershell

    - name: Install CUDA
      run: |
        .\scripts\ci\install_cuda_windows.ps1 "10.2"
        # Set CUDA_PATH environment variable so that CMake can find CUDA
        echo "CUDA_PATH=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV  -Encoding utf8 -Append
        echo "$env:CUDA_PATH/bin"       | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
      shell: powershell
      if: matrix.gpu == true

    - name: Prepare vcpkg
      uses: lukka/run-vcpkg@v4
      with:
        vcpkgArguments: protobuf
        vcpkgGitCommitId: 6185aa76504a5025f36754324abf307cc776f3da
        vcpkgDirectory: ${{ github.workspace }}/vcpkg/
        vcpkgTriplet: x64-windows-static

    # Windows CUDA builds use USE_NCCL=off due to compilation errors.
    - name: Build Debug
      uses: lukka/run-cmake@v3
      with:
        buildDirectory: ${{ github.workspace }}/build/Debug
        cmakeAppendedArgs: '-G Ninja
          -DCMAKE_BUILD_TYPE="Debug"
          -DOPENSSL_USE_STATIC_LIBS="TRUE"
          -DOPENSSL_MSVC_STATIC_RT="TRUE"
          -DCOMPILE_CPU="TRUE"
          -DCOMPILE_CUDA="${{ matrix.gpu }}"
          -DCOMPILE_SERVER="FALSE"
          -DCOMPILE_TESTS="TRUE"
          -DUSE_FBGEMM="TRUE"
          -DUSE_MPI="FALSE"
          -DUSE_NCCL="FALSE"
          -DUSE_SENTENCEPIECE="TRUE"
          -DUSE_STATIC_LIBS="TRUE"'
        cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
        cmakeListsTxtPath: ${{ github.workspace }}/CMakeLists.txt
        useVcpkgToolchainFile: true
      # Building in Debug is sufficient for the all-in CPU+GPU compilation;
      # its main purpose is to detect warnings that the Release build is not
      # able to find sometimes.
      if: matrix.gpu == true

    # Windows CUDA builds use USE_NCCL=off due to compilation errors
    # Boost is pre-installed on Azure/GitHub-hosted Windows runners
    # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#boost
    # (not used yet)
    - name: Build Release
      uses: lukka/run-cmake@v3
      with:
        buildDirectory: ${{ github.workspace }}/build/
        cmakeAppendedArgs: '-G Ninja
          -DBOOST_ROOT="$(BOOST_ROOT_1_72_0)"
          -DBOOST_INCLUDEDIR="$(BOOST_ROOT_1_72_0)/include"
          -DBOOST_LIBRARYDIR="$(BOOST_ROOT_1_72_0)/lib"
          -DCMAKE_BUILD_TYPE="Release"
          -DOPENSSL_USE_STATIC_LIBS="TRUE"
          -DOPENSSL_MSVC_STATIC_RT="TRUE"
          -DCOMPILE_CPU="TRUE"
          -DCOMPILE_CUDA="${{ matrix.gpu }}"
          -DCOMPILE_SERVER="FALSE"
          -DCOMPILE_TESTS="TRUE"
          -DUSE_FBGEMM="TRUE"
          -DUSE_MPI="FALSE"
          -DUSE_NCCL="FALSE"
          -DUSE_SENTENCEPIECE="TRUE"
          -DUSE_STATIC_LIBS="TRUE"'
        cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
        cmakeListsTxtPath: ${{ github.workspace }}/CMakeLists.txt
        useVcpkgToolchainFile: true

    - name: Run unit tests
      working-directory: build/
      run: ctest
      # Not run in GPU builds because GitHub-hosted VMs do not have GPUs
      if: matrix.gpu == false

    - name: Print versions
      working-directory: build/
      run: |
        .\marian.exe --version
        .\marian-decoder.exe --version
        .\marian-scorer.exe --version
        dir *.exe
      shell: cmd