updates to conduit and ascent packages (new PR) (#6584)
* optional path to use spacks py-site-pkgs, install host-cfg for provenance * add more comments and address review requests * only use st-pkgs-dir when +python * ascent does not need doxygen * capture mpiexec if it exists * added missing import * flake8 fix * default adios variant to False * ascent develop now reqs conduit master * optional path to use spacks py-site-pkgs, install host-cfg for provenance * add more comments and address review requests * only use st-pkgs-dir when +python * ascent does not need doxygen * capture mpiexec if it exists * added missing import * flake8 fix * default adios variant to False * ascent develop now reqs conduit master * conduit: use hdf5 1.8 for wider output compat
This commit is contained in:
parent
e279299b9b
commit
95a384f051
@ -78,7 +78,7 @@ class Ascent(Package):
|
|||||||
variant("tbb", default=True, description="Build tbb support")
|
variant("tbb", default=True, description="Build tbb support")
|
||||||
variant("cuda", default=False, description="Build cuda support")
|
variant("cuda", default=False, description="Build cuda support")
|
||||||
|
|
||||||
variant("adios", default=True, description="Build Adios filter support")
|
variant("adios", default=False, description="Build Adios filter support")
|
||||||
|
|
||||||
# variants for dev-tools (docs, etc)
|
# variants for dev-tools (docs, etc)
|
||||||
variant("doc", default=False, description="Build Conduit's documentation")
|
variant("doc", default=False, description="Build Conduit's documentation")
|
||||||
@ -88,7 +88,7 @@ class Ascent(Package):
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
depends_on("cmake", when="+cmake")
|
depends_on("cmake", when="+cmake")
|
||||||
depends_on("conduit")
|
depends_on("conduit@master")
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# Python
|
# Python
|
||||||
@ -125,7 +125,13 @@ def install(self, spec, prefix):
|
|||||||
Build and install Conduit.
|
Build and install Conduit.
|
||||||
"""
|
"""
|
||||||
with working_dir('spack-build', create=True):
|
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 = []
|
cmake_args = []
|
||||||
# if we have a static build, we need to avoid any of
|
# if we have a static build, we need to avoid any of
|
||||||
# spack's default cmake settings related to rpaths
|
# spack's default cmake settings related to rpaths
|
||||||
@ -140,12 +146,26 @@ def install(self, spec, prefix):
|
|||||||
cmake(*cmake_args)
|
cmake(*cmake_args)
|
||||||
make()
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
# TODO also copy host_cfg_fname into 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
|
This method creates a 'host-config' file that specifies
|
||||||
all of the options used to configure and build ascent.
|
all of the options used to configure and build ascent.
|
||||||
|
|
||||||
|
For more details about 'host-config' files see:
|
||||||
|
http://ascent.readthedocs.io/en/latest/BuildingAscent.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
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
@ -184,9 +204,9 @@ def create_host_config(self, spec, prefix):
|
|||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
cmake_exe = cmake_exe.path
|
cmake_exe = cmake_exe.path
|
||||||
|
|
||||||
host_cfg_fname = "%s-%s-%s.cmake" % (socket.gethostname(),
|
host_cfg_fname = "%s-%s-%s-ascent.cmake" % (socket.gethostname(),
|
||||||
sys_type,
|
sys_type,
|
||||||
spec.compiler)
|
spec.compiler)
|
||||||
|
|
||||||
cfg = open(host_cfg_fname, "w")
|
cfg = open(host_cfg_fname, "w")
|
||||||
cfg.write("##################################\n")
|
cfg.write("##################################\n")
|
||||||
@ -246,10 +266,10 @@ def create_host_config(self, spec, prefix):
|
|||||||
cfg.write("# python from spack \n")
|
cfg.write("# python from spack \n")
|
||||||
cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE",
|
cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE",
|
||||||
spec['python'].command.path))
|
spec['python'].command.path))
|
||||||
# install module to standard style site packages dir
|
# only set dest python site packages dir if passed
|
||||||
# so we can support spack activate
|
if py_site_pkgs_dir:
|
||||||
cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
|
cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
|
||||||
site_packages_dir))
|
py_site_pkgs_dir))
|
||||||
else:
|
else:
|
||||||
cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF"))
|
cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF"))
|
||||||
|
|
||||||
@ -260,10 +280,6 @@ def create_host_config(self, spec, prefix):
|
|||||||
sphinx_build_exe = join_path(spec['py-sphinx'].prefix.bin,
|
sphinx_build_exe = join_path(spec['py-sphinx'].prefix.bin,
|
||||||
"sphinx-build")
|
"sphinx-build")
|
||||||
cfg.write(cmake_cache_entry("SPHINX_EXECUTABLE", sphinx_build_exe))
|
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))
|
|
||||||
else:
|
else:
|
||||||
cfg.write(cmake_cache_entry("ENABLE_DOCS", "OFF"))
|
cfg.write(cmake_cache_entry("ENABLE_DOCS", "OFF"))
|
||||||
|
|
||||||
@ -280,6 +296,10 @@ def create_host_config(self, spec, prefix):
|
|||||||
spec['mpi'].mpicxx))
|
spec['mpi'].mpicxx))
|
||||||
cfg.write(cmake_cache_entry("MPI_Fortran_COMPILER",
|
cfg.write(cmake_cache_entry("MPI_Fortran_COMPILER",
|
||||||
spec['mpi'].mpifc))
|
spec['mpi'].mpifc))
|
||||||
|
mpiexe_bin = join_path(spec['mpi'].prefix.bin, 'mpiexec')
|
||||||
|
if os.path.isfile(mpiexe_bin):
|
||||||
|
cfg.write(cmake_cache_entry("MPIEXEC",
|
||||||
|
mpiexe_bin))
|
||||||
else:
|
else:
|
||||||
cfg.write(cmake_cache_entry("ENABLE_MPI", "OFF"))
|
cfg.write(cmake_cache_entry("ENABLE_MPI", "OFF"))
|
||||||
|
|
||||||
|
@ -108,9 +108,10 @@ class Conduit(Package):
|
|||||||
# experienced on BGQ. When on, the static build tries
|
# experienced on BGQ. When on, the static build tries
|
||||||
# to link against shared libs.
|
# to link against shared libs.
|
||||||
#
|
#
|
||||||
# we are not using hdf5's mpi or fortran features.
|
# Use HDF5 1.8, for wider output compatibly
|
||||||
depends_on("hdf5~cxx~mpi~fortran", when="+hdf5+shared")
|
# variants reflect we are not using hdf5's mpi or fortran features.
|
||||||
depends_on("hdf5~shared~cxx~mpi~fortran", when="+hdf5~shared")
|
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
|
# we are not using silo's fortran features
|
||||||
depends_on("silo~fortran", when="+silo+shared")
|
depends_on("silo~fortran", when="+silo+shared")
|
||||||
@ -148,7 +149,13 @@ def install(self, spec, prefix):
|
|||||||
Build and install Conduit.
|
Build and install Conduit.
|
||||||
"""
|
"""
|
||||||
with working_dir('spack-build', create=True):
|
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 = []
|
cmake_args = []
|
||||||
# if we have a static build, we need to avoid any of
|
# if we have a static build, we need to avoid any of
|
||||||
# spack's default cmake settings related to rpaths
|
# spack's default cmake settings related to rpaths
|
||||||
@ -163,14 +170,26 @@ def install(self, spec, prefix):
|
|||||||
cmake(*cmake_args)
|
cmake(*cmake_args)
|
||||||
make()
|
make()
|
||||||
make("install")
|
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
|
This method creates a 'host-config' file that specifies
|
||||||
all of the options used to configure and build conduit.
|
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
|
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 +228,9 @@ def create_host_config(self, spec, prefix):
|
|||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
cmake_exe = cmake_exe.path
|
cmake_exe = cmake_exe.path
|
||||||
|
|
||||||
host_cfg_fname = "%s-%s-%s.cmake" % (socket.gethostname(),
|
host_cfg_fname = "%s-%s-%s-conduit.cmake" % (socket.gethostname(),
|
||||||
sys_type,
|
sys_type,
|
||||||
spec.compiler)
|
spec.compiler)
|
||||||
|
|
||||||
cfg = open(host_cfg_fname, "w")
|
cfg = open(host_cfg_fname, "w")
|
||||||
cfg.write("##################################\n")
|
cfg.write("##################################\n")
|
||||||
@ -256,10 +275,10 @@ def create_host_config(self, spec, prefix):
|
|||||||
cfg.write("# python from spack \n")
|
cfg.write("# python from spack \n")
|
||||||
cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE",
|
cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE",
|
||||||
spec['python'].command.path))
|
spec['python'].command.path))
|
||||||
# install module to standard style site packages dir
|
# only set dest python site packages dir if passed
|
||||||
# so we can support spack activate
|
if py_site_pkgs_dir:
|
||||||
cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
|
cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
|
||||||
site_packages_dir))
|
py_site_pkgs_dir))
|
||||||
else:
|
else:
|
||||||
cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF"))
|
cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF"))
|
||||||
|
|
||||||
@ -290,6 +309,10 @@ def create_host_config(self, spec, prefix):
|
|||||||
spec['mpi'].mpicxx))
|
spec['mpi'].mpicxx))
|
||||||
cfg.write(cmake_cache_entry("MPI_Fortran_COMPILER",
|
cfg.write(cmake_cache_entry("MPI_Fortran_COMPILER",
|
||||||
spec['mpi'].mpifc))
|
spec['mpi'].mpifc))
|
||||||
|
mpiexe_bin = join_path(spec['mpi'].prefix.bin, 'mpiexec')
|
||||||
|
if os.path.isfile(mpiexe_bin):
|
||||||
|
cfg.write(cmake_cache_entry("MPIEXEC",
|
||||||
|
mpiexe_bin))
|
||||||
else:
|
else:
|
||||||
cfg.write(cmake_cache_entry("ENABLE_MPI", "OFF"))
|
cfg.write(cmake_cache_entry("ENABLE_MPI", "OFF"))
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
class Vtkh(Package):
|
class Vtkh(Package):
|
||||||
@ -67,7 +68,9 @@ def install(self, spec, prefix):
|
|||||||
mpicxx = spec['mpi'].mpicxx
|
mpicxx = spec['mpi'].mpicxx
|
||||||
cmake_args.extend(["-DMPI_C_COMPILER={0}".format(mpicc),
|
cmake_args.extend(["-DMPI_C_COMPILER={0}".format(mpicc),
|
||||||
"-DMPI_CXX_COMPILER={0}".format(mpicxx)])
|
"-DMPI_CXX_COMPILER={0}".format(mpicxx)])
|
||||||
|
mpiexe_bin = join_path(spec['mpi'].prefix.bin, 'mpiexec')
|
||||||
|
if os.path.isfile(mpiexe_bin):
|
||||||
|
cmake_args.append("-DMPIEXEC={0}".format(mpiexe_bin))
|
||||||
# tbb support
|
# tbb support
|
||||||
if "+tbb" in spec:
|
if "+tbb" in spec:
|
||||||
cmake_args.append("-DTBB_DIR={0}".format(spec["tbb"].prefix))
|
cmake_args.append("-DTBB_DIR={0}".format(spec["tbb"].prefix))
|
||||||
|
Loading…
Reference in New Issue
Block a user