Fix whisper build

This commit is contained in:
ozanarmagan 2024-01-10 01:26:47 +03:00
parent 3c8b79781d
commit 76181abe2f

View File

@ -7,15 +7,27 @@ filegroup(
srcs = glob(["**"]),
)
config_setting(
name = "with_cuda",
define_values = { "use_cuda": "on" }
)
print("CUDA: " + str(select({
":with_cuda": True,
"//conditions:default": False,
})))
load("@cuda_home_repo//:cuda_home.bzl", "CUDA_HOME")
cmake(
name = "whisper",
cache_entries= select({
":wih_cuda": {
":with_cuda": {
'BUILD_SHARED_LIBS': 'OFF',
'WHISPER_BUILD_EXAMPLES': 'OFF',
'WHISPER_BUILD_TESTS': 'OFF'
'WHISPER_BUILD_CUBLAS': 'ON'
'WHISPER_BUILD_TESTS' : 'OFF',
'WHISPER_CUBLAS': 'ON',
'CMAKE_CUDA_COMPILER': CUDA_HOME + "/bin/nvcc",
},
"//conditions:default": {
'BUILD_SHARED_LIBS': 'OFF',
@ -26,9 +38,10 @@ cmake(
build_args = [
"--", "-j8"
],
lib_source = "//:whisper_srcs",
tags = ["no-sandbox"],
out_static_libs = ["static/libwhisper.a"],
tags=["requires-network","no-sandbox"],
)
cc_library(