Skip to content

Commit

Permalink
fix: correct library name
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev committed May 6, 2024
1 parent 9adc9d9 commit ad799c3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ jobs:
run: |
./install_deps.sh
mkdir build && cd build
cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
cmake -DMAC_ARM64=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
CC=gcc-8 make -j $(sysctl -n hw.ncpu)
ls -la
Expand Down Expand Up @@ -363,7 +363,7 @@ jobs:
run: |
./install_deps.sh
mkdir build && cd build
cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
CC=gcc-8 make -j $(sysctl -n hw.ncp)
ls -la
Expand Down Expand Up @@ -423,7 +423,7 @@ jobs:
mkdir -p nitro/engines/cortex.llamacpp/
ls ./nitro-mac-amd64
lipo -create ./nitro-mac-amd64/nitro ./nitro-mac-arm64/nitro -output ./nitro/nitro
lipo -create ./nitro-mac-amd64/engines/cortex.llamacpp/libengine.dylib ./nitro-mac-arm64/engines/cortex.llamacpp/libengine.dylib -output ./nitro/engines/cortex.llamacpp/libengine.dylib
lipo -create ./nitro-mac-amd64/engines/cortex.llamacpp/libengine.dylib ./nitro-mac-arm64/engines/cortex.llamacpp/libengine.dylib ./nitro/engines/cortex.llamacpp/libengine.dylib
cp ./nitro-mac-arm64/ggml-metal.metal ./nitro/ggml-metal.metal
tar -czvf nitro.tar.gz nitro
Expand Down
68 changes: 39 additions & 29 deletions cortex-cpp/engines/cortex.llamacpp/engine.cmake
Original file line number Diff line number Diff line change
@@ -1,52 +1,62 @@
set(LIBLLAMA_ENGINE_VERSION v1.0)
# cortex.llamacpp release version
set(VERSION 0.1.0)
set(ENGINE_VERSION v${VERSION})

# Download library based on instruction
# TODO(sang) correct library name when cortex.llamacpp CI is done
# MESSAGE("ENGINE_VERSION=" ${ENGINE_VERSION})

# Download library based on instructions
if(UNIX AND NOT APPLE)
if(CUDA_12_0)
set(LIBRARY_NAME linux-amd64-cuda-12-0.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-linux-amd64-cuda-12-0.tar.gz)
elseif(CUDA_11_7)
set(LIBRARY_NAME linux-amd64-cuda-11-7.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-linux-amd64-cuda-11-7.tar.gz)
elseif(LLAMA_VULKAN)
set(LIBRARY_NAME linux-amd64-vulkan.tar.gz)
elseif(DLLAMA_AVX512)
set(LIBRARY_NAME linux-amd64-avx512.tar.gz)
elseif(DLLAMA_AVX2)
set(LIBRARY_NAME linux-amd64-avx2.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-linux-amd64-vulkan.tar.gz)
elseif(LLAMA_AVX512)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-linux-amd64-avx512.tar.gz)
elseif(NOT LLAMA_AVX2)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-linux-amd64-avx.tar.gz)
else()
set(LIBRARY_NAME linux-amd64-avx.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-linux-amd64-avx2.tar.gz)
endif()
elseif(UNIX)
set(LIBRARY_NAME mac-universal.tar.gz)
if(MAC_ARM64)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-mac-arm64.tar.gz)
else()
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-mac-amd64.tar.gz)
endif()
else()
if(CUDA_12_0)
if(DLLAMA_AVX512)
set(LIBRARY_NAME win-amd64-avx512-cuda-12-0.tar.gz)
elseif(DLLAMA_AVX2)
set(LIBRARY_NAME win-amd64-avx2-cuda-12-0.tar.gz)
if(LLAMA_AVX512)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx512-cuda-12-0.tar.gz)
elseif(NOT LLAMA_AVX2)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx-cuda-12-0.tar.gz)
else()
set(LIBRARY_NAME win-amd64-avx-cuda-12-0.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx2-cuda-12-0.tar.gz)
endif()
elseif(CUDA_11_7)
if(DLLAMA_AVX512)
set(LIBRARY_NAME win-amd64-avx512-cuda-11-7.tar.gz)
elseif(DLLAMA_AVX2)
set(LIBRARY_NAME win-amd64-avx2-cuda-11-7.tar.gz)
if(LLAMA_AVX512)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx512-cuda-11-7.tar.gz)
elseif(NOT LLAMA_AVX2)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx-cuda-11-7.tar.gz)
else()
set(LIBRARY_NAME win-amd64-avx-cuda-11-7.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx2-cuda-11-7.tar.gz)
endif()
elseif(LLAMA_VULKAN)
set(LIBRARY_NAME win-amd64-vulkan.tar.gz)
elseif(DLLAMA_AVX512)
set(LIBRARY_NAME win-amd64-avx512.tar.gz)
elseif(DLLAMA_AVX2)
set(LIBRARY_NAME win-amd64-avx2.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-vulkan.tar.gz)
elseif(LLAMA_AVX512)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx512.tar.gz)
elseif(NOT LLAMA_AVX2)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx.tar.gz)
else()
set(LIBRARY_NAME win-amd64-avx.tar.gz)
set(LIBRARY_NAME cortex.llamacpp-${VERSION}-windows-amd64-avx2.tar.gz)
endif()
endif()

set(LIBLLAMA_ENGINE_URL https://github.com/.../releases/download/${LIBLLAMA_ENGINE_VERSION}/${LIBRARY_NAME})

set(LIBLLAMA_ENGINE_URL https://github.com/janhq/cortex.llamacpp/releases/download/${ENGINE_VERSION}/${LIBRARY_NAME})
# MESSAGE("LIBLLAMA_ENGINE_URL="${LIBLLAMA_ENGINE_URL})
# MESSAGE("LIBARRY_NAME=" ${LIBRARY_NAME})

set(LIBLLAMA_ENGINE_PATH ${CMAKE_BINARY_DIR}/engines/${LIBRARY_NAME})

Expand Down

0 comments on commit ad799c3

Please sign in to comment.