From 9c0db4cc83d488a9a51d262fac34aea1f651d347 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 21 Apr 2024 16:13:41 -0400 Subject: [PATCH] Update gen_windows.ps1 Fixed improper env references --- llm/generate/gen_windows.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llm/generate/gen_windows.ps1 b/llm/generate/gen_windows.ps1 index 0b5576cf..5071e09f 100644 --- a/llm/generate/gen_windows.ps1 +++ b/llm/generate/gen_windows.ps1 @@ -243,9 +243,9 @@ if ($null -ne $script:CUDA_LIB_DIR) { init_vars $script:buildDir="../build/windows/${script:ARCH}/cuda$script:CUDA_VARIANT" $script:cmakeDefs += @("-A", "x64", "-DLLAMA_CUDA=ON", "-DLLAMA_AVX=on", "-DLLAMA_AVX2=off", "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR", "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}") - if ($null -ne $script:OLLAMA_CUSTOM_CUDA_DEFS) { - write-host "OLLAMA_CUSTOM_CUDA_DEFS=`"${script:OLLAMA_CUSTOM_CUDA_DEFS}`"" - $script:cmakeDefs +=@("${script:OLLAMA_CUSTOM_CUDA_DEFS}") + if ($null -ne $env:OLLAMA_CUSTOM_CUDA_DEFS) { + write-host "OLLAMA_CUSTOM_CUDA_DEFS=`"${env:OLLAMA_CUSTOM_CUDA_DEFS}`"" + $script:cmakeDefs +=@("${env:OLLAMA_CUSTOM_CUDA_DEFS}") write-host "building custom CUDA GPU" } build @@ -279,9 +279,9 @@ if ($null -ne $env:HIP_PATH) { # We have to clobber the LIB var from the developer shell for clang to work properly $env:LIB="" - if ($null -ne $script:OLLAMA_CUSTOM_ROCM_DEFS) { - write-host "OLLAMA_CUSTOM_ROCM_DEFS=`"${script:OLLAMA_CUSTOM_ROCM_DEFS}`"" - $script:cmakeDefs += @("${script:OLLAMA_CUSTOM_ROCM_DEFS}") + if ($null -ne $env:OLLAMA_CUSTOM_ROCM_DEFS) { + write-host "OLLAMA_CUSTOM_ROCM_DEFS=`"${env:OLLAMA_CUSTOM_ROCM_DEFS}`"" + $script:cmakeDefs += @("${env:OLLAMA_CUSTOM_ROCM_DEFS}") write-host "building custom ROCM GPU" } write-host "Building ROCm"