build.yml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. name: CI
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. inputs:
  5. create_release:
  6. description: 'Create new release'
  7. required: true
  8. type: boolean
  9. push:
  10. branches:
  11. - master
  12. paths: ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
  13. pull_request:
  14. types: [opened, synchronize, reopened]
  15. paths: ['**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
  16. env:
  17. BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
  18. GGML_NLOOP: 3
  19. GGML_NITER: 1
  20. GGML_N_THREADS: 1
  21. jobs:
  22. ubuntu-focal-make:
  23. runs-on: ubuntu-20.04
  24. steps:
  25. - name: Clone
  26. id: checkout
  27. uses: actions/checkout@v1
  28. - name: Dependencies
  29. id: depends
  30. run: |
  31. sudo apt-get update
  32. sudo apt-get install build-essential gcc-8
  33. - name: Build
  34. id: make_build
  35. run: |
  36. CC=gcc-8 make
  37. ubuntu-latest-cmake:
  38. runs-on: ubuntu-latest
  39. steps:
  40. - name: Clone
  41. id: checkout
  42. uses: actions/checkout@v1
  43. - name: Dependencies
  44. id: depends
  45. run: |
  46. sudo apt-get update
  47. sudo apt-get install build-essential
  48. - name: Build
  49. id: cmake_build
  50. run: |
  51. mkdir build
  52. cd build
  53. cmake ..
  54. cmake --build . --config Release
  55. - name: Test
  56. id: cmake_test
  57. run: |
  58. cd build
  59. ctest --verbose --timeout 900
  60. ubuntu-latest-cmake-sanitizer:
  61. runs-on: ubuntu-latest
  62. continue-on-error: true
  63. strategy:
  64. matrix:
  65. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  66. build_type: [Debug, Release]
  67. steps:
  68. - name: Clone
  69. id: checkout
  70. uses: actions/checkout@v1
  71. - name: Dependencies
  72. id: depends
  73. run: |
  74. sudo apt-get update
  75. sudo apt-get install build-essential
  76. - name: Build
  77. id: cmake_build
  78. run: |
  79. mkdir build
  80. cd build
  81. cmake .. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  82. cmake --build . --config ${{ matrix.build_type }}
  83. - name: Test
  84. id: cmake_test
  85. run: |
  86. cd build
  87. ctest --verbose --timeout 900
  88. ubuntu-latest-cmake-mpi:
  89. runs-on: ubuntu-latest
  90. continue-on-error: true
  91. strategy:
  92. matrix:
  93. mpi_library: [mpich, libopenmpi-dev]
  94. steps:
  95. - name: Clone
  96. id: checkout
  97. uses: actions/checkout@v1
  98. - name: Dependencies
  99. id: depends
  100. run: |
  101. sudo apt-get update
  102. sudo apt-get install build-essential ${{ matrix.mpi_library }}
  103. - name: Build
  104. id: cmake_build
  105. run: |
  106. mkdir build
  107. cd build
  108. cmake -DLLAMA_MPI=ON ..
  109. cmake --build . --config Release
  110. - name: Test
  111. id: cmake_test
  112. run: |
  113. cd build
  114. ctest --verbose
  115. macOS-latest-make:
  116. runs-on: macos-latest
  117. steps:
  118. - name: Clone
  119. id: checkout
  120. uses: actions/checkout@v1
  121. - name: Dependencies
  122. id: depends
  123. continue-on-error: true
  124. run: |
  125. brew update
  126. - name: Build
  127. id: make_build
  128. run: |
  129. make
  130. macOS-latest-cmake:
  131. runs-on: macos-latest
  132. steps:
  133. - name: Clone
  134. id: checkout
  135. uses: actions/checkout@v1
  136. - name: Dependencies
  137. id: depends
  138. continue-on-error: true
  139. run: |
  140. brew update
  141. - name: Build
  142. id: cmake_build
  143. run: |
  144. sysctl -a
  145. mkdir build
  146. cd build
  147. cmake -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF ..
  148. cmake --build . --config Release
  149. - name: Test
  150. id: cmake_test
  151. run: |
  152. cd build
  153. ctest --verbose --timeout 900
  154. windows-latest-cmake:
  155. runs-on: windows-latest
  156. env:
  157. OPENBLAS_VERSION: 0.3.23
  158. OPENCL_VERSION: 2023.04.17
  159. CLBLAST_VERSION: 1.6.0
  160. strategy:
  161. matrix:
  162. include:
  163. - build: 'avx2'
  164. defines: '-DLLAMA_BUILD_SERVER=ON'
  165. - build: 'avx'
  166. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF'
  167. - build: 'avx512'
  168. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
  169. - build: 'clblast'
  170. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
  171. - build: 'openblas'
  172. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
  173. steps:
  174. - name: Clone
  175. id: checkout
  176. uses: actions/checkout@v1
  177. - name: Download OpenCL SDK
  178. id: get_opencl
  179. if: ${{ matrix.build == 'clblast' }}
  180. run: |
  181. curl.exe -o $env:RUNNER_TEMP/opencl.zip -L "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v${env:OPENCL_VERSION}/OpenCL-SDK-v${env:OPENCL_VERSION}-Win-x64.zip"
  182. mkdir $env:RUNNER_TEMP/opencl
  183. tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
  184. - name: Download CLBlast
  185. id: get_clblast
  186. if: ${{ matrix.build == 'clblast' }}
  187. run: |
  188. curl.exe -o $env:RUNNER_TEMP/clblast.7z -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-windows-x64.7z"
  189. curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE"
  190. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/clblast.7z
  191. rename-item $env:RUNNER_TEMP/CLBlast-${env:CLBLAST_VERSION}-windows-x64 clblast
  192. foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
  193. $txt = Get-Content -Path $f -Raw
  194. $txt.Replace('C:/vcpkg/packages/opencl_x64-windows/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
  195. }
  196. - name: Download OpenBLAS
  197. id: get_openblas
  198. if: ${{ matrix.build == 'openblas' }}
  199. run: |
  200. curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}/OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip"
  201. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  202. mkdir $env:RUNNER_TEMP/openblas
  203. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  204. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  205. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  206. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  207. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  208. - name: Build
  209. id: cmake_build
  210. run: |
  211. mkdir build
  212. cd build
  213. cmake .. ${{ matrix.defines }}
  214. cmake --build . --config Release
  215. - name: Add clblast.dll
  216. id: add_clblast_dll
  217. if: ${{ matrix.build == 'clblast' }}
  218. run: |
  219. cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release
  220. cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt
  221. - name: Add libopenblas.dll
  222. id: add_libopenblas_dll
  223. if: ${{ matrix.build == 'openblas' }}
  224. run: |
  225. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  226. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  227. - name: Check AVX512F support
  228. id: check_avx512f
  229. if: ${{ matrix.build == 'avx512' }}
  230. continue-on-error: true
  231. run: |
  232. cd build
  233. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  234. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  235. $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
  236. echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
  237. & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
  238. .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
  239. - name: Test
  240. id: cmake_test
  241. if: ${{ matrix.build != 'clblast' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible
  242. run: |
  243. cd build
  244. ctest -C Release --verbose --timeout 900
  245. - name: Get commit hash
  246. id: commit
  247. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  248. uses: pr-mpt/actions-commit-hash@v2
  249. - name: Pack artifacts
  250. id: pack_artifacts
  251. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  252. run: |
  253. Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
  254. 7z a llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip .\build\bin\Release\*
  255. - name: Upload artifacts
  256. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  257. uses: actions/upload-artifact@v3
  258. with:
  259. path: |
  260. llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
  261. windows-latest-cmake-cublas:
  262. runs-on: windows-latest
  263. strategy:
  264. matrix:
  265. cuda: ['12.1.0', '11.7.1']
  266. build: ['cublas']
  267. steps:
  268. - name: Clone
  269. id: checkout
  270. uses: actions/checkout@v1
  271. - uses: Jimver/cuda-toolkit@v0.2.10
  272. id: cuda-toolkit
  273. with:
  274. cuda: ${{ matrix.cuda }}
  275. # TODO(green-sky): _dev seems to fail, and non dev are not enought
  276. #sub-packages: '["nvcc", "cudart", "cublas", "cudart_dev", "cublas_dev"]'
  277. - name: Build
  278. id: cmake_build
  279. run: |
  280. mkdir build
  281. cd build
  282. cmake .. -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON
  283. cmake --build . --config Release
  284. - name: Get commit hash
  285. id: commit
  286. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  287. uses: pr-mpt/actions-commit-hash@v2
  288. - name: Pack artifacts
  289. id: pack_artifacts
  290. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  291. run: |
  292. 7z a llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
  293. - name: Upload artifacts
  294. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  295. uses: actions/upload-artifact@v3
  296. with:
  297. path: |
  298. llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
  299. - name: Copy and pack Cuda runtime
  300. if: ${{ matrix.cuda == '12.1.0' }}
  301. # TODO(green-sky): paths are cuda 12 specific
  302. run: |
  303. echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
  304. mkdir '.\build\bin\cudart\'
  305. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cudart64_12.dll" '.\build\bin\cudart\'
  306. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublas64_12.dll" '.\build\bin\cudart\'
  307. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublasLt64_12.dll" '.\build\bin\cudart\'
  308. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip .\build\bin\cudart\*
  309. - name: Copy and pack Cuda runtime
  310. if: ${{ matrix.cuda == '11.7.1' }}
  311. # TODO(green-sky): paths are cuda 11 specific
  312. run: |
  313. echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
  314. mkdir '.\build\bin\cudart\'
  315. ls "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin"
  316. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cudart64_110.dll" '.\build\bin\cudart\'
  317. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublas64_11.dll" '.\build\bin\cudart\'
  318. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublasLt64_11.dll" '.\build\bin\cudart\'
  319. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip .\build\bin\cudart\*
  320. - name: Upload Cuda runtime
  321. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  322. uses: actions/upload-artifact@v3
  323. with:
  324. path: |
  325. cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  326. release:
  327. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  328. runs-on: ubuntu-latest
  329. needs:
  330. - ubuntu-focal-make
  331. - ubuntu-latest-cmake
  332. - macOS-latest-make
  333. - macOS-latest-cmake
  334. - windows-latest-cmake
  335. - windows-latest-cmake-cublas
  336. steps:
  337. - name: Download artifacts
  338. id: download-artifact
  339. uses: actions/download-artifact@v3
  340. - name: Get commit hash
  341. id: commit
  342. uses: pr-mpt/actions-commit-hash@v2
  343. - name: Create release
  344. id: create_release
  345. uses: anzz1/action-create-release@v1
  346. env:
  347. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  348. with:
  349. tag_name: ${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}
  350. - name: Upload release
  351. id: upload_release
  352. uses: actions/github-script@v3
  353. with:
  354. github-token: ${{secrets.GITHUB_TOKEN}}
  355. script: |
  356. const path = require('path');
  357. const fs = require('fs');
  358. const release_id = '${{ steps.create_release.outputs.id }}';
  359. for (let file of await fs.readdirSync('./artifact')) {
  360. if (path.extname(file) === '.zip') {
  361. console.log('uploadReleaseAsset', file);
  362. await github.repos.uploadReleaseAsset({
  363. owner: context.repo.owner,
  364. repo: context.repo.repo,
  365. release_id: release_id,
  366. name: file,
  367. data: await fs.readFileSync(`./artifact/${file}`)
  368. });
  369. }
  370. }
  371. # ubuntu-latest-gcc:
  372. # runs-on: ubuntu-latest
  373. #
  374. # strategy:
  375. # matrix:
  376. # build: [Debug, Release]
  377. #
  378. # steps:
  379. # - name: Clone
  380. # uses: actions/checkout@v1
  381. #
  382. # - name: Dependencies
  383. # run: |
  384. # sudo apt-get update
  385. # sudo apt-get install build-essential
  386. # sudo apt-get install cmake
  387. #
  388. # - name: Configure
  389. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  390. #
  391. # - name: Build
  392. # run: |
  393. # make
  394. #
  395. # ubuntu-latest-clang:
  396. # runs-on: ubuntu-latest
  397. #
  398. # strategy:
  399. # matrix:
  400. # build: [Debug, Release]
  401. #
  402. # steps:
  403. # - name: Clone
  404. # uses: actions/checkout@v1
  405. #
  406. # - name: Dependencies
  407. # run: |
  408. # sudo apt-get update
  409. # sudo apt-get install build-essential
  410. # sudo apt-get install cmake
  411. #
  412. # - name: Configure
  413. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  414. #
  415. # - name: Build
  416. # run: |
  417. # make
  418. #
  419. # ubuntu-latest-gcc-sanitized:
  420. # runs-on: ubuntu-latest
  421. #
  422. # strategy:
  423. # matrix:
  424. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  425. #
  426. # steps:
  427. # - name: Clone
  428. # uses: actions/checkout@v1
  429. #
  430. # - name: Dependencies
  431. # run: |
  432. # sudo apt-get update
  433. # sudo apt-get install build-essential
  434. # sudo apt-get install cmake
  435. #
  436. # - name: Configure
  437. # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
  438. #
  439. # - name: Build
  440. # run: |
  441. # make
  442. #
  443. # windows:
  444. # runs-on: windows-latest
  445. #
  446. # strategy:
  447. # matrix:
  448. # build: [Release]
  449. # arch: [Win32, x64]
  450. # include:
  451. # - arch: Win32
  452. # s2arc: x86
  453. # - arch: x64
  454. # s2arc: x64
  455. #
  456. # steps:
  457. # - name: Clone
  458. # uses: actions/checkout@v1
  459. #
  460. # - name: Add msbuild to PATH
  461. # uses: microsoft/setup-msbuild@v1
  462. #
  463. # - name: Configure
  464. # run: >
  465. # cmake -S . -B ./build -A ${{ matrix.arch }}
  466. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  467. #
  468. # - name: Build
  469. # run: |
  470. # cd ./build
  471. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  472. #
  473. # - name: Upload binaries
  474. # uses: actions/upload-artifact@v1
  475. # with:
  476. # name: llama-bin-${{ matrix.arch }}
  477. # path: build/bin/${{ matrix.build }}
  478. #
  479. # windows-blas:
  480. # runs-on: windows-latest
  481. #
  482. # strategy:
  483. # matrix:
  484. # build: [Release]
  485. # arch: [Win32, x64]
  486. # blas: [ON]
  487. # include:
  488. # - arch: Win32
  489. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
  490. # s2arc: x86
  491. # - arch: x64
  492. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
  493. # s2arc: x64
  494. #
  495. # steps:
  496. # - name: Clone
  497. # uses: actions/checkout@v1
  498. #
  499. # - name: Add msbuild to PATH
  500. # uses: microsoft/setup-msbuild@v1
  501. #
  502. # - name: Fetch OpenBLAS
  503. # if: matrix.blas == 'ON'
  504. # run: |
  505. # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
  506. # 7z x blas.zip -oblas -y
  507. # copy blas/include/cblas.h .
  508. # copy blas/include/openblas_config.h .
  509. # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
  510. #
  511. # - name: Configure
  512. # run: >
  513. # cmake -S . -B ./build -A ${{ matrix.arch }}
  514. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  515. # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
  516. # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
  517. #
  518. # - name: Build
  519. # run: |
  520. # cd ./build
  521. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  522. #
  523. # - name: Copy libopenblas.dll
  524. # if: matrix.blas == 'ON'
  525. # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
  526. #
  527. # - name: Upload binaries
  528. # if: matrix.blas == 'ON'
  529. # uses: actions/upload-artifact@v1
  530. # with:
  531. # name: llama-blas-bin-${{ matrix.arch }}
  532. # path: build/bin/${{ matrix.build }}
  533. #
  534. # emscripten:
  535. # runs-on: ubuntu-latest
  536. #
  537. # strategy:
  538. # matrix:
  539. # build: [Release]
  540. #
  541. # steps:
  542. # - name: Clone
  543. # uses: actions/checkout@v1
  544. #
  545. # - name: Dependencies
  546. # run: |
  547. # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  548. # tar -xvf master.tar.gz
  549. # emsdk-master/emsdk update
  550. # emsdk-master/emsdk install latest
  551. # emsdk-master/emsdk activate latest
  552. #
  553. # - name: Configure
  554. # run: echo "tmp"
  555. #
  556. # - name: Build
  557. # run: |
  558. # pushd emsdk-master
  559. # source ./emsdk_env.sh
  560. # popd
  561. # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  562. # make