summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/autodock-gpu/package.py
blob: 7ae9eb340425ba815384b74600e9c0f10608e369 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 2013-2023 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)

from spack.package import *


class AutodockGpu(MakefilePackage):
    """AutoDock-GPU: AutoDock for GPUs and other accelerators.
    OpenCL and Cuda accelerated version of AutoDock 4.2.6. It
    leverages its embarrasingly parallelizable LGA by processing
    ligand-receptor poses in parallel over multiple compute units.
    """

    homepage = "https://ccsb.scripps.edu/autodock"
    git = "https://github.com/ccsb-scripps/AutoDock-GPU.git"

    maintainers("RemiLacroix-IDRIS")

    license("LGPL-2.1-or-later")

    version("develop", branch="develop")

    variant(
        "device",
        default="cuda",
        description="Acceletor runtime",
        values=("cuda", "oclgpu"),
        multi=False,
    )
    variant("overlap", default=False, description="Overlap CPU and GPU operations")

    depends_on("cuda")

    @property
    def build_targets(self):
        spec = self.spec
        return [
            "DEVICE={0}".format(spec.variants["device"].value.upper()),
            "GPU_INCLUDE_PATH={0}".format(spec["cuda"].prefix.include),
            "GPU_LIBRARY_PATH={0}".format(spec["cuda"].libs.directories[0]),
            "OVERLAP={0}".format("ON" if "+overlap" in spec else "OFF"),
        ]

    def install(self, spec, prefix):
        ignore_gitkeep = lambda p: p.endswith(".gitkeep")
        install_tree("bin", prefix.bin, ignore=ignore_gitkeep)