diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/conduit/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/conduit/package.py | 122 |
1 files changed, 66 insertions, 56 deletions
diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index 6793a391c3..d2820b92ec 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -1,27 +1,8 @@ -############################################################################## -# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. +# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. # -# This file is part of Spack. -# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://github.com/spack/spack -# Please also see the NOTICE and LICENSE files for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License (as -# published by the Free Software Foundation) version 2.1, February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + from spack import * import socket @@ -46,8 +27,11 @@ class Conduit(Package): coupling between packages in-core, serialization, and I/O tasks.""" homepage = "http://software.llnl.gov/conduit" - url = "https://github.com/LLNL/conduit/releases/download/v0.3.0/conduit-v0.3.0-src-with-blt.tar.gz" + url = "https://github.com/LLNL/conduit/releases/download/v0.3.0/conduit-v0.3.0-src-with-blt.tar.gz" + git = "https://github.com/LLNL/conduit.git" + version('master', branch='master', submodules=True) + version('0.3.1', 'b98d1476199a46bde197220cd9cde042') version('0.3.0', '6396f1d1ca16594d7c66d4535d4f898e') # note: checksums on github automatic release source tars changed ~9/17 version('0.2.1', 'ed7358af3463ba03f07eddd6a6e626ff') @@ -55,11 +39,6 @@ class Conduit(Package): maintainers = ['cyrush'] - version('master', - git='https://github.com/LLNL/conduit.git', - branch="master", - submodules=True) - ########################################################################### # package variants ########################################################################### @@ -79,6 +58,9 @@ class Conduit(Package): # variants for dev-tools (docs, etc) variant("doc", default=False, description="Build Conduit's documentation") + # doxygen support is wip, since doxygen has several dependencies + # we want folks to explicitly opt in to building doxygen + variant("doxygen", default=False, description="Build Conduit's Doxygen documentation") ########################################################################### # package dependencies @@ -95,11 +77,9 @@ class Conduit(Package): ####################### # we need a shared version of python b/c linking with static python lib # causes duplicate state issues when running compiled python modules. - depends_on("python+shared") + depends_on("python+shared", when="+python") extends("python", when="+python") - # TODO: blas and lapack are disabled due to build - # issues Cyrus experienced on OSX 10.11.6 - depends_on("py-numpy~blas~lapack", when="+python", type=('build', 'run')) + depends_on("py-numpy", when="+python", type=('build', 'run')) ####################### # I/O Packages @@ -108,9 +88,10 @@ class Conduit(Package): # experienced on BGQ. When on, the static build tries # to link against shared libs. # - # we are not using hdf5's mpi or fortran features. - depends_on("hdf5~cxx~mpi~fortran", when="+hdf5+shared") - depends_on("hdf5~shared~cxx~mpi~fortran", when="+hdf5~shared") + # Use HDF5 1.8, for wider output compatibly + # variants reflect we are not using hdf5's mpi or fortran features. + depends_on("hdf5@1.8.19:1.8.999~cxx~mpi~fortran", when="+hdf5+shared") + depends_on("hdf5@1.8.19:1.8.999~shared~cxx~mpi~fortran", when="+hdf5~shared") # we are not using silo's fortran features depends_on("silo~fortran", when="+silo+shared") @@ -125,7 +106,7 @@ class Conduit(Package): # Documentation related ####################### depends_on("py-sphinx", when="+python+doc", type='build') - depends_on("doxygen", when="+doc") + depends_on("doxygen", when="+doc+doxygen") def url_for_version(self, version): """ @@ -136,11 +117,12 @@ class Conduit(Package): return "https://github.com/LLNL/conduit/archive/v0.2.0.tar.gz" elif v == "0.2.1": return "https://github.com/LLNL/conduit/archive/v0.2.1.tar.gz" - elif v == "0.3.0": - # conduit uses BLT (https://github.com/llnl/blt) as a submodule, - # since github does not automatically package source from - # submodules, conduit provides a custom src tarball - return "https://github.com/LLNL/conduit/releases/download/v0.3.0/conduit-v0.3.0-src-with-blt.tar.gz" + else: + # starting with v 0.3.0, conduit uses BLT + # (https://github.com/llnl/blt) as a submodule, since github does + # not automatically package source from submodules, conduit + # provides a custom src tarball + return "https://github.com/LLNL/conduit/releases/download/v{0}/conduit-v{1}-src-with-blt.tar.gz".format(v, v) return url def install(self, spec, prefix): @@ -148,7 +130,13 @@ class Conduit(Package): Build and install Conduit. """ with working_dir('spack-build', create=True): - host_cfg_fname = self.create_host_config(spec, prefix) + py_site_pkgs_dir = None + if "+python" in spec: + py_site_pkgs_dir = site_packages_dir + + host_cfg_fname = self.create_host_config(spec, + prefix, + py_site_pkgs_dir) cmake_args = [] # if we have a static build, we need to avoid any of # spack's default cmake settings related to rpaths @@ -163,14 +151,26 @@ class Conduit(Package): cmake(*cmake_args) make() make("install") + # install copy of host config for provenance + install(host_cfg_fname, prefix) - def create_host_config(self, spec, prefix): + def create_host_config(self, spec, prefix, py_site_pkgs_dir=None): """ This method creates a 'host-config' file that specifies all of the options used to configure and build conduit. - For more details see about 'host-config' files see: + For more details about 'host-config' files see: http://software.llnl.gov/conduit/building.html + + Note: + The `py_site_pkgs_dir` arg exists to allow a package that + subclasses this package provide a specific site packages + dir when calling this function. `py_site_pkgs_dir` should + be an absolute path or `None`. + + This is necessary because the spack `site_packages_dir` + var will not exist in the base class. For more details + on this issue see: https://github.com/spack/spack/issues/6261 """ ####################### @@ -209,9 +209,9 @@ class Conduit(Package): raise RuntimeError(msg) cmake_exe = cmake_exe.path - host_cfg_fname = "%s-%s-%s.cmake" % (socket.gethostname(), - sys_type, - spec.compiler) + host_cfg_fname = "%s-%s-%s-conduit.cmake" % (socket.gethostname(), + sys_type, + spec.compiler) cfg = open(host_cfg_fname, "w") cfg.write("##################################\n") @@ -256,10 +256,10 @@ class Conduit(Package): cfg.write("# python from spack \n") cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE", spec['python'].command.path)) - # install module to standard style site packages dir - # so we can support spack activate - cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX", - site_packages_dir)) + # only set dest python site packages dir if passed + if py_site_pkgs_dir: + cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX", + py_site_pkgs_dir)) else: cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF")) @@ -270,10 +270,10 @@ class Conduit(Package): sphinx_build_exe = join_path(spec['py-sphinx'].prefix.bin, "sphinx-build") cfg.write(cmake_cache_entry("SPHINX_EXECUTABLE", sphinx_build_exe)) - - cfg.write("# doxygen from uberenv\n") - doxygen_exe = spec['doxygen'].command.path - cfg.write(cmake_cache_entry("DOXYGEN_EXECUTABLE", doxygen_exe)) + if "+doxygen" in spec: + cfg.write("# doxygen from uberenv\n") + doxygen_exe = spec['doxygen'].command.path + cfg.write(cmake_cache_entry("DOXYGEN_EXECUTABLE", doxygen_exe)) else: cfg.write(cmake_cache_entry("ENABLE_DOCS", "OFF")) @@ -290,6 +290,16 @@ class Conduit(Package): spec['mpi'].mpicxx)) cfg.write(cmake_cache_entry("MPI_Fortran_COMPILER", spec['mpi'].mpifc)) + mpiexe_bin = join_path(spec['mpi'].prefix.bin, 'mpiexec') + if os.path.isfile(mpiexe_bin): + # starting with cmake 3.10, FindMPI expects MPIEXEC_EXECUTABLE + # vs the older versions which expect MPIEXEC + if self.spec["cmake"].satisfies('@3.10:'): + cfg.write(cmake_cache_entry("MPIEXEC_EXECUTABLE", + mpiexe_bin)) + else: + cfg.write(cmake_cache_entry("MPIEXEC", + mpiexe_bin)) else: cfg.write(cmake_cache_entry("ENABLE_MPI", "OFF")) |