diff options
author | Teague Sterling <teaguesterling@users.noreply.github.com> | 2024-04-15 13:13:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 13:13:07 -0700 |
commit | e40676e901e7ddaf9f47a0be561e2a4435697d80 (patch) | |
tree | ab25562afc248559483db9ef6230fb490ffeb96f /var | |
parent | 4ddb07e94fe85ca3841fc95f53a3eff5eb2d0152 (diff) | |
download | spack-e40676e901e7ddaf9f47a0be561e2a4435697d80.tar.gz spack-e40676e901e7ddaf9f47a0be561e2a4435697d80.tar.bz2 spack-e40676e901e7ddaf9f47a0be561e2a4435697d80.tar.xz spack-e40676e901e7ddaf9f47a0be561e2a4435697d80.zip |
Add ollama package (#43655)
* Added package to build Ollama
* Update package.py
Add license and documentation
* [@spackbot] updating style on behalf of teaguesterling
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/ollama/package.py | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/ollama/package.py b/var/spack/repos/builtin/packages/ollama/package.py new file mode 100644 index 0000000000..b0839efa65 --- /dev/null +++ b/var/spack/repos/builtin/packages/ollama/package.py @@ -0,0 +1,54 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import spack.build_systems.go +from spack.package import * + + +class Ollama(GoPackage): + """Run Llama 2, Code Llama, and other models. Customize and create your own.""" + + homepage = "https://ollama.com" + git = "https://github.com/ollama/ollama.git" + + maintainers("teaguesterling") + + # We're using commit IDs because the `go generate` process will fail for some + # dependencies that expect to be within a git repo. This is also an issue with + # cached downloads, but I don't know how to fix that yet + version("0.1.31", commit="dc011d16b9ff160c0be3829fc39a43054f0315d0", submodules=True) + # This is the last verified non-preview version as of 20240413 + version( + "0.1.30", + commit="756c2575535641f1b96d94b4214941b90f4c30c7", + submodules=True, + preferred=True, + ) + + license("MIT", checked_by="teaguesterling") + + depends_on("cmake", type="build") + depends_on("go", type="build") + depends_on("gcc", type="build") + depends_on("git", type="build") + depends_on("ccache", type="build") + + +class GoBuilder(spack.build_systems.go.GoBuilder): + phases = ("generate", "build", "install") + + @property + def generate_args(self): + """Arguments for ``go generate``.""" + return ["./..."] + + def generate(self, pkg, spec, prefix): + """Runs ``go generate`` in the source directory""" + import inspect + + import llnl.util.filesystem as fs + + with fs.working_dir(self.build_directory): + inspect.getmodule(pkg).go("generate", *self.generate_args) |