示例#1
0
class PyAtldld(PythonPackage):
    """Search, download, and prepare brain atlas data."""

    homepage = "atlas-download-tools.rtfd.io"
    git = "https://github.com/BlueBrain/Atlas-Download-Tools.git"

    maintainers = ["EmilieDel", "jankrepl", "Stannislav"]

    version("0.3.2", tag="v0.3.2")
    version("0.3.1", tag="v0.3.1")
    version("0.3.0", tag="v0.3.0")
    version("0.2.2", tag="v0.2.2")

    # Build dependencies
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("py-setuptools", type="build")
    depends_on("py-setuptools-scm", type="build")

    depends_on("py-appdirs", when="@0.3.1:", type=("build", "run"))
    depends_on("py-click@8:", when="@0.3.0:", type=("build", "run"))
    depends_on("py-dataclasses", when="@0.3.1: ^[email protected]", type=("build", "run"))
    depends_on("py-matplotlib", type=("build", "run"))
    depends_on("py-numpy", type=("build", "run"))
    depends_on("py-opencv-python", type=("build", "run"))
    depends_on("py-pandas", type=("build", "run"))
    depends_on("py-pillow", when="@0.3.1:", type=("build", "run"))
    depends_on("py-requests", type=("build", "run"))
    depends_on("py-responses", type=("build", "run"))
    depends_on("py-scikit-image", type=("build", "run"))
示例#2
0
class ClangTools(Package):
    """Copy binaries like clang-format out of an LLVM installation and into a
    clean directory for which a module can safely be generated."""

    has_code = False
    homepage = LLVM.homepage

    # Add a clang-format version for every LLVM version
    for llvm_ver in LLVM.versions:
        clang_tools_ver = Version(str(llvm_ver) + "p2")
        version(clang_tools_ver)
        depends_on(
            "llvm@{}".format(llvm_ver), when="@{}".format(clang_tools_ver), type="build"
        )

    def install(self, spec, prefix):
        for utility in (
            ("bin", "clang-format"),
            ("bin", "clang-tidy"),
            ("bin", "git-clang-format"),
            ("share", "clang", "clang-format-diff.py"),
        ):
            source_dir = spec["llvm"].prefix
            destination_dir = spec.prefix
            for component in utility[:-1]:
                source_dir = source_dir.join(component)
                destination_dir = destination_dir.join(component)
            mkdirp(destination_dir)
            install(source_dir.join(utility[-1]), destination_dir.join(utility[-1]))
示例#3
0
class X264(AutotoolsPackage):
    """Software library and application for encoding video streams"""

    homepage = "https://www.videolan.org/developers/x264.html"
    git = "https://code.videolan.org/videolan/x264.git"

    version("20210613", commit="5db6aa6cab1b146e07b60cc1736a01f21da01154")

    depends_on("nasm")

    def configure_args(self):
        return ["--enable-shared", "--enable-pic"]
示例#4
0
class PyAtlannot(PythonPackage):
    """Alignment of brain atlas annotations."""

    homepage = "https://atlas-annotation.rtfd.io"
    maintainers = ["EmilieDel", "Stannislav"]

    version(
        "0.1.2",
        url=
        "https://files.pythonhosted.org/packages/08/b9/6edff732ad711e600b91d32052604987b744f054c049739df73c07ef0232/atlannot-0.1.2.tar.gz",
        sha256=
        "145dac874752d5e5d093b977aa04798916daf31d1e942cc64d059175deea27df",
    )
    version(
        "0.1.1",
        tag="v0.1.1",
        git="[email protected]:project/proj101/atlas_annotation.git",
    )

    # Setup requirements
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("py-setuptools", type="build")
    depends_on("py-setuptools-scm", type="build")

    # Installation requirements
    depends_on("[email protected]", type=("build", "run"))
    depends_on("[email protected]", type=("build", "run"))
    depends_on("py-matplotlib", type=("build", "run"))
    depends_on("py-numpy", type=("build", "run"))
    depends_on("py-pynrrd", type=("build", "run"))

    # From the "interactive" extra
    depends_on("py-ipython", type=("build", "run"))
    depends_on("py-ipywidgets", type=("build", "run"))
    depends_on("py-nibabel", type=("build", "run"))
    depends_on("py-scipy", type=("build", "run"))
    depends_on("py-toml", type=("build", "run"))
    depends_on("py-tqdm", type=("build", "run"))
示例#5
0
class PyOpencvPython(PythonPackage):
    """Pre-built CPU-only OpenCV packages for Python."""

    homepage = "https://pypi.org/project/opencv-python"
    url = "https://files.pythonhosted.org/packages/01/9b/be08992293fb21faf35ab98e06924d7407fcfca89d89c5de65442631556a/opencv-python-4.5.3.56.tar.gz"

    version('4.5.3.56',
            sha256=
            '3c001d3feec7f3140f1fb78dfc52ca28122db8240826882d175a208a89d2731b')

    depends_on('[email protected]:', type=('build', 'run'))
    depends_on('cmake', type='build')
    depends_on('py-numpy', type='build')
    depends_on('py-setuptools', type='build')
    depends_on('py-scikit-build', type='build')
示例#6
0
class PyMizani(PythonPackage):
    """Mizani is a scales package for graphics. It is based on Hadley Wickham's
    Scales package."""

    pypi = "mizani/mizani-0.7.3.tar.gz"

    version(
        "0.7.3",
        sha256=
        "f521300bd29ca918fcd629bc8ab50fa04e41bdbe00f6bcf74055d3c6273770a4",
    )

    depends_on('[email protected]:', type=('build', 'run'))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("py-numpy", type=("build", "run"))
    depends_on("py-palettable", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("py-setuptools", type="build")
示例#7
0
文件: package.py 项目: vmiheer/spack
class PyPlotnine(PythonPackage):
    """plotnine is an implementation of a grammar of graphics in Python, it is
    based on ggplot2. The grammar allows users to compose plots by explicitly
    mapping data to the visual objects that make up the plot."""

    pypi = "plotnine/plotnine-0.8.0.tar.gz"

    version(
        "0.8.0",
        sha256="39de59edcc28106761b65238647d0b1f6212ea7f3a78f8be0b846616db969276",
    )

    depends_on('[email protected]:', type=('build', 'run'))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("[email protected]:", type=("build", "run"))
    depends_on("py-setuptools", type="build")
    depends_on("[email protected]:", type=("build", "run"))
示例#8
0
class PyAtlinter(PythonPackage):
    """Interpolation of section images."""

    homepage = "https://atlas-interpolation.rtfd.io"
    git = "[email protected]:project/proj101/atlas_interpolation.git"

    maintainers = ["EmilieDel", "Stannislav"]

    version(
        "0.2.3",
        url=
        "https://files.pythonhosted.org/packages/57/d3/4cdfaacccff677b32687cbcfd689727bc7b3a8f4485401aa3eca157e5aaf/atlinter-0.2.3.tar.gz",
        sha256=
        "67f102b70bc7eeb450da8af3c19df38610dd081a025f9c04e8f5266d2d0cc6e3",
    )
    version("0.2.2", tag="v0.2.2")
    version("0.2.1", tag="v0.2.1")
    version("0.2.0", tag="v0.2.0")
    version("0.1.1", tag="v0.1.1")
    version("0.1.0", tag="v0.1.0")

    variant("cuda", default=False, description="Enable CUDA support")

    depends_on("[email protected]:", type=("build", "run"))
    depends_on("py-setuptools", type="build")
    depends_on("py-setuptools-scm", type="build")

    # opencv leads to problems:
    # fatal error: opencv2/opencv.hpp: No such file or directory
    depends_on("mxnet+cuda~opencv", when="@0.1.1:+cuda", type=("build", "run"))
    depends_on("mxnet~cuda~opencv", when="@0.1.1:~cuda", type=("build", "run"))
    depends_on("py-atlannot", when="@0.2.2:", type=("build", "run"))
    depends_on("[email protected]", type=("build", "run"))
    depends_on("py-numpy", type=("build", "run"))
    depends_on("py-pillow", type=("build", "run"))
    depends_on("py-pytorch-fid", type=("build", "run"))
    depends_on("py-pynrrd", when="@0.2.2:", type=("build", "run"))
    depends_on("py-pyyaml", when="@0.1.1:", type=("build", "run"))
    depends_on("py-requests", type=("build", "run"))
    depends_on("py-scikit-image", when="@0.2.2:", type=("build", "run"))
    depends_on("py-scipy", when="@0.1.1:", type=("build", "run"))
    depends_on("py-torch+cuda", when="+cuda", type=("build", "run"))
    depends_on("py-torch~cuda~cudnn~nccl", when="~cuda", type=("build", "run"))
    depends_on("py-torchvision", type=("build", "run"))
示例#9
0
class Genie(Package):  # Genie doesn"t use Autotools
    """Genie is a neutrino Monte Carlo Generator."""

    homepage = "https://www.genie-mc.org"
    url = "https://github.com/GENIE-MC/Generator/archive/R-3_00_06.tar.gz"
    git = "https://github.com/GENIE-MC/Generator.git"

    tags = ["neutrino", "hep"]

    maintainers = [
        # maintainer of this recipe, not affliated with the GENIE collaboration
        "davehadley",
    ]

    version("master", branch="master")
    version("3.0.6",
            sha256=
            "ab56ea85d0c1d09029254365bfe75a1427effa717389753b9e0c1b6c2eaa5eaf")
    version("3.0.4",
            sha256=
            "53f034618fef9f7f0e17d1c4ed72743e4bba590e824b795177a1a8a8486c861e")
    version("3.0.2",
            sha256=
            "34d6c37017b2387c781aea7bc727a0aac0ef45d6b3f3982cc6f3fc82493f65c3")
    version("3.0.0",
            sha256=
            "3953c7d9f1f832dd32dfbc0b9260be59431206c204aec6ab0aa68c01176f2ae6")
    version("2.12.10",
            sha256=
            "c8762db3dcc490f80f8a61268f5b964d4d35b80134b622e89fe2307a836f2a0b")
    version("2.12.8",
            sha256=
            "7ca169a8d9eda7267d28b76b2f3110552852f8eeae263a03cd5139caacebb4ea")
    version("2.12.6",
            sha256=
            "3b450c609875459798ec98e12cf671cc971cbb13345af6d75bd6278d422f3309")
    version("2.12.4",
            sha256=
            "19a4a1633b0847a9f16a44e0c74b9c224ca3bb93975aecf108603c22e807517b")
    version("2.12.2",
            sha256=
            "cbdc45a739878940dadcaaed575b5cad6b5e7035f29605045b1ca557e6faa6d1")
    version("2.12.0",
            sha256=
            "d2b01c80f38d269cb0296b3f2932798ef3f1d51bd130e81274fbfeeb381fac6b")
    version("2.11.2",
            sha256=
            "0f4c25d8ceb7513553671643c9cdac5aa98c40fc8594a5ecb25c077c6b36166e")
    version("2.11.0",
            sha256=
            "1ebe0eb65d797595413632f1cec1cb2621cb8e8d0384a2843799724a79b1d80c")
    version("2.10.10",
            sha256=
            "1dfaadcf1bbaf6e164b612f410c4399301e63497ad6a4891706b1787ac11a7a1")
    version("2.10.8",
            sha256=
            "4f6f5af2062e7c505b76e70547ac2ae304a9790c3e9b9592818d8aebeebc8398")
    version("2.10.6",
            sha256=
            "d00b4288c886f81459fb2967e539f30315d4385f82d1d3f4330298d313f9a176")
    version("2.10.4",
            sha256=
            "df909bf7e1a789ca01794995687da2af803769f0823273a4a3a31678d6d5b0f1")
    version("2.10.2",
            sha256=
            "6abe4e0cdb5e8f5beddf0ccdbebc94c175a9f72592b1cbbffe01b88ee3972bf9")
    version("2.10.0",
            sha256=
            "17bda900c996b6f4f10a7f6a3be94e56c3b8dcdeb2ef8865ca7f20c5fe725291")
    version("2.9.0",
            sha256=
            "8229beb73f65f5af86a77bf141acfbe4a8b68cba9d797aae083a929906f6f2a2")
    version("2.8.6",
            sha256=
            "310dc8e0d17a65e6b9773e398250703a3a6f94ceafe94f599ae0f7b3fecf7e6c")

    depends_on("root+pythia6")
    depends_on("pythia6")
    depends_on("lhapdf", when="@3:")
    depends_on("lhapdf5", when="@:2")
    depends_on("log4cpp")
    depends_on("libxml2")
    depends_on("gsl")

    # GENIE does not actually require cmake, but root does.
    # Spack's concretizer fails with "unsatisfiable constraint" if we don't add this.
    depends_on("cmake@3:")

    # GENIE Makefile's think that the spack compiler is invalid.
    # Disables this check.
    patch("genie_disable_gopt_with_compiler_check.patch",
          level=0,
          when="@2.11:")

    # Flags for GENIE"s optional but disabled by default features
    variant(
        "atmo",
        default=False,
        description="Enable GENIE Atmospheric neutrino event generation app")
    variant(
        "fnal",
        default=False,
        description="Enables FNAL experiment-specific event generation app")
    variant("nucleondecay",
            default=False,
            description="Enable GENIE Nucleon decay event generation app")
    variant("masterclass",
            default=False,
            description="Enable GENIE neutrino masterclass app")
    variant("t2k",
            default=False,
            description="Enable T2K-specific generation app")
    variant(
        "vleextension",
        default=False,
        description="Enable GENIE very low energy (1 MeV - 100 MeV) extension")

    phases = ["configure", "build", "install"]

    def url_for_version(self, version):
        url = "https://github.com/GENIE-MC/Generator/archive/R-{0}.tar.gz"
        if version >= Version(3):
            return url.format("{0}_{1:02d}_{2:02d}".format(*version))
        else:
            return url.format(version.underscored)

    def setup_build_environment(self, env):
        env.set("GENIE", self.stage.source_path)
        return super(Genie, self).setup_build_environment(env)

    def setup_run_environment(self, env):
        env.set("GENIE", self.prefix)
        return super(Genie, self).setup_run_environment(env)

    def configure(self, spec, prefix):
        configure = Executable("./configure")
        args = self._configure_args(spec, prefix)
        configure(*args)

    def build(self, spec, prefix):
        # parallel build is not supported on GENIE 2
        self._make(parallel=spec.satisfies("@3:"))

    def install(self, spec, prefix):
        # GENIE make install does not support parallel jobs
        self._make("install", parallel=False)
        # GENIE requires these files to be present at runtime, but doesn"t install them
        # so we must install them ourselves
        # install_tree function is injected into scope by spack build_environment.py
        install_tree("config", os.sep.join((prefix, "config")))
        install_tree("data", os.sep.join((prefix, "data")))

    def _configure_args(self, spec, prefix):
        args = [
            "--prefix=" + prefix,
            "--with-compiler=" + os.environ["CC"],
            "--with-libxml2-inc={0}{1}libxml2".format(
                spec["libxml2"].prefix.include, os.sep),
            "--with-libxml2-lib=" + spec["libxml2"].prefix.lib,
            "--with-log4cpp-inc=" + spec["log4cpp"].prefix.include,
            "--with-log4cpp-lib=" + spec["log4cpp"].prefix.lib,
            "--with-pythia6-lib=" + spec["pythia6"].prefix.lib,
        ]
        if self.spec.satisfies("@:2"):
            args += [
                "--enable-lhapdf",
                "--with-lhapdf-inc=" + spec["lhapdf5"].prefix.include,
                "--with-lhapdf-lib=" + spec["lhapdf5"].prefix.lib,
                # must be enabled or some GENIE 2 versions fail to link
                # this option was removed in GENIE 3
                "--enable-rwght",
            ]
        else:
            args += [
                "--enable-lhapdf6",
                "--with-lhapdf6-inc=" + spec["lhapdf"].prefix.include,
                "--with-lhapdf6-lib=" + spec["lhapdf"].prefix.lib,
            ]
        if "+vleextension" in self.spec:
            args += ["--enable-vle-extension"]
        if "+t2k" in self.spec:
            args += ["--enable-t2k"]
        if "+fnal" in self.spec:
            args += ["--enable-fnal"]
        if "+atmo" in self.spec:
            args += ["--enable-atmo"]
        if "+nucleondecay" in self.spec:
            args += ["--enable-nucleon-decay"]
        if "+masterclass" in self.spec:
            args += ["--enable-masterclass"]
        return args

    def _make(self, *args, **kwargs):
        parallel = kwargs.get("parallel", False)
        args = list(self._make_args) + list(args)
        # make function is injected into scope by spack build_environment.py
        make(*args, parallel=parallel)

    @property
    def _make_args(self):
        return [
            "CC=c++",
            "CXX=c++",
            "LD=c++",
        ]
示例#10
0
class Oasis(MakefilePackage):
    """The OASIS coupler is a software allowing synchronized exchanges
    of coupling information between numerical codes representing
    different components of the climate system."""

    homepage = "https://portal.enes.org/oasis"
    git = 'https://gitlab.com/cerfacs/oasis3-mct.git'
    maintainers = ['leclairm']

    version('master', branch='OASIS3-MCT_4.0')
    version('dev-build', branch='OASIS3-MCT_4.0')

    depends_on('mpi', type=('build', 'link', 'run'))
    depends_on('netcdf-fortran', type=('build', 'link', 'run'))

    build_directory = 'util/make_dir'

    makefile_file = 'TopMakefileOasis3'

    # Relative path where the built libraries are stored (corresponds
    # to the absolute path called ARCHDIR in the Makefile)
    rel_ARCHDIR = 'spack-build'

    def setup_build_environment(self, env):

        CHAN = 'MPI1'
        env.set('CHAN', CHAN)
        env.set('F90', self.spec['mpi'].mpifc)
        env.set('f90', self.spec['mpi'].mpifc)
        env.set('F', self.spec['mpi'].mpifc)
        env.set('f', self.spec['mpi'].mpifc)
        env.set('MAKE', 'gmake')

        LIBBUILD = os.path.join('../..', self.rel_ARCHDIR, 'build/lib')
        INCPSMILE = '-I{LIBBUILD}/psmile.{CHAN} -I{LIBBUILD}/mct -I{LIBBUILD}/scrip'.format(
            LIBBUILD=LIBBUILD, CHAN=CHAN)

        CPPDEF = '-Duse_comm_{CHAN} -D__VERBOSE -DTREAT_OVERLAY -D__NO_16BYTE_REALS'.format(
            CHAN=CHAN)
        env.set('CPPDEF', CPPDEF)

        FFLAGS = '-O2 {INCPSMILE} {CPPDEF}'.format(CPPDEF=CPPDEF,
                                                   INCPSMILE=INCPSMILE)
        env.set('F90FLAGS', FFLAGS)
        env.set('f90FLAGS', FFLAGS)
        env.set('FFLAGS', FFLAGS)
        env.set('fFLAGS', FFLAGS)
        env.set('CCFLAGS', FFLAGS)

    def edit(self, spec, prefix):

        COUPLE = os.getcwd()
        ARCHDIR = os.path.join(COUPLE, self.rel_ARCHDIR)
        with working_dir(self.build_directory):
            makefile = FileFilter(self.makefile_file)
            makefile.filter(
                'include make.inc',
                'export COUPLE = {}\nexport ARCHDIR = {}'.format(
                    COUPLE, ARCHDIR))
            makefile.filter('\$\(modifmakefile\)\s\;\s', '')

    def patch(self):

        # Remove old directives for Fujitsu comilers. Already fixed in MCT [1] but not merged in OASIS yet
        # [1] https://github.com/MCSclimate/MCT/commit/dcb4fa4527bbc51729fb67fbc2e0179bfcb4baa2
        with working_dir('lib/mct/mct'):
            m_AttrVect = FileFilter('m_AttrVect.F90')
            m_AttrVect.filter('\s*\!DIR\$ COLLAPSE', '')

    def build(self, spec, prefix):

        with working_dir(self.build_directory):
            make('-f', self.makefile_file)

    def install(self, spec, prefix):

        with working_dir(os.path.join(self.rel_ARCHDIR, 'lib')):
            os.symlink('libmct.a', 'libmct_oasis.a')
            os.symlink('libmpeu.a', 'libmpeu_oasis.a')

        install_tree(self.rel_ARCHDIR, prefix)
示例#11
0
class Nuwro(MakefilePackage):
    """NuWro is a Monte Carlo neutrino event generator."""

    homepage = "https://nuwro.github.io/user-guide/"
    url = "https://github.com/NuWro/nuwro/archive/refs/tags/nuwro_19.02.2.tar.gz"
    git = "https://github.com/NuWro/nuwro"

    maintainers = [
        # maintainer of this recipe, not affliated with the NuWro collaboration
        "davehadley"
    ]

    version(
        "19.2.2",
        sha256=
        "e6edf0cd3d9ae22261193ec9ee56f6a0bee5fbeae684f92361f091bb7f1fb055",
    )
    version(
        "19.2.1",
        sha256=
        "66ec5ce8be747e821edf2e784fe579226c73301a886b0805410d929b61a90371",
    )
    version(
        "19.2.0",
        sha256=
        "6b5dd5419fc43c3df9fc3c976180fffe24e48478502acdb86b4af8cc0f55e94f",
    )
    version(
        "18.2.1",
        sha256=
        "4d3324207e1ff7192905b80dc0d422028ac06f1681c84430d8c33f6626a09c67",
    )
    version(
        "18.2.0",
        sha256=
        "f98f5073ed3b1d21604ffd3ec1e2ca907a15aacd69c8e813526e3d2fd40b2ebc",
    )
    version(
        "17.9.0",
        sha256=
        "350fa6043fa39253afad30bbcb655bde7d85b641843344aa978faca32535456d",
    )
    version(
        "17.1.1",
        sha256=
        "5071d9d1495b780060215729bf7c52e1db0f26a213a1c25b5f7c99d43af97f65",
    )
    version(
        "17.1.0",
        sha256=
        "bbbf73bc3c7436fb2fd28c7df538b4e20ad3f2f90a6c1c72f739f14a2ab8cf64",
    )

    depends_on("root+pythia6")

    # nuwro does not actually require cmake, but root does.
    # Spack's concretizer fails with "unsatisfiable constraint" if we don't add this.
    depends_on("cmake@3:")

    # Missing include directive in nuwro2rootracker.cc causes compilation failure with
    # some versions of ROOT
    patch("nuwro2rootracker_missing_include.patch", level=0)

    def url_for_version(self, version):
        return ("https://github.com/NuWro/nuwro/archive/refs/tags/"
                "nuwro_{0}.{1:02d}.{2}.tar.gz".format(version[0], version[1],
                                                      version[2]))

    @property
    def build_targets(self):
        return [
            "CC=c++",
            "CXX=c++",
            "LD=c++",
            "FC=fc",
            "VERSION=%s" % self.spec.version,
        ]

    def install(self, spec, prefix):
        # nuwro has no install stage,
        # so we must install its binaries ourselves
        # install_tree function is injected into scope by spack build_environment.py
        install_tree("bin", prefix.bin)  # noqa
        install_tree("data", os.sep.join((prefix, "data")))  # noqa

    def setup_run_environment(self, env):
        # nuwro uses this environment variable to find the data directory
        env.set("NUWRO", self.prefix)
        return super(Nuwro, self).setup_run_environment(env)