Commit 5fea2f71 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'spack-fixes'

965c966d spack: cleanup local version code

 docs: update for spack

Acked-by: Kitware Robot's avatarKitware Robot <>
Acked-by: Scott Wittenburg's avatarScott Wittenburg <>
Merge-request: !3977
parents 3fbfb861 965c966d
Pipeline #164257 failed with stages
in 0 seconds
......@@ -473,6 +473,47 @@ The following targets are used to build documentation for ParaView:
* `ParaViewPythonDoc` - build the documentation from ParaView's Python source files.
* `ParaViewDoc-TGZ` - build a gzipped tarball of ParaView documentation.
## Using spack
[Spack][spack] is a package manager for supercomputers, Linux and macOS. ParaView is one of
the packages available in Spack. To install ParaView from spack, you can use:
spack install paraview
Please refer to [Spack documentation][spack-docs] for ways of customizing the install,
including choosing the version and/or variant to build. Based one the version chosen,
spack will download appropriate ParaView source and build it.
To make it easier to build ParaView using spack from an existing source checkout, we have included
relevant spack `package.yaml` files within the ParaView codebase itself. This
also makes it easier to keep the spack package up-to-date with any changes to
the ParaView buildsystem. With every release (and as frequently as required), we
will push the changes to the ParaView paraview.yaml file upstream to the
official spack repository.
To build your existing source checkout of ParaView using Spack, here are the
# assuming you've installed spack as documented in spack docs
# and activate the spack environment appropriately
# add custom paraview/package.yaml
> spack repo add $PARAVIEW_SOURCE_DIR/Utilities/spack/repo
# use info to confirm that the paraview package is available
# only one version should be available
> spack info paraview
# install similar to any other spack package
# e.g. following command installs osmesa-capable ParaView
# with mpich
> spack install paraview+osmesa^mesa~glx^mpich
......@@ -493,3 +534,5 @@ The following targets are used to build documentation for ParaView:
......@@ -8,7 +8,7 @@ from spack.fetch_strategy import fetcher, VCSFetchStrategy
from spack.util.executable import which
import llnl.util.tty as tty
import os
import os, os.path
import copy
......@@ -30,34 +30,21 @@ class LocalStrategy(VCSFetchStrategy):
os.symlink(self.url, self.stage.source_path)
return True
def git(self):
if not self._git:
self._git = which('git', required=True)
return self._git
def cachable(self):
return False
def source_id(self):
if not self.revision:
git = self.git
output = git("-C", self.url, "rev-parse", "--short", "HEAD", output=str)
self.revision = output
return self.revision
return "local"
def mirror_id(self):
return None
current_namespace = __package__.rpartition('.')[-1]
if current_namespace == "paraview":
def _determine_paraview_source_dir():
source_dir = __file__
source_dir = source_dir[:source_dir.rfind("/Utilities/spack/repo/packages/paraview/")]
git = which('git', required=True)
output = git("-C", source_dir, "describe", "HEAD", output=str)
pvversion = output[1:]
return source_dir[:source_dir.rfind("/Utilities/spack/repo/packages/paraview/")]
enable_local_fetch_strategy = True
class Paraview(CMakePackage, CudaPackage):
"""ParaView is an open-source, multi-platform data analysis and
......@@ -71,8 +58,8 @@ class Paraview(CMakePackage, CudaPackage):
maintainers = ['chuckatkins', 'danlipsa']
if current_namespace == "paraview":
version(pvversion, file="{0}".format(source_dir), preferred=True)
if enable_local_fetch_strategy:
version('develop', file=_determine_paraview_source_dir(), preferred=True)
version('develop', branch='master', submodules=True)
version('5.7.0', sha256='e41e597e1be462974a03031380d9e5ba9a7efcdb22e4ca2f3fec50361f310874')
......@@ -163,7 +150,7 @@ class Paraview(CMakePackage, CudaPackage):
depends_on('cmake@3.3:', type='build')
if current_namespace == "paraview":
if enable_local_fetch_strategy:
# skip patches
# we can rely on the version number given `git describe` since
# that may end up using an older tag when building user forks without
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment