diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-05-23 22:17:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 20:17:51 +0000 |
commit | 8b7abace8b444786a4fcc62a36ff5dc34134b070 (patch) | |
tree | 153cf86e8f345bb8f74fab8461150806fb427f65 /var | |
parent | 5cf98d95649511e0626e5eef535b220b2dddec82 (diff) | |
download | spack-8b7abace8b444786a4fcc62a36ff5dc34134b070.tar.gz spack-8b7abace8b444786a4fcc62a36ff5dc34134b070.tar.bz2 spack-8b7abace8b444786a4fcc62a36ff5dc34134b070.tar.xz spack-8b7abace8b444786a4fcc62a36ff5dc34134b070.zip |
Enforce consistency of `gl` providers (#44307)
* glew: rework dependency on gl
This simplifies the package and ensures a single gl implementation is
pulled in. Before we were adding direct dependencies, and those are
not unified through the virtual.
* mesa-demos: rework dependency on gl
This simplifies the package and ensures a single gl implementation is
pulled in. Before we were adding direct dependencies, and those are
not unified through the virtual.
* mesa-glu: rework dependency on gl
This simplifies the package and ensures a single gl implementation is
pulled in. Before we were adding direct dependencies, and those are
not unified through the virtual.
* paraview: fix dependency on glew
* mesa: group dependency on when("+glx")
* Add missing dependency on libxml2
* paraview: remove the "osmesa" and "egl" variant
Instead, enforce consistency using the "gl" virtual that allows
only one provider.
* visit: remove osmesa variant
* Disable paraview in the aws-isc stacks
* data-vis-sdk: rework constrains to enforce front-ends
* e4s-power: remove redundant paraview
* Pipelines: update osmesa variants
* trilinos-catalyst-ioss-adapter: make gl a run dependency
Diffstat (limited to 'var')
8 files changed, 46 insertions, 105 deletions
diff --git a/var/spack/repos/builtin/packages/glew/package.py b/var/spack/repos/builtin/packages/glew/package.py index 6e2e41779f..7183933c4b 100644 --- a/var/spack/repos/builtin/packages/glew/package.py +++ b/var/spack/repos/builtin/packages/glew/package.py @@ -2,9 +2,6 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import sys - from spack.package import * @@ -23,29 +20,9 @@ class Glew(CMakePackage): version("2.1.0", sha256="04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95") version("2.0.0", sha256="c572c30a4e64689c342ba1624130ac98936d7af90c3103f9ce12b8a0c5736764") - variant( - "gl", - default="glx" if sys.platform.startswith("linux") else "other", - values=("glx", "osmesa", "egl", "other"), - multi=False, - description="The OpenGL provider to use", - ) - conflicts("^osmesa", when="gl=glx") - conflicts("^osmesa", when="gl=egl") - conflicts("^osmesa", when="gl=other") - conflicts("^glx", when="gl=osmesa") - conflicts("^glx", when="gl=other") - conflicts("^glx", when="gl=egl") - conflicts("^egl", when="gl=glx") - conflicts("^egl", when="gl=osmesa") - conflicts("^egl", when="gl=other") - depends_on("gl") - depends_on("osmesa", when="gl=osmesa") - depends_on("glx", when="gl=glx") - depends_on("libx11", when="gl=glx") - depends_on("xproto", when="gl=glx") - depends_on("egl", when="gl=egl") + depends_on("libx11", when="^[virtuals=gl] glx") + depends_on("xproto", when="^[virtuals=gl] glx") # glu is already forcibly disabled in the CMakeLists.txt. This prevents # it from showing up in the .pc file @@ -56,15 +33,15 @@ class Glew(CMakePackage): args = [ self.define("BUILD_UTILS", True), self.define("GLEW_REGAL", False), - self.define("GLEW_EGL", "gl=egl" in spec), + self.define("GLEW_EGL", spec.satisfies("^[virtuals=gl] egl")), self.define("OPENGL_INCLUDE_DIR", spec["gl"].headers.directories[0]), self.define("OPENGL_gl_LIBRARY", spec["gl"].libs[0]), self.define("OPENGL_opengl_LIBRARY", "IGNORE"), self.define("OPENGL_glx_LIBRARY", "IGNORE"), self.define("OPENGL_glu_LIBRARY", "IGNORE"), - self.define("GLEW_OSMESA", "gl=osmesa" in spec), + self.define("GLEW_OSMESA", spec.satisfies("^[virtuals=gl] osmesa")), ] - if "gl=egl" in spec: + if spec.satisfies("^[virtuals=gl] egl"): args.append( self.define("OPENGL_egl_LIBRARY", [spec["egl"].libs[0], spec["egl"].libs[1]]) ) @@ -76,4 +53,4 @@ class Glew(CMakePackage): def flag_handler(self, name, flags): if name == "ldflags" and self.spec.satisfies("platform=darwin ^apple-gl"): flags.append("-framework OpenGL") - return (flags, None, None) + return flags, None, None diff --git a/var/spack/repos/builtin/packages/mesa-demos/package.py b/var/spack/repos/builtin/packages/mesa-demos/package.py index c85b2eb2e3..60a923e06a 100644 --- a/var/spack/repos/builtin/packages/mesa-demos/package.py +++ b/var/spack/repos/builtin/packages/mesa-demos/package.py @@ -2,8 +2,6 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import sys - from spack.package import * @@ -20,18 +18,6 @@ class MesaDemos(AutotoolsPackage): version("8.2.0", sha256="5a9f71b815d968d0c3b77edfcc3782d0211f8520b00da9e554ccfed80c8889f6") version("8.1.0", sha256="cc5826105355830208c90047fc38c5b09fa3ab0045366e7e859104935b00b76d") - variant( - "gl", - default="glx" if sys.platform.startswith("linux") else "osmesa", - values=("glx", "osmesa", "other"), - multi=False, - description="The OpenGL provider to use", - ) - conflicts("^osmesa", when="gl=glx") - conflicts("^osmesa", when="gl=other") - conflicts("^glx", when="gl=osmesa") - conflicts("^glx", when="gl=other") - depends_on("autoconf", type="build") depends_on("automake", type="build") depends_on("libtool", type="build") @@ -39,10 +25,8 @@ class MesaDemos(AutotoolsPackage): depends_on("pkgconfig", type="build") depends_on("gl") - depends_on("osmesa", when="gl=osmesa") - depends_on("glx", when="gl=glx") - depends_on("libx11", when="gl=glx") - depends_on("libxext", when="gl=glx") + depends_on("libx11", when="^[virtuals=gl] glx") + depends_on("libxext", when="^[virtuals=gl] glx") depends_on("glu") depends_on("glew@1.5.4:") @@ -64,11 +48,11 @@ class MesaDemos(AutotoolsPackage): "--disable-rbug", "--without-glut", ] - if "gl=glx" in spec: + if spec.satisfies("^[virtuals=gl] glx"): args.append("--enable-x11") else: args.append("--disable-x11") - if "gl=osmesa" in spec: + if spec.satisfies("^[virtuals=gl] osmesa"): args.append("--enable-osmesa") else: args.append("--disable-osmesa") diff --git a/var/spack/repos/builtin/packages/mesa-glu/package.py b/var/spack/repos/builtin/packages/mesa-glu/package.py index 071703aa5f..7393398e91 100644 --- a/var/spack/repos/builtin/packages/mesa-glu/package.py +++ b/var/spack/repos/builtin/packages/mesa-glu/package.py @@ -2,9 +2,6 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import sys - from spack.package import * @@ -18,22 +15,7 @@ class MesaGlu(AutotoolsPackage): version("9.0.1", sha256="f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7") version("9.0.0", sha256="4387476a1933f36fec1531178ea204057bbeb04cc2d8396c9ea32720a1f7e264") - variant( - "gl", - default="glx" if sys.platform.startswith("linux") else "other", - values=("glx", "osmesa", "other"), - multi=False, - description="The OpenGL provider to use", - ) - conflicts("^osmesa", when="gl=glx") - conflicts("^osmesa", when="gl=other") - conflicts("^glx", when="gl=osmesa") - conflicts("^glx", when="gl=other") - depends_on("gl@3:") - depends_on("osmesa", when="gl=osmesa") - depends_on("glx", when="gl=glx") - provides("glu@1.3") # When using -std=c++17, using register long will throw an error. This @@ -43,7 +25,7 @@ class MesaGlu(AutotoolsPackage): def configure_args(self): args = ["--disable-libglvnd"] - if "gl=osmesa" in self.spec: + if self.spec.satisfies("^[virtuals=gl] osmesa"): args.append("--enable-osmesa") else: args.append("--disable-osmesa") diff --git a/var/spack/repos/builtin/packages/mesa/package.py b/var/spack/repos/builtin/packages/mesa/package.py index b46be01968..dbbcee64cb 100644 --- a/var/spack/repos/builtin/packages/mesa/package.py +++ b/var/spack/repos/builtin/packages/mesa/package.py @@ -62,6 +62,7 @@ class Mesa(MesonPackage): depends_on("unwind") depends_on("expat") depends_on("zlib-api") + depends_on("libxml2") # Internal options variant("llvm", default=True, description="Enable LLVM.") @@ -111,12 +112,13 @@ class Mesa(MesonPackage): depends_on("libllvm@:12", when="@:21") depends_on("libllvm@:17", when="@:23") - depends_on("libx11", when="+glx") - depends_on("libxcb", when="+glx") - depends_on("libxext", when="+glx") - depends_on("libxt", when="+glx") - depends_on("xrandr", when="+glx") - depends_on("glproto@1.4.14:", when="+glx") + with when("+glx"): + depends_on("libx11") + depends_on("libxcb") + depends_on("libxext") + depends_on("libxt") + depends_on("xrandr") + depends_on("glproto@1.4.14:") # version specific issue # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96130 diff --git a/var/spack/repos/builtin/packages/of-catalyst/package.py b/var/spack/repos/builtin/packages/of-catalyst/package.py index d7a3821736..b210baa5d3 100644 --- a/var/spack/repos/builtin/packages/of-catalyst/package.py +++ b/var/spack/repos/builtin/packages/of-catalyst/package.py @@ -32,7 +32,11 @@ class OfCatalyst(CMakePackage): depends_on("openfoam@1806", when="@1806", type=("build", "link", "run")) depends_on("openfoam@develop", when="@develop", type=("build", "link", "run")) - depends_on("paraview@5.5:+osmesa~qt", when="+full") + + with when("+full"): + depends_on("paraview@5.5: ~qt") + depends_on("gl") + requires("^[virtuals=gl] osmesa") root_cmakelists_dir = "src/catalyst" diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index d9482a5c51..3ce188bbf1 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -66,8 +66,6 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): variant("python", default=False, description="Enable Python support", when="@5.6:") variant("fortran", default=False, description="Enable Fortran support") variant("mpi", default=True, description="Enable MPI support") - variant("osmesa", default=False, description="Enable OSMesa support") - variant("egl", default=False, description="Enable EGL in the OpenGL library being used") variant("qt", default=False, description="Enable Qt (gui) support") variant("opengl2", default=True, description="Enable OpenGL2 backend") variant("examples", default=False, description="Build examples") @@ -187,16 +185,12 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): depends_on("gl@3.2:", when="+opengl2") depends_on("gl@1.2:", when="~opengl2") - depends_on("glew", when="~egl") - depends_on("glew gl=egl", when="+egl") + depends_on("glew") - depends_on("osmesa", when="+osmesa") for p in ["linux", "cray"]: - depends_on("glx", when="~egl ~osmesa platform={}".format(p)) - depends_on("libxt", when="~egl ~osmesa platform={}".format(p)) - conflicts("+qt", when="+osmesa") - conflicts("+qt", when="+egl") - conflicts("+egl", when="+osmesa") + depends_on("libxt", when=f"platform={p} ^[virtuals=gl] glx") + + requires("^[virtuals=gl] glx", when="+qt", msg="Qt support requires GLX") depends_on("ospray@2.1:2", when="+raytracing") depends_on("openimagedenoise", when="+raytracing") @@ -376,7 +370,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): if self.spec["hdf5"].satisfies("@1.12:"): flags.append("-DH5_USE_110_API") - return (flags, None, None) + return flags, None, None def setup_run_environment(self, env): # paraview 5.5 and later @@ -424,19 +418,17 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): def variant_bool(feature, on="ON", off="OFF"): """Ternary for spec variant to ON/OFF string""" - if feature in spec: + if spec.satisfies(feature): return on return off - def nvariant_bool(feature): - """Negated ternary for spec variant to OFF/ON string""" - return variant_bool(feature, on="OFF", off="ON") - def use_x11(): """Return false if osmesa or egl are requested""" - if "+osmesa" in spec or "+egl" in spec: - return "OFF" - if spec.satisfies("platform=windows"): + if ( + spec.satisfies("^[virtuals=gl] osmesa") + or spec.satisfies("^[virtuals=gl] egl") + or spec.satisfies("platform=windows") + ): return "OFF" return "ON" @@ -444,7 +436,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): includes = variant_bool("+development_files") cmake_args = [ - "-DVTK_OPENGL_HAS_OSMESA:BOOL=%s" % variant_bool("+osmesa"), + "-DVTK_OPENGL_HAS_OSMESA:BOOL=%s" % variant_bool("^[virtuals=gl] osmesa"), "-DVTK_USE_X:BOOL=%s" % use_x11(), "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=%s" % includes, "-DBUILD_TESTING:BOOL=OFF", @@ -453,7 +445,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): self.define_from_variant("VISIT_BUILD_READER_Silo", "visitbridge"), ] - if "+egl" in spec: + if spec.satisfies("^[virtuals=gl] egl"): cmake_args.append("-DVTK_OPENGL_HAS_EGL:BOOL=ON") if spec.satisfies("@5.12:"): @@ -530,7 +522,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): # The assumed qt version changed to QT5 (as of paraview 5.2.1), # so explicitly specify which QT major version is actually being used - if "+qt" in spec: + if spec.satisfies("+qt"): cmake_args.extend(["-DPARAVIEW_QT_VERSION=%s" % spec["qt"].version[0]]) if "+fortran" in spec: diff --git a/var/spack/repos/builtin/packages/trilinos-catalyst-ioss-adapter/package.py b/var/spack/repos/builtin/packages/trilinos-catalyst-ioss-adapter/package.py index 891929bdb4..c971f46adc 100644 --- a/var/spack/repos/builtin/packages/trilinos-catalyst-ioss-adapter/package.py +++ b/var/spack/repos/builtin/packages/trilinos-catalyst-ioss-adapter/package.py @@ -17,7 +17,9 @@ class TrilinosCatalystIossAdapter(CMakePackage): depends_on("bison", type="build") depends_on("flex", type="build") - depends_on("paraview+mpi+python+osmesa") + depends_on("paraview+mpi+python") + depends_on("gl", type="run") + requires("^[virtuals=gl] osmesa", msg="OSMesa is required for paraview") depends_on("py-numpy", type=("build", "run")) # Here we avoid paraview trying to use netcdf-c~parallel-netcdf # which is netcdf-c's default, even though paraview depends on 'netcdf-c' diff --git a/var/spack/repos/builtin/packages/visit/package.py b/var/spack/repos/builtin/packages/visit/package.py index 987f7f7250..5163725ab8 100644 --- a/var/spack/repos/builtin/packages/visit/package.py +++ b/var/spack/repos/builtin/packages/visit/package.py @@ -75,7 +75,6 @@ class Visit(CMakePackage): generator("ninja") variant("gui", default=True, description="Enable VisIt's GUI") - variant("osmesa", default=False, description="Use OSMesa for off-screen CPU rendering") variant("adios2", default=True, description="Enable ADIOS2 file format") variant("hdf5", default=True, description="Enable HDF5 file format") variant("netcdf", default=True, description="Enable NetCDF file format") @@ -105,14 +104,13 @@ class Visit(CMakePackage): # Fix const-correctness in VTK interface patch("vtk-8.2-constcorrect.patch", when="@3.3.3 ^vtk@8.2.1a") - # Exactly one of 'gui' or 'osmesa' has to be enabled - conflicts("+gui", when="+osmesa") + conflicts( + "+gui", when="^[virtuals=gl] osmesa", msg="GUI cannot be activated with OSMesa front-end" + ) depends_on("cmake@3.14.7:", type="build") depends_on("mpi", when="+mpi") - requires("^[virtuals=gl] osmesa", when="+osmesa") - # VTK flavors depends_on("vtk@8.1:8 +opengl2") depends_on("vtk +qt", when="+gui") @@ -125,7 +123,7 @@ class Visit(CMakePackage): depends_on( "vtk", patches=[patch("vtk_rendering_opengl2_x11.patch")], - when="~osmesa platform=linux ^vtk@8", + when="platform=linux ^[virtuals=gl] glx ^vtk@8", ) depends_on("vtk", patches=[patch("vtk_wrapping_python_x11.patch")], when="+python ^vtk@8") @@ -296,7 +294,7 @@ class Visit(CMakePackage): self.define("OPENGL_glu_LIBRARY", spec["glu"].libs[0]), ] ) - if "+osmesa" in spec: + if spec.satisfies("^[virtuals=gl] osmesa"): args.extend( [ self.define("HAVE_OSMESA", True), |