From ab8c929e20a7eda5db0850d86d697977e960ca1d Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Fri, 7 Jun 2024 08:32:49 -0700 Subject: [PATCH] Add ability to skip oneapi generate This follows the same pattern for cuda and rocm to allow disabling the build even when we detect the dependent libraries --- llm/generate/gen_linux.sh | 2 +- llm/generate/gen_windows.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llm/generate/gen_linux.sh b/llm/generate/gen_linux.sh index c03a5c16..a9df6ff8 100755 --- a/llm/generate/gen_linux.sh +++ b/llm/generate/gen_linux.sh @@ -211,7 +211,7 @@ if [ -z "${ONEAPI_ROOT}" ]; then ONEAPI_ROOT=/opt/intel/oneapi fi -if [ -d "${ONEAPI_ROOT}" ]; then +if [ -z "${OLLAMA_SKIP_ONEAPI_GENERATE}" -a -d "${ONEAPI_ROOT}" ]; then echo "OneAPI libraries detected - building dynamic OneAPI library" init_vars source ${ONEAPI_ROOT}/setvars.sh --force # set up environment variables for oneAPI diff --git a/llm/generate/gen_windows.ps1 b/llm/generate/gen_windows.ps1 index 553c358b..c9d86097 100644 --- a/llm/generate/gen_windows.ps1 +++ b/llm/generate/gen_windows.ps1 @@ -290,7 +290,7 @@ function build_cuda() { } function build_oneapi() { - if ((-not "${env:OLLAMA_SKIP_CUDA_GENERATE}") -and ("${env:ONEAPI_ROOT}")) { + if ((-not "${env:OLLAMA_SKIP_ONEAPI_GENERATE}") -and ("${env:ONEAPI_ROOT}")) { # Get oneAPI version $script:ONEAPI_VERSION = icpx --version $script:ONEAPI_VERSION = [regex]::Match($script:ONEAPI_VERSION, '(?<=oneAPI DPC\+\+/C\+\+ Compiler )(?\d+\.\d+\.\d+)').Value