From 5e580fc82e29fe4d737274d9d885af0c1711299c Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 21 May 2024 17:18:14 +0200 Subject: [PATCH] Remove mesa18 and libosmesa (#44264) * Remove mesa18 and libosmesa mesa18 was introduced in #19528 as a way to maintain the old autotools build of mesa separate from the new meson build. We could add a second build system to mesa, but since mesa18 has been deprecated for a long time, we'll just remove it. libosmesa was used to multiplex the gl provider between mesa18 and mesa, and is thus unecessary. Remove it to reduce complexity in the graphical stack. * Remove references to mesa18 and libosmesa * vtk: rework dependency on gl and osmesa * memsurfer: rework dependency on vtk * visit: minimal fix to avoid having both osmesa and glx --- etc/spack/defaults/packages.yaml | 3 +- .../stacks/aws-isc-aarch64/spack.yaml | 2 - .../cloud_pipelines/stacks/aws-isc/spack.yaml | 2 - .../stacks/data-vis-sdk/spack.yaml | 2 - .../cloud_pipelines/stacks/radiuss/spack.yaml | 1 - .../builtin/packages/memsurfer/package.py | 4 - .../repos/builtin/packages/mesa/package.py | 2 - .../packages/mesa18/autotools-x11-nodri.patch | 14 -- .../mesa18/multiple-symbols_hash.patch | 22 -- .../repos/builtin/packages/mesa18/package.py | 228 ------------------ .../repos/builtin/packages/osmesa/package.py | 10 +- .../repos/builtin/packages/visit/package.py | 8 +- .../repos/builtin/packages/vtk/package.py | 14 +- 13 files changed, 14 insertions(+), 298 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/mesa18/autotools-x11-nodri.patch delete mode 100644 var/spack/repos/builtin/packages/mesa18/multiple-symbols_hash.patch delete mode 100644 var/spack/repos/builtin/packages/mesa18/package.py diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/packages.yaml index d637f3c93e..581b01e1f6 100644 --- a/etc/spack/defaults/packages.yaml +++ b/etc/spack/defaults/packages.yaml @@ -38,10 +38,9 @@ packages: lapack: [openblas, amdlibflame] libc: [glibc, musl] libgfortran: [ gcc-runtime ] - libglx: [mesa+glx, mesa18+glx] + libglx: [mesa+glx] libifcore: [ intel-oneapi-runtime ] libllvm: [llvm] - libosmesa: [mesa+osmesa, mesa18+osmesa] lua-lang: [lua, lua-luajit-openresty, lua-luajit] luajit: [lua-luajit-openresty, lua-luajit] mariadb-client: [mariadb-c-client, mariadb] diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml index d20d054f5b..3db29ee697 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml @@ -30,8 +30,6 @@ spack: variants: +pic +xz mesa: variants: ~llvm - mesa18: - variants: ~llvm mpich: variants: ~wrapperrpath netmod=ofi device=ch4 ncurses: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml index a04f22cb6d..185282e0ab 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml @@ -30,8 +30,6 @@ spack: variants: +pic +xz mesa: variants: ~llvm - mesa18: - variants: ~llvm mpich: variants: ~wrapperrpath netmod=ofi device=ch4 ncurses: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml index 63feea65ff..512c4f47d6 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml @@ -12,8 +12,6 @@ spack: - one_of: ['@1.14', '@1.12'] mesa: require: "+glx +osmesa +opengl ~opengles +llvm" - libosmesa: - require: "mesa +osmesa" libglx: require: "mesa +glx" ospray: diff --git a/share/spack/gitlab/cloud_pipelines/stacks/radiuss/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/radiuss/spack.yaml index d40788b917..a8b064535b 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/radiuss/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/radiuss/spack.yaml @@ -22,7 +22,6 @@ spack: - conduit # ^hdf5+shared - flux-core #- flux-sched - #- glvis # ^mesa-glu@9.0.0 ^mesa18~llvm # same issue w/chai - hypre - lbann - lvarray ~tests # per Spack issue #23192 # ~examples diff --git a/var/spack/repos/builtin/packages/memsurfer/package.py b/var/spack/repos/builtin/packages/memsurfer/package.py index b10bbf4e04..27edc9e563 100644 --- a/var/spack/repos/builtin/packages/memsurfer/package.py +++ b/var/spack/repos/builtin/packages/memsurfer/package.py @@ -19,8 +19,6 @@ class Memsurfer(PythonPackage): version("master", branch="master", submodules=True) version("develop", branch="develop", submodules=True) - variant("osmesa", default=False, description="Enable OSMesa support (for VTK)") - extends("python") depends_on("python@3.7:", type=("build", "run")) depends_on("py-setuptools", type="build") @@ -36,8 +34,6 @@ class Memsurfer(PythonPackage): # vtk needs to know whether to build with mesa or opengl depends_on("vtk@8.1.2 ~ffmpeg~mpi+opengl2~qt~xdmf+python") - depends_on("vtk ~osmesa", when="~osmesa") - depends_on("vtk +osmesa", when="+osmesa") # memsurfer's setup needs path to these deps to build extension modules def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/mesa/package.py b/var/spack/repos/builtin/packages/mesa/package.py index c53d7039ed..b46be01968 100644 --- a/var/spack/repos/builtin/packages/mesa/package.py +++ b/var/spack/repos/builtin/packages/mesa/package.py @@ -102,9 +102,7 @@ class Mesa(MesonPackage): # Provides provides("libglx", when="+glx") - # provides('egl@1.5', when='+egl') - provides("libosmesa", when="+osmesa") # Variant dependencies with when("+llvm"): diff --git a/var/spack/repos/builtin/packages/mesa18/autotools-x11-nodri.patch b/var/spack/repos/builtin/packages/mesa18/autotools-x11-nodri.patch deleted file mode 100644 index a88f5f5113..0000000000 --- a/var/spack/repos/builtin/packages/mesa18/autotools-x11-nodri.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index cd9ff25..79bc511 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1859,7 +1859,9 @@ for plat in $platforms; do - ;; - - x11) -- PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes]) -+ if test "x$enable_dri" = "xyes"; then -+ PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes]) -+ fi - DEFINES="$DEFINES -DHAVE_X11_PLATFORM" - ;; diff --git a/var/spack/repos/builtin/packages/mesa18/multiple-symbols_hash.patch b/var/spack/repos/builtin/packages/mesa18/multiple-symbols_hash.patch deleted file mode 100644 index 7c92326f37..0000000000 --- a/var/spack/repos/builtin/packages/mesa18/multiple-symbols_hash.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/src/gallium/auxiliary/util/u_debug_stack.c 2019-11-07 17:57:36.000000000 -0700 -+++ b/src/gallium/auxiliary/util/u_debug_stack.c 2020-07-23 15:30:46.033145497 -0600 -@@ -46,7 +46,7 @@ - #include "os/os_thread.h" - #include "u_hash_table.h" - --struct util_hash_table* symbols_hash; -+static struct util_hash_table* symbols_hash; - static mtx_t symbols_mutex = _MTX_INITIALIZER_NP; - - static unsigned hash_ptr(void* p) ---- a/src/gallium/auxiliary/util/u_debug_symbol.c 2019-11-07 17:58:53.000000000 -0700 -+++ b/src/gallium/auxiliary/util/u_debug_symbol.c 2020-07-23 15:31:06.400146072 -0600 -@@ -270,7 +270,7 @@ - debug_printf("\t%s\n", buf); - } - --struct util_hash_table* symbols_hash; -+static struct util_hash_table* symbols_hash; - static mtx_t symbols_mutex = _MTX_INITIALIZER_NP; - - static unsigned hash_ptr(void* p) diff --git a/var/spack/repos/builtin/packages/mesa18/package.py b/var/spack/repos/builtin/packages/mesa18/package.py deleted file mode 100644 index 17f6903c8d..0000000000 --- a/var/spack/repos/builtin/packages/mesa18/package.py +++ /dev/null @@ -1,228 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# 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 * - - -class Mesa18(AutotoolsPackage): - """Mesa is an open-source implementation of the OpenGL specification - - a system for rendering interactive 3D graphics.""" - - homepage = "https://www.mesa3d.org" - maintainers("v-dobrev", "ChristianTackeGSI") - - # Note that we always want to build from the git repo instead of a - # tarball since the tarball has pre-generated files for certain versions - # of LLVM while the git repo doesn't so it can adapt at build time to - # whatever version of LLVM you're using. - git = "https://gitlab.freedesktop.org/mesa/mesa.git" - - version("18.3.6", tag="mesa-18.3.6", commit="11049bcff86da8013a4f63bd68daf637e3af22f3") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - depends_on("pkgconfig", type="build") - depends_on("binutils+plugins", when=(sys.platform != "darwin"), type="build") - depends_on("bison", type="build") - depends_on("flex", type="build") - depends_on("gettext", type="build") - depends_on("pkgconfig", type="build") - depends_on("python@:3.8", type="build") # https://github.com/spack/spack/issues/28219 - depends_on("py-mako@0.8.0:", type="build") - depends_on("libxml2") - depends_on("zlib-api") - depends_on("expat") - depends_on("ncurses+termlib") - - # Internal options - variant("llvm", default=True, description="Enable LLVM.") - variant( - "swr", - values=spack.variant.DisjointSetsOfValues( - ("none",), ("auto",), ("avx", "avx2", "knl", "skx") - ) - .with_non_feature_values("auto") - .with_non_feature_values("none") - .with_default("auto"), - when="+llvm", - description="Enable the SWR driver.", - ) - - # Front ends - variant("osmesa", default=True, description="Enable the OSMesa frontend.") - - is_linux = sys.platform.startswith("linux") - variant("glx", default=is_linux, description="Enable the GLX frontend.") - - # Additional backends - variant("opengles", default=False, description="Enable OpenGL ES support.") - - # Provides - provides("libglx", when="+glx") - provides("libosmesa", when="+osmesa") - - # Variant dependencies - depends_on("libllvm@6:10", when="+llvm") - depends_on("libx11", when="+glx") - depends_on("libxcb", when="+glx") - depends_on("libxext", when="+glx") - depends_on("glproto@1.4.14:", when="+glx") - - # Require at least 1 front-end - conflicts("~osmesa ~glx") - - # Prevent an unnecessary xcb-dri dependency - patch("autotools-x11-nodri.patch") - - # Backport Mesa MR#6053 to prevent multiply-defined symbols - patch("multiple-symbols_hash.patch", when="@:20.1.4%gcc@10:") - - def setup_build_environment(self, env): - env.set("PYTHON", self.spec["python"].command.path) - - def autoreconf(self, spec, prefix): - which("autoreconf")("--force", "--verbose", "--install") - - def configure_args(self): - spec = self.spec - args = [ - "LDFLAGS={0}".format(self.spec["ncurses"].libs.search_flags), - "--enable-shared", - "--disable-static", - "--disable-libglvnd", - "--disable-nine", - "--disable-omx-bellagio", - "--disable-omx-tizonia", - "--disable-opencl", - "--disable-opencl-icd", - "--disable-va", - "--disable-vdpau", - "--disable-xa", - "--disable-xvmc", - "--disable-osmesa", - "--with-vulkan-drivers=", - "--disable-egl", - "--disable-gbm", - "--disable-dri", - "--enable-opengl", - ] - - args_platforms = [] - args_gallium_drivers = ["swrast"] - args_dri_drivers = [] - - if spec.target.family == "arm" or spec.target.family == "aarch64": - args.append("--disable-libunwind") - - num_frontends = 0 - if "+osmesa" in spec: - num_frontends += 1 - args.append("--enable-gallium-osmesa") - else: - args.append("--disable-gallium-osmesa") - - if "+glx" in spec: - num_frontends += 1 - args.append("--enable-glx=gallium-xlib") - args_platforms.append("x11") - else: - args.append("--disable-glx") - - if "+opengles" in spec: - args.extend(["--enable-gles1", "--enable-gles2"]) - else: - args.extend(["--disable-gles1", "--disable-gles2"]) - - if num_frontends > 1: - args.append("--enable-shared-glapi") - else: - args.append("--disable-shared-glapi") - - if "+llvm" in spec: - args.append("--enable-llvm") - args.append("--with-llvm-prefix=%s" % spec["libllvm"].prefix) - if "+llvm_dylib" in spec["libllvm"]: - args.append("--enable-llvm-shared-libs") - else: - args.append("--disable-llvm-shared-libs") - else: - args.append("--disable-llvm") - - args_swr_arches = [] - if "swr=auto" in spec: - if "avx" in spec.target: - args_swr_arches.append("avx") - if "avx2" in spec.target: - args_swr_arches.append("avx2") - if "avx512f" in spec.target: - if "avx512er" in spec.target: - args_swr_arches.append("knl") - if "avx512bw" in spec.target: - args_swr_arches.append("skx") - else: - if "swr=avx" in spec: - args_swr_arches.append("avx") - if "swr=avx2" in spec: - args_swr_arches.append("avx2") - if "swr=knl" in spec: - args_swr_arches.append("knl") - if "swr=skx" in spec: - args_swr_arches.append("skx") - if args_swr_arches: - args_gallium_drivers.append("swr") - args.append("--with-swr-archs=" + ",".join(args_swr_arches)) - - # Add the remaining list args - args.append("--with-platforms=" + ",".join(args_platforms)) - args.append("--with-gallium-drivers=" + ",".join(args_gallium_drivers)) - args.append("--with-dri-drivers=" + ",".join(args_dri_drivers)) - - return args - - @property - def libs(self): - spec = self.spec - libs_to_seek = set() - if "platform=windows" in spec: - libs_to_seek.add("opengl32") - if "+osmesa" in spec: - libs_to_seek.add("osmesa") - else: - libs_to_seek.add("libGL") - if "+osmesa" in spec: - libs_to_seek.add("libOSMesa") - if "+glx" in spec: - libs_to_seek.add("libGL") - if "+opengles" in spec: - libs_to_seek.add("libGLESv1_CM") - libs_to_seek.add("libGLESv2") - - return find_libraries( - list(libs_to_seek), root=self.spec.prefix, shared=True, recursive=True - ) - - @property - def libglx_headers(self): - return find_headers("GL/glx", root=self.spec.prefix.include, recursive=False) - - @property - def libglx_libs(self): - return find_libraries("libGL", root=self.spec.prefix, recursive=True) - - @property - def libosmesa_headers(self): - return find_headers("GL/osmesa", root=self.spec.prefix.include, recursive=False) - - @property - def libosmesa_libs(self): - if "platform=windows" in self.spec: - lib_name = "osmesa" - else: - lib_name = "libOSMesa" - return find_libraries(lib_name, root=self.spec.prefix, recursive=True) diff --git a/var/spack/repos/builtin/packages/osmesa/package.py b/var/spack/repos/builtin/packages/osmesa/package.py index b42564cc9c..682032655b 100644 --- a/var/spack/repos/builtin/packages/osmesa/package.py +++ b/var/spack/repos/builtin/packages/osmesa/package.py @@ -13,20 +13,20 @@ class Osmesa(BundlePackage): version("11.2.0") - depends_on("libosmesa") + depends_on("mesa+osmesa") provides("gl@4.5") @property def home(self): - return self.spec["libosmesa"].home + return self.spec["mesa"].home @property def headers(self): - return self.spec["libosmesa"].headers + return self.spec["mesa"].package.libosmesa_headers @property def libs(self): - return self.spec["libosmesa"].libs + return self.spec["mesa"].package.libosmesa_libs @property def gl_headers(self): @@ -34,4 +34,4 @@ def gl_headers(self): @property def gl_libs(self): - return self.spec["libosmesa"].libs + return self.spec["mesa"].package.libosmesa_libs diff --git a/var/spack/repos/builtin/packages/visit/package.py b/var/spack/repos/builtin/packages/visit/package.py index 3f806196fd..987f7f7250 100644 --- a/var/spack/repos/builtin/packages/visit/package.py +++ b/var/spack/repos/builtin/packages/visit/package.py @@ -109,12 +109,12 @@ class Visit(CMakePackage): conflicts("+gui", when="+osmesa") 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 +osmesa", when="+osmesa") depends_on("vtk +qt", when="+gui") depends_on("vtk +python", when="+python") depends_on("vtk +mpi", when="+mpi") @@ -130,6 +130,7 @@ class Visit(CMakePackage): depends_on("vtk", patches=[patch("vtk_wrapping_python_x11.patch")], when="+python ^vtk@8") depends_on("glu") + depends_on("gl") # VisIt doesn't work with later versions of qt. depends_on("qt+gui+opengl@5:5.14", when="+gui") @@ -291,6 +292,7 @@ def cmake_args(self): self.define("VISIT_OSMESA_DIR", "IGNORE"), self.define("OpenGL_GL_PREFERENCE", "LEGACY"), self.define("OPENGL_INCLUDE_DIR", spec["gl"].headers.directories[0]), + self.define("OPENGL_gl_LIBRARY", spec["gl"].libs[0]), self.define("OPENGL_glu_LIBRARY", spec["glu"].libs[0]), ] ) @@ -302,8 +304,6 @@ def cmake_args(self): self.define("OPENGL_gl_LIBRARY", spec["osmesa"].libs[0]), ] ) - else: - args.append(self.define("OPENGL_gl_LIBRARY", spec["gl"].libs[0])) if "+hdf5" in spec: args.append(self.define("HDF5_DIR", spec["hdf5"].prefix)) diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 6ba0bb3f4d..67a2e4cc1c 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -51,7 +51,6 @@ class Vtk(CMakePackage): # VTK7 defaults to OpenGL2 rendering backend variant("opengl2", default=True, description="Enable OpenGL2 backend") - variant("osmesa", default=False, description="Enable OSMesa support") variant("python", default=False, description="Enable Python support", when="@8:") variant("qt", default=False, description="Build with support for Qt") variant("xdmf", default=False, description="Build XDMF file support") @@ -75,7 +74,7 @@ class Vtk(CMakePackage): patch("xdmf2-hdf51.13.2.patch", when="@9:9.2.2 +xdmf") # We cannot build with both osmesa and qt in spack - conflicts("+osmesa", when="+qt") + conflicts("^osmesa", when="+qt") conflicts("%gcc@13", when="@9.2") @@ -126,13 +125,8 @@ class Vtk(CMakePackage): patch("vtk_proj_include_no_strict.patch", when="@9: platform=windows") patch("vtk_alias_hdf5.patch", when="@9: platform=windows") patch("vtk_findproj_config.patch", when="platform=windows") - with when("~osmesa"): - depends_on("glx", when="platform=linux") - depends_on("glx", when="platform=cray") - depends_on("libxt", when="platform=linux") - depends_on("libxt", when="platform=cray") - - depends_on("osmesa", when="+osmesa") + depends_on("libxt", when="^[virtuals=gl] glx platform=linux") + depends_on("libxt", when="^[virtuals=gl] glx platform=cray") # VTK will need Qt5OpenGL, and qt needs '-opengl' for that depends_on("qt+opengl", when="+qt") @@ -415,7 +409,7 @@ def cmake_args(self): cmake_args.append("-DVTK_RENDERING_BACKEND:STRING=" + opengl_ver) - if "+osmesa" in spec: + if spec.satisfies("^[virtuals=gl] osmesa"): cmake_args.extend( [ "-DVTK_USE_X:BOOL=OFF",