ollama: add v0.3.9, and cuda variant (#46204)
Signed-off-by: Teague Sterling <teaguesterling@gmail.com> Co-authored-by: brettviren <brettviren@users.noreply.github.com> Co-authored-by: Teague Sterling <teaguesterling@gmail.com>
This commit is contained in:
parent
a835a0ed31
commit
3637c087c5
@ -7,41 +7,44 @@
|
|||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
class Ollama(GoPackage):
|
class Ollama(GoPackage, CudaPackage):
|
||||||
"""Run Llama 2, Code Llama, and other models. Customize and create your own."""
|
"""Run Llama 2, Code Llama, and other models. Customize and create your own."""
|
||||||
|
|
||||||
homepage = "https://ollama.com"
|
homepage = "https://ollama.com"
|
||||||
git = "https://github.com/ollama/ollama.git"
|
git = "https://github.com/ollama/ollama.git"
|
||||||
|
|
||||||
maintainers("teaguesterling")
|
maintainers("teaguesterling", "brettviren")
|
||||||
|
|
||||||
# We're using commit IDs because the `go generate` process will fail for some
|
# A shell script is run by `go generate` which assumes source is in a git
|
||||||
# dependencies that expect to be within a git repo. This is also an issue with
|
# repo. So we must use git VCS and not tarballs and defeat source caching.
|
||||||
# cached downloads, but I don't know how to fix that yet
|
with default_args(submodules=True, no_cache=True):
|
||||||
version("0.1.31", commit="dc011d16b9ff160c0be3829fc39a43054f0315d0", submodules=True)
|
version("0.3.9", commit="a1cef4d0a5f31280ea82b350605775931a6163cb")
|
||||||
|
version("0.1.31", commit="dc011d16b9ff160c0be3829fc39a43054f0315d0")
|
||||||
# This is the last verified non-preview version as of 20240413
|
# This is the last verified non-preview version as of 20240413
|
||||||
version(
|
version("0.1.30", commit="756c2575535641f1b96d94b4214941b90f4c30c7")
|
||||||
"0.1.30",
|
|
||||||
commit="756c2575535641f1b96d94b4214941b90f4c30c7",
|
|
||||||
submodules=True,
|
|
||||||
preferred=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
depends_on("c", type="build") # generated
|
depends_on("c", type="build") # generated
|
||||||
depends_on("cxx", type="build") # generated
|
depends_on("cxx", type="build") # generated
|
||||||
|
|
||||||
license("MIT", checked_by="teaguesterling")
|
license("MIT", checked_by="teaguesterling")
|
||||||
|
|
||||||
depends_on("cmake", type="build")
|
depends_on("cmake@3.24:", type="build")
|
||||||
depends_on("go", type="build")
|
depends_on("go@1.4.0:", type="build")
|
||||||
depends_on("gcc", type="build")
|
|
||||||
depends_on("git", type="build")
|
depends_on("git", type="build")
|
||||||
depends_on("ccache", type="build")
|
|
||||||
|
|
||||||
|
|
||||||
class GoBuilder(spack.build_systems.go.GoBuilder):
|
class GoBuilder(spack.build_systems.go.GoBuilder):
|
||||||
phases = ("generate", "build", "install")
|
phases = ("generate", "build", "install")
|
||||||
|
|
||||||
|
def setup_build_environment(self, env):
|
||||||
|
if self.spec.satisfies("+cuda"):
|
||||||
|
# These variables are consumed by gen_linux.sh which is called by
|
||||||
|
# "go generate".
|
||||||
|
cuda_prefix = self.spec["cuda"].prefix
|
||||||
|
env.set("CUDACXX", cuda_prefix.bin.nvcc)
|
||||||
|
env.set("CUDA_LIB_DIR", cuda_prefix.lib)
|
||||||
|
env.set("CMAKE_CUDA_ARCHITECTURES", spec.variants["cuda_arch"].value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def generate_args(self):
|
def generate_args(self):
|
||||||
"""Arguments for ``go generate``."""
|
"""Arguments for ``go generate``."""
|
||||||
|
Loading…
Reference in New Issue
Block a user