#!/bin/bash # This script is intended to run inside the go generate # working directory must be ../llm/llama.cpp set -ex set -o pipefail echo "Starting linux generate script" if [ -z "${CUDACXX}" -a -x /usr/local/cuda/bin/nvcc ] ; then export CUDACXX=/usr/local/cuda/bin/nvcc fi source $(dirname $0)/gen_common.sh init_vars git_module_setup apply_patches if [ -d /usr/local/cuda/lib64/ ] ; then CMAKE_DEFS="-DLLAMA_CUBLAS=on -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off ${CMAKE_DEFS}" else CMAKE_DEFS="-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off ${CMAKE_DEFS}" fi BUILD_DIR="gguf/build/cuda" LIB_DIR="${BUILD_DIR}/lib" mkdir -p ../../dist/ build if [ -d /usr/local/cuda/lib64/ ] ; then pwd ar -M <