Skip to content

Commit 4195dd3

Browse files
ggerganovmglambda
authored andcommitted
release : pack /lib in the packages (ggml-org#11392)
* release : pack /lib and /include in the packages * cmake : put libs in /bin * TMP : push artifacts * Revert "TMP : push artifacts" This reverts commit 4decf2c. * ci : fix HIP cmake compiler options to be on first line * ci : restore the original HIP commands * ci : change ubuntu build from latest to 20.04 * ci : try to fix macos build rpaths * ci : remove obsolete MacOS build * TMP : push artifacts * ci : change back to ubuntu latest * ci : macos set build rpath to "@loader_path" * ci : fix typo * ci : change ubuntu package to 22.04 * Revert "TMP : push artifacts" This reverts commit 537b09e.
1 parent aabcd57 commit 4195dd3

File tree

2 files changed

+53
-49
lines changed

2 files changed

+53
-49
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
mkdir build
5757
cd build
5858
cmake .. \
59+
-DCMAKE_BUILD_RPATH="@loader_path" \
5960
-DLLAMA_FATAL_WARNINGS=ON \
6061
-DLLAMA_CURL=ON \
6162
-DGGML_METAL_USE_BF16=ON \
@@ -120,6 +121,7 @@ jobs:
120121
# Metal is disabled due to intermittent failures with Github runners not having a GPU:
121122
# https://github.com/ggerganov/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
122123
cmake -B build \
124+
-DCMAKE_BUILD_RPATH="@loader_path" \
123125
-DLLAMA_FATAL_WARNINGS=ON \
124126
-DLLAMA_CURL=ON \
125127
-DGGML_METAL=OFF \
@@ -160,8 +162,8 @@ jobs:
160162
path: llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip
161163
name: llama-bin-macos-x64.zip
162164

163-
ubuntu-latest-cmake:
164-
runs-on: ubuntu-latest
165+
ubuntu-cpu-cmake:
166+
runs-on: ubuntu-22.04
165167

166168
steps:
167169
- name: Clone
@@ -181,7 +183,10 @@ jobs:
181183
run: |
182184
mkdir build
183185
cd build
184-
cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_CURL=ON -DGGML_RPC=ON
186+
cmake .. \
187+
-DLLAMA_FATAL_WARNINGS=ON \
188+
-DLLAMA_CURL=ON \
189+
-DGGML_RPC=ON
185190
cmake --build . --config Release -j $(nproc)
186191
187192
- name: Test
@@ -256,7 +261,10 @@ jobs:
256261
run: |
257262
mkdir build
258263
cd build
259-
cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
264+
cmake .. \
265+
-DLLAMA_FATAL_WARNINGS=ON \
266+
-DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
267+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
260268
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
261269
262270
- name: Build (no OpenMP)
@@ -265,7 +273,11 @@ jobs:
265273
run: |
266274
mkdir build
267275
cd build
268-
cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DGGML_OPENMP=OFF
276+
cmake .. \
277+
-DLLAMA_FATAL_WARNINGS=ON \
278+
-DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
279+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
280+
-DGGML_OPENMP=OFF
269281
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
270282
271283
- name: Test
@@ -295,7 +307,8 @@ jobs:
295307
run: |
296308
mkdir build
297309
cd build
298-
cmake -DGGML_RPC=ON ..
310+
cmake .. \
311+
-DGGML_RPC=ON
299312
cmake --build . --config Release -j $(nproc)
300313
301314
- name: Test
@@ -325,7 +338,8 @@ jobs:
325338
run: |
326339
mkdir build
327340
cd build
328-
cmake -DGGML_VULKAN=ON ..
341+
cmake .. \
342+
-DGGML_VULKAN=ON
329343
cmake --build . --config Release -j $(nproc)
330344
331345
- name: Test
@@ -352,13 +366,18 @@ jobs:
352366
- name: Build with native CMake HIP support
353367
id: cmake_build
354368
run: |
355-
cmake -B build -S . -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" -DGGML_HIP=ON
369+
cmake -B build -S . \
370+
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
371+
-DGGML_HIP=ON
356372
cmake --build build --config Release -j $(nproc)
357373
358374
- name: Build with legacy HIP support
359375
id: cmake_build_legacy_hip
360376
run: |
361-
cmake -B build2 -S . -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc -DGGML_HIP=ON
377+
cmake -B build2 -S . \
378+
-DCMAKE_C_COMPILER=hipcc \
379+
-DCMAKE_CXX_COMPILER=hipcc \
380+
-DGGML_HIP=ON
362381
cmake --build build2 --config Release -j $(nproc)
363382
364383
ubuntu-22-cmake-musa:
@@ -379,7 +398,8 @@ jobs:
379398
- name: Build with native CMake MUSA support
380399
id: cmake_build
381400
run: |
382-
cmake -B build -S . -DGGML_MUSA=ON
401+
cmake -B build -S . \
402+
-DGGML_MUSA=ON
383403
cmake --build build --config Release -j $(nproc)
384404
385405
ubuntu-22-cmake-sycl:
@@ -420,7 +440,10 @@ jobs:
420440
source /opt/intel/oneapi/setvars.sh
421441
mkdir build
422442
cd build
423-
cmake -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ..
443+
cmake .. \
444+
-DGGML_SYCL=ON \
445+
-DCMAKE_C_COMPILER=icx \
446+
-DCMAKE_CXX_COMPILER=icpx
424447
cmake --build . --config Release -j $(nproc)
425448
426449
ubuntu-22-cmake-sycl-fp16:
@@ -461,42 +484,13 @@ jobs:
461484
source /opt/intel/oneapi/setvars.sh
462485
mkdir build
463486
cd build
464-
cmake -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON ..
487+
cmake .. \
488+
-DGGML_SYCL=ON \
489+
-DCMAKE_C_COMPILER=icx \
490+
-DCMAKE_CXX_COMPILER=icpx \
491+
-DGGML_SYCL_F16=ON
465492
cmake --build . --config Release -j $(nproc)
466493
467-
# TODO: build with GGML_METAL=OFF because test-backend-ops fail on "Apple Paravirtual device" and I don't know
468-
# how to debug it.
469-
# ref: https://github.com/ggerganov/llama.cpp/actions/runs/7132125951/job/19422043567?pr=4359#step:5:6584
470-
# would be great if we fix these
471-
macOS-latest-cmake:
472-
runs-on: macos-latest
473-
474-
steps:
475-
- name: Clone
476-
id: checkout
477-
uses: actions/checkout@v4
478-
479-
- name: Dependencies
480-
id: depends
481-
continue-on-error: true
482-
run: |
483-
brew update
484-
485-
- name: Build
486-
id: cmake_build
487-
run: |
488-
sysctl -a
489-
mkdir build
490-
cd build
491-
cmake -DLLAMA_FATAL_WARNINGS=ON -DGGML_METAL=OFF ..
492-
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
493-
494-
- name: Test
495-
id: cmake_test
496-
run: |
497-
cd build
498-
ctest -L main --verbose --timeout 900
499-
500494
macOS-latest-cmake-ios:
501495
runs-on: macos-latest
502496

@@ -827,7 +821,13 @@ jobs:
827821
828822
- name: Build with CMake
829823
run: |
830-
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
824+
cmake -S . -B build -G Ninja \
825+
-DCMAKE_BUILD_TYPE=Release \
826+
-DCMAKE_CUDA_ARCHITECTURES=89-real \
827+
-DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
828+
-DLLAMA_FATAL_WARNINGS=ON \
829+
-DGGML_NATIVE=OFF \
830+
-DGGML_CUDA=ON
831831
cmake --build build
832832
833833
windows-2019-cmake-cuda:
@@ -916,7 +916,11 @@ jobs:
916916
shell: cmd
917917
run: |
918918
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
919-
cmake -S . -B build -G "Ninja Multi-Config" -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DGGML_RPC=ON
919+
cmake -S . -B build -G "Ninja Multi-Config" \
920+
-DLLAMA_BUILD_SERVER=ON \
921+
-DGGML_NATIVE=OFF \
922+
-DGGML_CUDA=ON \
923+
-DGGML_RPC=ON
920924
set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
921925
cmake --build build --config Release -j %NINJA_JOBS% -t ggml
922926
cmake --build build --config Release
@@ -1201,8 +1205,7 @@ jobs:
12011205
runs-on: ubuntu-latest
12021206

12031207
needs:
1204-
- ubuntu-latest-cmake
1205-
- macOS-latest-cmake
1208+
- ubuntu-cpu-cmake
12061209
- windows-latest-cmake
12071210
- windows-2019-cmake-cuda
12081211
- windows-latest-cmake-hip-release

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ endif()
1616
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
1717

1818
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
19+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
1920

2021
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
2122
set(LLAMA_STANDALONE ON)

0 commit comments

Comments
 (0)