build.yml 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416
  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/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal']
  13. pull_request:
  14. types: [opened, synchronize, reopened]
  15. paths: ['.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal']
  16. concurrency:
  17. group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  18. cancel-in-progress: true
  19. # Fine-grant permission
  20. # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
  21. permissions:
  22. contents: write # for creating release
  23. env:
  24. BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
  25. GGML_NLOOP: 3
  26. GGML_N_THREADS: 1
  27. LLAMA_LOG_COLORS: 1
  28. LLAMA_LOG_PREFIX: 1
  29. LLAMA_LOG_TIMESTAMPS: 1
  30. jobs:
  31. macOS-latest-cmake-arm64:
  32. runs-on: macos-14
  33. steps:
  34. - name: Clone
  35. id: checkout
  36. uses: actions/checkout@v4
  37. with:
  38. fetch-depth: 0
  39. - name: Dependencies
  40. id: depends
  41. continue-on-error: true
  42. run: |
  43. brew update
  44. - name: Build
  45. id: cmake_build
  46. run: |
  47. sysctl -a
  48. mkdir build
  49. cd build
  50. cmake .. \
  51. -DLLAMA_FATAL_WARNINGS=ON \
  52. -DLLAMA_CURL=ON \
  53. -DGGML_METAL_USE_BF16=ON \
  54. -DGGML_METAL_EMBED_LIBRARY=ON \
  55. -DGGML_RPC=ON \
  56. -DBUILD_SHARED_LIBS=OFF
  57. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  58. - name: Test
  59. id: cmake_test
  60. run: |
  61. cd build
  62. ctest -L 'main|curl' --verbose --timeout 900
  63. - name: Determine tag name
  64. id: tag
  65. shell: bash
  66. run: |
  67. BUILD_NUMBER="$(git rev-list --count HEAD)"
  68. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  69. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  70. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  71. else
  72. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  73. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  74. fi
  75. - name: Pack artifacts
  76. id: pack_artifacts
  77. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  78. run: |
  79. cp LICENSE ./build/bin/
  80. zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip ./build/bin/*
  81. - name: Upload artifacts
  82. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  83. uses: actions/upload-artifact@v4
  84. with:
  85. path: llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip
  86. name: llama-bin-macos-arm64.zip
  87. macOS-latest-cmake-x64:
  88. runs-on: macos-13
  89. steps:
  90. - name: Clone
  91. id: checkout
  92. uses: actions/checkout@v4
  93. with:
  94. fetch-depth: 0
  95. - name: Dependencies
  96. id: depends
  97. continue-on-error: true
  98. run: |
  99. brew update
  100. - name: Build
  101. id: cmake_build
  102. run: |
  103. sysctl -a
  104. # Metal is disabled due to intermittent failures with Github runners not having a GPU:
  105. # https://github.com/ggerganov/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
  106. cmake -B build \
  107. -DLLAMA_FATAL_WARNINGS=ON \
  108. -DLLAMA_CURL=ON \
  109. -DGGML_METAL=OFF \
  110. -DGGML_RPC=ON \
  111. -DBUILD_SHARED_LIBS=OFF
  112. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  113. - name: Test
  114. id: cmake_test
  115. run: |
  116. cd build
  117. ctest -L main --verbose --timeout 900
  118. - name: Determine tag name
  119. id: tag
  120. shell: bash
  121. run: |
  122. BUILD_NUMBER="$(git rev-list --count HEAD)"
  123. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  124. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  125. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  126. else
  127. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  128. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  129. fi
  130. - name: Pack artifacts
  131. id: pack_artifacts
  132. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  133. run: |
  134. cp LICENSE ./build/bin/
  135. zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip ./build/bin/*
  136. - name: Upload artifacts
  137. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  138. uses: actions/upload-artifact@v4
  139. with:
  140. path: llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip
  141. name: llama-bin-macos-x64.zip
  142. ubuntu-latest-cmake:
  143. runs-on: ubuntu-latest
  144. steps:
  145. - name: Clone
  146. id: checkout
  147. uses: actions/checkout@v4
  148. with:
  149. fetch-depth: 0
  150. - name: Dependencies
  151. id: depends
  152. run: |
  153. sudo apt-get update
  154. sudo apt-get install build-essential libcurl4-openssl-dev
  155. - name: Build
  156. id: cmake_build
  157. run: |
  158. mkdir build
  159. cd build
  160. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_CURL=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=OFF
  161. cmake --build . --config Release -j $(nproc)
  162. - name: Test
  163. id: cmake_test
  164. run: |
  165. cd build
  166. ctest -L 'main|curl' --verbose --timeout 900
  167. - name: Test llama2c conversion
  168. id: llama2c_test
  169. run: |
  170. cd build
  171. echo "Fetch tokenizer"
  172. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
  173. echo "Fetch llama2c model"
  174. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
  175. ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
  176. ./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
  177. - name: Determine tag name
  178. id: tag
  179. shell: bash
  180. run: |
  181. BUILD_NUMBER="$(git rev-list --count HEAD)"
  182. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  183. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  184. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  185. else
  186. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  187. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  188. fi
  189. - name: Pack artifacts
  190. id: pack_artifacts
  191. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  192. run: |
  193. cp LICENSE ./build/bin/
  194. zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip ./build/bin/*
  195. - name: Upload artifacts
  196. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  197. uses: actions/upload-artifact@v4
  198. with:
  199. path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip
  200. name: llama-bin-ubuntu-x64.zip
  201. ubuntu-latest-cmake-sanitizer:
  202. runs-on: ubuntu-latest
  203. continue-on-error: true
  204. strategy:
  205. matrix:
  206. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  207. build_type: [Debug, Release]
  208. steps:
  209. - name: Clone
  210. id: checkout
  211. uses: actions/checkout@v4
  212. - name: Dependencies
  213. id: depends
  214. run: |
  215. sudo apt-get update
  216. sudo apt-get install build-essential
  217. - name: Build
  218. id: cmake_build
  219. if: ${{ matrix.sanitizer != 'THREAD' }}
  220. run: |
  221. mkdir build
  222. cd build
  223. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  224. cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
  225. - name: Build (no OpenMP)
  226. id: cmake_build_no_openmp
  227. if: ${{ matrix.sanitizer == 'THREAD' }}
  228. run: |
  229. mkdir build
  230. cd build
  231. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DGGML_OPENMP=OFF
  232. cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
  233. - name: Test
  234. id: cmake_test
  235. run: |
  236. cd build
  237. ctest -L main --verbose --timeout 900
  238. ubuntu-latest-cmake-rpc:
  239. runs-on: ubuntu-latest
  240. continue-on-error: true
  241. steps:
  242. - name: Clone
  243. id: checkout
  244. uses: actions/checkout@v4
  245. - name: Dependencies
  246. id: depends
  247. run: |
  248. sudo apt-get update
  249. sudo apt-get install build-essential
  250. - name: Build
  251. id: cmake_build
  252. run: |
  253. mkdir build
  254. cd build
  255. cmake -DGGML_RPC=ON ..
  256. cmake --build . --config Release -j $(nproc)
  257. - name: Test
  258. id: cmake_test
  259. run: |
  260. cd build
  261. ctest -L main --verbose
  262. ubuntu-22-cmake-vulkan:
  263. runs-on: ubuntu-22.04
  264. steps:
  265. - name: Clone
  266. id: checkout
  267. uses: actions/checkout@v4
  268. - name: Dependencies
  269. id: depends
  270. run: |
  271. wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
  272. sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
  273. sudo apt-get update -y
  274. sudo apt-get install -y build-essential vulkan-sdk
  275. - name: Build
  276. id: cmake_build
  277. run: |
  278. mkdir build
  279. cd build
  280. cmake -DGGML_VULKAN=ON ..
  281. cmake --build . --config Release -j $(nproc)
  282. ubuntu-22-cmake-hip:
  283. runs-on: ubuntu-22.04
  284. container: rocm/dev-ubuntu-22.04:6.0.2
  285. steps:
  286. - name: Clone
  287. id: checkout
  288. uses: actions/checkout@v4
  289. - name: Dependencies
  290. id: depends
  291. run: |
  292. sudo apt-get update
  293. sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev
  294. - name: Build with native CMake HIP support
  295. id: cmake_build
  296. run: |
  297. cmake -B build -S . -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" -DGGML_HIP=ON
  298. cmake --build build --config Release -j $(nproc)
  299. - name: Build with legacy HIP support
  300. id: cmake_build_legacy_hip
  301. run: |
  302. cmake -B build2 -S . -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc -DGGML_HIP=ON
  303. cmake --build build2 --config Release -j $(nproc)
  304. ubuntu-22-cmake-musa:
  305. runs-on: ubuntu-22.04
  306. container: mthreads/musa:rc3.1.0-devel-ubuntu22.04
  307. steps:
  308. - name: Clone
  309. id: checkout
  310. uses: actions/checkout@v4
  311. - name: Dependencies
  312. id: depends
  313. run: |
  314. apt-get update
  315. apt-get install -y build-essential git cmake libcurl4-openssl-dev
  316. - name: Build with native CMake MUSA support
  317. id: cmake_build
  318. run: |
  319. cmake -B build -S . -DGGML_MUSA=ON
  320. cmake --build build --config Release -j $(nproc)
  321. ubuntu-22-cmake-sycl:
  322. runs-on: ubuntu-22.04
  323. continue-on-error: true
  324. steps:
  325. - uses: actions/checkout@v4
  326. - name: add oneAPI to apt
  327. shell: bash
  328. run: |
  329. cd /tmp
  330. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  331. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  332. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  333. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  334. - name: install oneAPI dpcpp compiler
  335. shell: bash
  336. run: |
  337. sudo apt update
  338. sudo apt install intel-oneapi-compiler-dpcpp-cpp
  339. - name: install oneAPI MKL library
  340. shell: bash
  341. run: |
  342. sudo apt install intel-oneapi-mkl-devel
  343. - name: Clone
  344. id: checkout
  345. uses: actions/checkout@v4
  346. - name: Build
  347. id: cmake_build
  348. run: |
  349. source /opt/intel/oneapi/setvars.sh
  350. mkdir build
  351. cd build
  352. cmake -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ..
  353. cmake --build . --config Release -j $(nproc)
  354. ubuntu-22-cmake-sycl-fp16:
  355. runs-on: ubuntu-22.04
  356. continue-on-error: true
  357. steps:
  358. - uses: actions/checkout@v4
  359. - name: add oneAPI to apt
  360. shell: bash
  361. run: |
  362. cd /tmp
  363. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  364. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  365. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  366. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  367. - name: install oneAPI dpcpp compiler
  368. shell: bash
  369. run: |
  370. sudo apt update
  371. sudo apt install intel-oneapi-compiler-dpcpp-cpp
  372. - name: install oneAPI MKL library
  373. shell: bash
  374. run: |
  375. sudo apt install intel-oneapi-mkl-devel
  376. - name: Clone
  377. id: checkout
  378. uses: actions/checkout@v4
  379. - name: Build
  380. id: cmake_build
  381. run: |
  382. source /opt/intel/oneapi/setvars.sh
  383. mkdir build
  384. cd build
  385. cmake -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON ..
  386. cmake --build . --config Release -j $(nproc)
  387. # TODO: build with GGML_METAL=OFF because test-backend-ops fail on "Apple Paravirtual device" and I don't know
  388. # how to debug it.
  389. # ref: https://github.com/ggerganov/llama.cpp/actions/runs/7132125951/job/19422043567?pr=4359#step:5:6584
  390. # would be great if we fix these
  391. macOS-latest-cmake:
  392. runs-on: macos-latest
  393. steps:
  394. - name: Clone
  395. id: checkout
  396. uses: actions/checkout@v4
  397. - name: Dependencies
  398. id: depends
  399. continue-on-error: true
  400. run: |
  401. brew update
  402. - name: Build
  403. id: cmake_build
  404. run: |
  405. sysctl -a
  406. mkdir build
  407. cd build
  408. cmake -DLLAMA_FATAL_WARNINGS=ON -DGGML_METAL=OFF ..
  409. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  410. - name: Test
  411. id: cmake_test
  412. run: |
  413. cd build
  414. ctest -L main --verbose --timeout 900
  415. macOS-latest-cmake-ios:
  416. runs-on: macos-latest
  417. steps:
  418. - name: Clone
  419. id: checkout
  420. uses: actions/checkout@v4
  421. - name: Dependencies
  422. id: depends
  423. continue-on-error: true
  424. run: |
  425. brew update
  426. - name: Build
  427. id: cmake_build
  428. run: |
  429. sysctl -a
  430. mkdir build
  431. cd build
  432. cmake -G Xcode .. \
  433. -DGGML_METAL_USE_BF16=ON \
  434. -DGGML_METAL_EMBED_LIBRARY=ON \
  435. -DLLAMA_BUILD_EXAMPLES=OFF \
  436. -DLLAMA_BUILD_TESTS=OFF \
  437. -DLLAMA_BUILD_SERVER=OFF \
  438. -DCMAKE_SYSTEM_NAME=iOS \
  439. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  440. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  441. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  442. macOS-latest-cmake-tvos:
  443. runs-on: macos-latest
  444. steps:
  445. - name: Clone
  446. id: checkout
  447. uses: actions/checkout@v4
  448. - name: Dependencies
  449. id: depends
  450. continue-on-error: true
  451. run: |
  452. brew update
  453. - name: Build
  454. id: cmake_build
  455. run: |
  456. sysctl -a
  457. mkdir build
  458. cd build
  459. cmake -G Xcode .. \
  460. -DGGML_METAL_USE_BF16=ON \
  461. -DGGML_METAL_EMBED_LIBRARY=ON \
  462. -DLLAMA_BUILD_EXAMPLES=OFF \
  463. -DLLAMA_BUILD_TESTS=OFF \
  464. -DLLAMA_BUILD_SERVER=OFF \
  465. -DCMAKE_SYSTEM_NAME=tvOS \
  466. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  467. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  468. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  469. # TODO: tmp disabled. see for possible re-enable:
  470. # https://github.com/ggerganov/llama.cpp/pull/10525
  471. # macOS-latest-swift:
  472. # runs-on: macos-latest
  473. #
  474. # strategy:
  475. # matrix:
  476. # destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
  477. #
  478. # steps:
  479. # - name: Clone
  480. # id: checkout
  481. # uses: actions/checkout@v4
  482. #
  483. # - name: Dependencies
  484. # id: depends
  485. # continue-on-error: true
  486. # run: |
  487. # brew update
  488. #
  489. # - name: xcodebuild for swift package
  490. # id: xcodebuild
  491. # run: |
  492. # xcodebuild -scheme llama -destination "${{ matrix.destination }}"
  493. #
  494. # - name: Build Swift Example
  495. # id: make_build_swift_example
  496. # run: |
  497. # make swift
  498. windows-msys2:
  499. runs-on: windows-latest
  500. strategy:
  501. fail-fast: false
  502. matrix:
  503. include:
  504. - { sys: UCRT64, env: ucrt-x86_64, build: Release }
  505. - { sys: CLANG64, env: clang-x86_64, build: Release }
  506. steps:
  507. - name: Clone
  508. uses: actions/checkout@v4
  509. - name: Setup ${{ matrix.sys }}
  510. uses: msys2/setup-msys2@v2
  511. with:
  512. update: true
  513. msystem: ${{matrix.sys}}
  514. install: >-
  515. base-devel
  516. mingw-w64-${{matrix.env}}-toolchain
  517. mingw-w64-${{matrix.env}}-cmake
  518. mingw-w64-${{matrix.env}}-openblas
  519. - name: Build using CMake
  520. shell: msys2 {0}
  521. run: |
  522. cmake -B build
  523. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  524. - name: Clean after building using CMake
  525. shell: msys2 {0}
  526. run: |
  527. rm -rf build
  528. - name: Build using CMake w/ OpenBLAS
  529. shell: msys2 {0}
  530. run: |
  531. cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
  532. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  533. windows-latest-cmake:
  534. runs-on: windows-latest
  535. env:
  536. OPENBLAS_VERSION: 0.3.23
  537. SDE_VERSION: 9.33.0-2024-01-07
  538. VULKAN_VERSION: 1.3.261.1
  539. strategy:
  540. matrix:
  541. include:
  542. - build: 'noavx-x64'
  543. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DBUILD_SHARED_LIBS=ON'
  544. - build: 'avx2-x64'
  545. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=ON'
  546. - build: 'avx-x64'
  547. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX2=OFF -DBUILD_SHARED_LIBS=ON'
  548. - build: 'avx512-x64'
  549. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX512=ON -DBUILD_SHARED_LIBS=ON'
  550. - build: 'openblas-x64'
  551. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BLAS=ON -DBUILD_SHARED_LIBS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
  552. - build: 'kompute-x64'
  553. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -DBUILD_SHARED_LIBS=ON'
  554. - build: 'vulkan-x64'
  555. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_VULKAN=ON -DBUILD_SHARED_LIBS=ON'
  556. - build: 'llvm-arm64'
  557. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  558. - build: 'msvc-arm64'
  559. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  560. steps:
  561. - name: Clone
  562. id: checkout
  563. uses: actions/checkout@v4
  564. with:
  565. fetch-depth: 0
  566. - name: Clone Kompute submodule
  567. id: clone_kompute
  568. if: ${{ matrix.build == 'kompute-x64' }}
  569. run: |
  570. git submodule update --init ggml/src/ggml-kompute/kompute
  571. - name: Download OpenBLAS
  572. id: get_openblas
  573. if: ${{ matrix.build == 'openblas-x64' }}
  574. run: |
  575. 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"
  576. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  577. mkdir $env:RUNNER_TEMP/openblas
  578. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  579. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  580. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  581. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  582. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  583. - name: Install Vulkan SDK
  584. id: get_vulkan
  585. if: ${{ matrix.build == 'kompute-x64' || matrix.build == 'vulkan-x64' }}
  586. run: |
  587. curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
  588. & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
  589. Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
  590. Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
  591. - name: Install Ninja
  592. id: install_ninja
  593. run: |
  594. choco install ninja
  595. - name: Build
  596. id: cmake_build
  597. run: |
  598. cmake -S . -B build ${{ matrix.defines }}
  599. cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
  600. - name: Add libopenblas.dll
  601. id: add_libopenblas_dll
  602. if: ${{ matrix.build == 'openblas-x64' }}
  603. run: |
  604. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  605. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  606. - name: Check AVX512F support
  607. id: check_avx512f
  608. if: ${{ matrix.build == 'avx512-x64' }}
  609. continue-on-error: true
  610. run: |
  611. cd build
  612. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  613. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  614. $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
  615. echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
  616. & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
  617. .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
  618. - name: Test
  619. id: cmake_test
  620. # not all machines have native AVX-512
  621. if: ${{ matrix.build != 'msvc-arm64' && matrix.build != 'llvm-arm64' && matrix.build != 'kompute-x64' && matrix.build != 'vulkan-x64' && (matrix.build != 'avx512-x64' || env.HAS_AVX512F == '1') }}
  622. run: |
  623. cd build
  624. ctest -L main -C Release --verbose --timeout 900
  625. - name: Test (Intel SDE)
  626. id: cmake_test_sde
  627. if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
  628. run: |
  629. curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
  630. # for some weird reason windows tar doesn't like sde tar.xz
  631. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
  632. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
  633. $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
  634. cd build
  635. $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
  636. & $sde -future -- ctest -L main -C Release --verbose --timeout 900
  637. - name: Determine tag name
  638. id: tag
  639. shell: bash
  640. run: |
  641. BUILD_NUMBER="$(git rev-list --count HEAD)"
  642. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  643. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  644. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  645. else
  646. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  647. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  648. fi
  649. - name: Pack artifacts
  650. id: pack_artifacts
  651. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  652. run: |
  653. Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
  654. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip .\build\bin\Release\*
  655. - name: Upload artifacts
  656. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  657. uses: actions/upload-artifact@v4
  658. with:
  659. path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip
  660. name: llama-bin-win-${{ matrix.build }}.zip
  661. ubuntu-latest-cmake-cuda:
  662. runs-on: ubuntu-latest
  663. container: nvidia/cuda:12.6.2-devel-ubuntu24.04
  664. steps:
  665. - name: Clone
  666. id: checkout
  667. uses: actions/checkout@v4
  668. - name: Install dependencies
  669. env:
  670. DEBIAN_FRONTEND: noninteractive
  671. run: |
  672. apt update
  673. apt install -y cmake build-essential ninja-build libgomp1 git
  674. - name: Build with CMake
  675. run: |
  676. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=89-real -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined -DLLAMA_FATAL_WARNINGS=ON
  677. cmake --build build
  678. windows-2019-cmake-cuda:
  679. runs-on: windows-2019
  680. strategy:
  681. matrix:
  682. cuda: ['12.4', '11.7']
  683. build: ['cuda']
  684. steps:
  685. - name: Clone
  686. id: checkout
  687. uses: actions/checkout@v4
  688. with:
  689. fetch-depth: 0
  690. - name: Install Cuda Toolkit 11.7
  691. if: ${{ matrix.cuda == '11.7' }}
  692. run: |
  693. mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
  694. choco install unzip -y
  695. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.7.99-archive.zip"
  696. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-11.7.99-archive.zip"
  697. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-11.7.99-archive.zip"
  698. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.7.4.6-archive.zip"
  699. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-11.7.91-archive.zip"
  700. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-11.7.91-archive.zip"
  701. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-11.7.101-archive.zip"
  702. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-11.7.91-archive.zip"
  703. unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
  704. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cudart-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  705. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvcc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  706. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvrtc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  707. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libcublas-windows-x86_64-11.7.4.6-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  708. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvtx-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  709. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\visual_studio_integration-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  710. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvprof-windows-x86_64-11.7.101-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  711. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cccl-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  712. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  713. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  714. echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  715. echo "CUDA_PATH_V11_7=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  716. - name: Install Cuda Toolkit 12.4
  717. if: ${{ matrix.cuda == '12.4' }}
  718. run: |
  719. mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
  720. choco install unzip -y
  721. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-12.4.127-archive.zip"
  722. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-12.4.131-archive.zip"
  723. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-12.4.127-archive.zip"
  724. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-12.4.5.8-archive.zip"
  725. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-12.4.127-archive.zip"
  726. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-12.4.127-archive.zip"
  727. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-12.4.127-archive.zip"
  728. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-12.4.127-archive.zip"
  729. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-12.4.127-archive.zip"
  730. unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
  731. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cudart-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  732. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvcc-windows-x86_64-12.4.131-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  733. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvrtc-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  734. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libcublas-windows-x86_64-12.4.5.8-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  735. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvtx-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  736. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_profiler_api-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  737. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\visual_studio_integration-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  738. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvprof-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  739. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cccl-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  740. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  741. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  742. echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  743. echo "CUDA_PATH_V12_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  744. - name: Install ccache
  745. uses: hendrikmuhs/ccache-action@v1.2
  746. with:
  747. key: ${{ github.job }}-${{ matrix.cuda }}-${{ matrix.build }}
  748. - name: Install Ninja
  749. id: install_ninja
  750. run: |
  751. choco install ninja
  752. - name: Build
  753. id: cmake_build
  754. shell: cmd
  755. run: |
  756. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  757. cmake -S . -B build -G "Ninja Multi-Config" -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=ON -DGGML_RPC=ON
  758. set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
  759. cmake --build build --config Release -j %NINJA_JOBS% -t ggml
  760. cmake --build build --config Release
  761. - name: Determine tag name
  762. id: tag
  763. shell: bash
  764. run: |
  765. BUILD_NUMBER="$(git rev-list --count HEAD)"
  766. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  767. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  768. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  769. else
  770. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  771. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  772. fi
  773. - name: Pack artifacts
  774. id: pack_artifacts
  775. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  776. run: |
  777. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
  778. - name: Upload artifacts
  779. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  780. uses: actions/upload-artifact@v4
  781. with:
  782. path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
  783. name: llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  784. - name: Copy and pack Cuda runtime
  785. if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
  786. run: |
  787. echo "Cuda install location: ${{ env.CUDA_PATH }}"
  788. $dst='.\build\bin\cudart\'
  789. robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
  790. robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
  791. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip $dst\*
  792. - name: Upload Cuda runtime
  793. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  794. uses: actions/upload-artifact@v4
  795. with:
  796. path: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  797. name: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  798. windows-latest-cmake-sycl:
  799. runs-on: windows-latest
  800. defaults:
  801. run:
  802. shell: bash
  803. env:
  804. WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b380d914-366b-4b77-a74a-05e3c38b3514/intel-oneapi-base-toolkit-2025.0.0.882_offline.exe
  805. WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
  806. ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
  807. steps:
  808. - name: Clone
  809. id: checkout
  810. uses: actions/checkout@v4
  811. with:
  812. fetch-depth: 0
  813. - name: Install
  814. run: |
  815. scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
  816. - name: Build
  817. id: cmake_build
  818. run: examples/sycl/win-build-sycl.bat
  819. - name: Determine tag name
  820. id: tag
  821. shell: bash
  822. run: |
  823. BUILD_NUMBER="$(git rev-list --count HEAD)"
  824. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  825. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  826. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  827. else
  828. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  829. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  830. fi
  831. - name: Build the release package
  832. id: pack_artifacts
  833. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  834. run: |
  835. echo "cp oneAPI running time dll files in ${{ env.ONEAPI_ROOT }} to ./build/bin"
  836. cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_sycl_blas.5.dll" ./build/bin
  837. cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.2.dll" ./build/bin
  838. cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.2.dll" ./build/bin
  839. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero.dll" ./build/bin
  840. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_opencl.dll" ./build/bin
  841. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_loader.dll" ./build/bin
  842. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_win_proxy_loader.dll" ./build/bin
  843. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl8.dll" ./build/bin
  844. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin
  845. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin
  846. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin
  847. cp "${{ env.ONEAPI_ROOT }}/dnnl/latest/bin/dnnl.dll" ./build/bin
  848. cp "${{ env.ONEAPI_ROOT }}/tbb/latest/bin/tbb12.dll" ./build/bin
  849. echo "cp oneAPI running time dll files to ./build/bin done"
  850. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip ./build/bin/*
  851. - name: Upload the release package
  852. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  853. uses: actions/upload-artifact@v4
  854. with:
  855. path: llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip
  856. name: llama-bin-win-sycl-x64.zip
  857. windows-latest-cmake-hip:
  858. if: ${{ github.event.inputs.create_release != 'true' }}
  859. runs-on: windows-latest
  860. steps:
  861. - name: Clone
  862. id: checkout
  863. uses: actions/checkout@v4
  864. - name: Install
  865. id: depends
  866. run: |
  867. $ErrorActionPreference = "Stop"
  868. write-host "Downloading AMD HIP SDK Installer"
  869. Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
  870. write-host "Installing AMD HIP SDK"
  871. Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
  872. write-host "Completed AMD HIP SDK installation"
  873. - name: Verify ROCm
  874. id: verify
  875. run: |
  876. & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
  877. - name: Install ccache
  878. uses: hendrikmuhs/ccache-action@v1.2
  879. with:
  880. key: ${{ github.job }}
  881. - name: Build
  882. id: cmake_build
  883. run: |
  884. $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
  885. $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
  886. cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release -DGGML_RPC=ON
  887. cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
  888. windows-latest-cmake-hip-release:
  889. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  890. runs-on: windows-latest
  891. strategy:
  892. matrix:
  893. gpu_target: [gfx1100, gfx1101, gfx1030]
  894. steps:
  895. - name: Clone
  896. id: checkout
  897. uses: actions/checkout@v4
  898. with:
  899. fetch-depth: 0
  900. - name: Install
  901. id: depends
  902. run: |
  903. $ErrorActionPreference = "Stop"
  904. write-host "Downloading AMD HIP SDK Installer"
  905. Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
  906. write-host "Installing AMD HIP SDK"
  907. Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
  908. write-host "Completed AMD HIP SDK installation"
  909. - name: Verify ROCm
  910. id: verify
  911. run: |
  912. & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
  913. - name: Build
  914. id: cmake_build
  915. run: |
  916. $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
  917. $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
  918. cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON
  919. cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
  920. md "build\bin\rocblas\library\"
  921. cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
  922. cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
  923. cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
  924. - name: Determine tag name
  925. id: tag
  926. shell: bash
  927. run: |
  928. BUILD_NUMBER="$(git rev-list --count HEAD)"
  929. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  930. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  931. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  932. else
  933. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  934. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  935. fi
  936. - name: Pack artifacts
  937. id: pack_artifacts
  938. run: |
  939. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
  940. - name: Upload artifacts
  941. uses: actions/upload-artifact@v4
  942. with:
  943. path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
  944. name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
  945. ios-xcode-build:
  946. runs-on: macos-latest
  947. steps:
  948. - name: Checkout code
  949. uses: actions/checkout@v4
  950. - name: Build Xcode project
  951. run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
  952. android-build:
  953. runs-on: ubuntu-latest
  954. steps:
  955. - name: Clone
  956. uses: actions/checkout@v4
  957. - name: Set up JDK
  958. uses: actions/setup-java@v3
  959. with:
  960. java-version: 17
  961. distribution: zulu
  962. - name: Setup Android SDK
  963. uses: android-actions/setup-android@v3
  964. with:
  965. log-accepted-android-sdk-licenses: false
  966. - name: Build
  967. run: |
  968. cd examples/llama.android
  969. ./gradlew build --no-daemon
  970. # freeBSD-latest:
  971. # runs-on: macos-12
  972. # steps:
  973. # - name: Clone
  974. # uses: actions/checkout@v4
  975. #
  976. # - name: Build
  977. # uses: cross-platform-actions/action@v0.19.0
  978. # with:
  979. # operating_system: freebsd
  980. # version: '13.2'
  981. # hypervisor: 'qemu'
  982. # run: |
  983. # sudo pkg update
  984. # sudo pkg install -y gmake automake autoconf pkgconf llvm15 openblas
  985. # gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15 -j `sysctl -n hw.ncpu`
  986. release:
  987. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  988. runs-on: ubuntu-latest
  989. needs:
  990. - ubuntu-latest-cmake
  991. - macOS-latest-cmake
  992. - windows-latest-cmake
  993. - windows-2019-cmake-cuda
  994. - windows-latest-cmake-hip-release
  995. - macOS-latest-cmake-arm64
  996. - macOS-latest-cmake-x64
  997. steps:
  998. - name: Clone
  999. id: checkout
  1000. uses: actions/checkout@v4
  1001. with:
  1002. fetch-depth: 0
  1003. - name: Determine tag name
  1004. id: tag
  1005. shell: bash
  1006. run: |
  1007. BUILD_NUMBER="$(git rev-list --count HEAD)"
  1008. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  1009. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  1010. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  1011. else
  1012. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  1013. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  1014. fi
  1015. - name: Download artifacts
  1016. id: download-artifact
  1017. uses: actions/download-artifact@v4
  1018. with:
  1019. path: ./artifact
  1020. - name: Move artifacts
  1021. id: move_artifacts
  1022. run: mkdir -p ./artifact/release && mv ./artifact/*/*.zip ./artifact/release
  1023. - name: Create release
  1024. id: create_release
  1025. uses: anzz1/action-create-release@v1
  1026. env:
  1027. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1028. with:
  1029. tag_name: ${{ steps.tag.outputs.name }}
  1030. - name: Upload release
  1031. id: upload_release
  1032. uses: actions/github-script@v3
  1033. with:
  1034. github-token: ${{secrets.GITHUB_TOKEN}}
  1035. script: |
  1036. const path = require('path');
  1037. const fs = require('fs');
  1038. const release_id = '${{ steps.create_release.outputs.id }}';
  1039. for (let file of await fs.readdirSync('./artifact/release')) {
  1040. if (path.extname(file) === '.zip') {
  1041. console.log('uploadReleaseAsset', file);
  1042. await github.repos.uploadReleaseAsset({
  1043. owner: context.repo.owner,
  1044. repo: context.repo.repo,
  1045. release_id: release_id,
  1046. name: file,
  1047. data: await fs.readFileSync(`./artifact/release/${file}`)
  1048. });
  1049. }
  1050. }
  1051. # ubuntu-latest-gcc:
  1052. # runs-on: ubuntu-latest
  1053. #
  1054. # strategy:
  1055. # matrix:
  1056. # build: [Debug, Release]
  1057. #
  1058. # steps:
  1059. # - name: Clone
  1060. # uses: actions/checkout@v4
  1061. #
  1062. # - name: Dependencies
  1063. # run: |
  1064. # sudo apt-get update
  1065. # sudo apt-get install build-essential
  1066. # sudo apt-get install cmake
  1067. #
  1068. # - name: Configure
  1069. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1070. #
  1071. # - name: Build
  1072. # run: |
  1073. # make
  1074. #
  1075. # ubuntu-latest-clang:
  1076. # runs-on: ubuntu-latest
  1077. #
  1078. # strategy:
  1079. # matrix:
  1080. # build: [Debug, Release]
  1081. #
  1082. # steps:
  1083. # - name: Clone
  1084. # uses: actions/checkout@v4
  1085. #
  1086. # - name: Dependencies
  1087. # run: |
  1088. # sudo apt-get update
  1089. # sudo apt-get install build-essential
  1090. # sudo apt-get install cmake
  1091. #
  1092. # - name: Configure
  1093. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  1094. #
  1095. # - name: Build
  1096. # run: |
  1097. # make
  1098. #
  1099. # ubuntu-latest-gcc-sanitized:
  1100. # runs-on: ubuntu-latest
  1101. #
  1102. # strategy:
  1103. # matrix:
  1104. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  1105. #
  1106. # steps:
  1107. # - name: Clone
  1108. # uses: actions/checkout@v4
  1109. #
  1110. # - name: Dependencies
  1111. # run: |
  1112. # sudo apt-get update
  1113. # sudo apt-get install build-essential
  1114. # sudo apt-get install cmake
  1115. #
  1116. # - name: Configure
  1117. # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
  1118. #
  1119. # - name: Build
  1120. # run: |
  1121. # make
  1122. #
  1123. # windows:
  1124. # runs-on: windows-latest
  1125. #
  1126. # strategy:
  1127. # matrix:
  1128. # build: [Release]
  1129. # arch: [Win32, x64]
  1130. # include:
  1131. # - arch: Win32
  1132. # s2arc: x86
  1133. # - arch: x64
  1134. # s2arc: x64
  1135. #
  1136. # steps:
  1137. # - name: Clone
  1138. # uses: actions/checkout@v4
  1139. #
  1140. # - name: Add msbuild to PATH
  1141. # uses: microsoft/setup-msbuild@v1
  1142. #
  1143. # - name: Configure
  1144. # run: >
  1145. # cmake -S . -B ./build -A ${{ matrix.arch }}
  1146. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1147. #
  1148. # - name: Build
  1149. # run: |
  1150. # cd ./build
  1151. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  1152. #
  1153. # - name: Upload binaries
  1154. # uses: actions/upload-artifact@v4
  1155. # with:
  1156. # name: llama-bin-${{ matrix.arch }}
  1157. # path: build/bin/${{ matrix.build }}
  1158. #
  1159. # windows-blas:
  1160. # runs-on: windows-latest
  1161. #
  1162. # strategy:
  1163. # matrix:
  1164. # build: [Release]
  1165. # arch: [Win32, x64]
  1166. # blas: [ON]
  1167. # include:
  1168. # - arch: Win32
  1169. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
  1170. # s2arc: x86
  1171. # - arch: x64
  1172. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
  1173. # s2arc: x64
  1174. #
  1175. # steps:
  1176. # - name: Clone
  1177. # uses: actions/checkout@v4
  1178. #
  1179. # - name: Add msbuild to PATH
  1180. # uses: microsoft/setup-msbuild@v1
  1181. #
  1182. # - name: Fetch OpenBLAS
  1183. # if: matrix.blas == 'ON'
  1184. # run: |
  1185. # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
  1186. # 7z x blas.zip -oblas -y
  1187. # copy blas/include/cblas.h .
  1188. # copy blas/include/openblas_config.h .
  1189. # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
  1190. #
  1191. # - name: Configure
  1192. # run: >
  1193. # cmake -S . -B ./build -A ${{ matrix.arch }}
  1194. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1195. # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
  1196. # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
  1197. #
  1198. # - name: Build
  1199. # run: |
  1200. # cd ./build
  1201. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  1202. #
  1203. # - name: Copy libopenblas.dll
  1204. # if: matrix.blas == 'ON'
  1205. # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
  1206. #
  1207. # - name: Upload binaries
  1208. # if: matrix.blas == 'ON'
  1209. # uses: actions/upload-artifact@v4
  1210. # with:
  1211. # name: llama-blas-bin-${{ matrix.arch }}
  1212. # path: build/bin/${{ matrix.build }}
  1213. #
  1214. # emscripten:
  1215. # runs-on: ubuntu-latest
  1216. #
  1217. # strategy:
  1218. # matrix:
  1219. # build: [Release]
  1220. #
  1221. # steps:
  1222. # - name: Clone
  1223. # uses: actions/checkout@v4
  1224. #
  1225. # - name: Dependencies
  1226. # run: |
  1227. # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  1228. # tar -xvf master.tar.gz
  1229. # emsdk-master/emsdk update
  1230. # emsdk-master/emsdk install latest
  1231. # emsdk-master/emsdk activate latest
  1232. #
  1233. # - name: Configure
  1234. # run: echo "tmp"
  1235. #
  1236. # - name: Build
  1237. # run: |
  1238. # pushd emsdk-master
  1239. # source ./emsdk_env.sh
  1240. # popd
  1241. # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1242. # make