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
This commit is contained in:
Massimiliano Culpo 2024-05-21 17:18:14 +02:00 committed by Harmen Stoppels
parent 195bad8675
commit 5e580fc82e
13 changed files with 14 additions and 298 deletions

View file

@ -38,10 +38,9 @@ packages:
lapack: [openblas, amdlibflame] lapack: [openblas, amdlibflame]
libc: [glibc, musl] libc: [glibc, musl]
libgfortran: [ gcc-runtime ] libgfortran: [ gcc-runtime ]
libglx: [mesa+glx, mesa18+glx] libglx: [mesa+glx]
libifcore: [ intel-oneapi-runtime ] libifcore: [ intel-oneapi-runtime ]
libllvm: [llvm] libllvm: [llvm]
libosmesa: [mesa+osmesa, mesa18+osmesa]
lua-lang: [lua, lua-luajit-openresty, lua-luajit] lua-lang: [lua, lua-luajit-openresty, lua-luajit]
luajit: [lua-luajit-openresty, lua-luajit] luajit: [lua-luajit-openresty, lua-luajit]
mariadb-client: [mariadb-c-client, mariadb] mariadb-client: [mariadb-c-client, mariadb]

View file

@ -30,8 +30,6 @@ spack:
variants: +pic +xz variants: +pic +xz
mesa: mesa:
variants: ~llvm variants: ~llvm
mesa18:
variants: ~llvm
mpich: mpich:
variants: ~wrapperrpath netmod=ofi device=ch4 variants: ~wrapperrpath netmod=ofi device=ch4
ncurses: ncurses:

View file

@ -30,8 +30,6 @@ spack:
variants: +pic +xz variants: +pic +xz
mesa: mesa:
variants: ~llvm variants: ~llvm
mesa18:
variants: ~llvm
mpich: mpich:
variants: ~wrapperrpath netmod=ofi device=ch4 variants: ~wrapperrpath netmod=ofi device=ch4
ncurses: ncurses:

View file

@ -12,8 +12,6 @@ spack:
- one_of: ['@1.14', '@1.12'] - one_of: ['@1.14', '@1.12']
mesa: mesa:
require: "+glx +osmesa +opengl ~opengles +llvm" require: "+glx +osmesa +opengl ~opengles +llvm"
libosmesa:
require: "mesa +osmesa"
libglx: libglx:
require: "mesa +glx" require: "mesa +glx"
ospray: ospray:

View file

@ -22,7 +22,6 @@ spack:
- conduit # ^hdf5+shared - conduit # ^hdf5+shared
- flux-core - flux-core
#- flux-sched #- flux-sched
#- glvis # ^mesa-glu@9.0.0 ^mesa18~llvm # same issue w/chai
- hypre - hypre
- lbann - lbann
- lvarray ~tests # per Spack issue #23192 # ~examples - lvarray ~tests # per Spack issue #23192 # ~examples

View file

@ -19,8 +19,6 @@ class Memsurfer(PythonPackage):
version("master", branch="master", submodules=True) version("master", branch="master", submodules=True)
version("develop", branch="develop", submodules=True) version("develop", branch="develop", submodules=True)
variant("osmesa", default=False, description="Enable OSMesa support (for VTK)")
extends("python") extends("python")
depends_on("python@3.7:", type=("build", "run")) depends_on("python@3.7:", type=("build", "run"))
depends_on("py-setuptools", type="build") depends_on("py-setuptools", type="build")
@ -36,8 +34,6 @@ class Memsurfer(PythonPackage):
# vtk needs to know whether to build with mesa or opengl # 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@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 # memsurfer's setup needs path to these deps to build extension modules
def setup_build_environment(self, env): def setup_build_environment(self, env):

View file

@ -102,9 +102,7 @@ class Mesa(MesonPackage):
# Provides # Provides
provides("libglx", when="+glx") provides("libglx", when="+glx")
# provides('egl@1.5', when='+egl') # provides('egl@1.5', when='+egl')
provides("libosmesa", when="+osmesa")
# Variant dependencies # Variant dependencies
with when("+llvm"): with when("+llvm"):

View file

@ -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"
;;

View file

@ -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)

View file

@ -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)

View file

@ -13,20 +13,20 @@ class Osmesa(BundlePackage):
version("11.2.0") version("11.2.0")
depends_on("libosmesa") depends_on("mesa+osmesa")
provides("gl@4.5") provides("gl@4.5")
@property @property
def home(self): def home(self):
return self.spec["libosmesa"].home return self.spec["mesa"].home
@property @property
def headers(self): def headers(self):
return self.spec["libosmesa"].headers return self.spec["mesa"].package.libosmesa_headers
@property @property
def libs(self): def libs(self):
return self.spec["libosmesa"].libs return self.spec["mesa"].package.libosmesa_libs
@property @property
def gl_headers(self): def gl_headers(self):
@ -34,4 +34,4 @@ def gl_headers(self):
@property @property
def gl_libs(self): def gl_libs(self):
return self.spec["libosmesa"].libs return self.spec["mesa"].package.libosmesa_libs

View file

@ -109,12 +109,12 @@ class Visit(CMakePackage):
conflicts("+gui", when="+osmesa") conflicts("+gui", when="+osmesa")
depends_on("cmake@3.14.7:", type="build") depends_on("cmake@3.14.7:", type="build")
depends_on("mpi", when="+mpi") depends_on("mpi", when="+mpi")
requires("^[virtuals=gl] osmesa", when="+osmesa")
# VTK flavors # VTK flavors
depends_on("vtk@8.1:8 +opengl2") depends_on("vtk@8.1:8 +opengl2")
depends_on("vtk +osmesa", when="+osmesa")
depends_on("vtk +qt", when="+gui") depends_on("vtk +qt", when="+gui")
depends_on("vtk +python", when="+python") depends_on("vtk +python", when="+python")
depends_on("vtk +mpi", when="+mpi") 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("vtk", patches=[patch("vtk_wrapping_python_x11.patch")], when="+python ^vtk@8")
depends_on("glu") depends_on("glu")
depends_on("gl")
# VisIt doesn't work with later versions of qt. # VisIt doesn't work with later versions of qt.
depends_on("qt+gui+opengl@5:5.14", when="+gui") 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("VISIT_OSMESA_DIR", "IGNORE"),
self.define("OpenGL_GL_PREFERENCE", "LEGACY"), self.define("OpenGL_GL_PREFERENCE", "LEGACY"),
self.define("OPENGL_INCLUDE_DIR", spec["gl"].headers.directories[0]), 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]), 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]), 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: if "+hdf5" in spec:
args.append(self.define("HDF5_DIR", spec["hdf5"].prefix)) args.append(self.define("HDF5_DIR", spec["hdf5"].prefix))

View file

@ -51,7 +51,6 @@ class Vtk(CMakePackage):
# VTK7 defaults to OpenGL2 rendering backend # VTK7 defaults to OpenGL2 rendering backend
variant("opengl2", default=True, description="Enable OpenGL2 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("python", default=False, description="Enable Python support", when="@8:")
variant("qt", default=False, description="Build with support for Qt") variant("qt", default=False, description="Build with support for Qt")
variant("xdmf", default=False, description="Build XDMF file support") 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") patch("xdmf2-hdf51.13.2.patch", when="@9:9.2.2 +xdmf")
# We cannot build with both osmesa and qt in spack # We cannot build with both osmesa and qt in spack
conflicts("+osmesa", when="+qt") conflicts("^osmesa", when="+qt")
conflicts("%gcc@13", when="@9.2") 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_proj_include_no_strict.patch", when="@9: platform=windows")
patch("vtk_alias_hdf5.patch", when="@9: platform=windows") patch("vtk_alias_hdf5.patch", when="@9: platform=windows")
patch("vtk_findproj_config.patch", when="platform=windows") patch("vtk_findproj_config.patch", when="platform=windows")
with when("~osmesa"): depends_on("libxt", when="^[virtuals=gl] glx platform=linux")
depends_on("glx", when="platform=linux") depends_on("libxt", when="^[virtuals=gl] glx platform=cray")
depends_on("glx", when="platform=cray")
depends_on("libxt", when="platform=linux")
depends_on("libxt", when="platform=cray")
depends_on("osmesa", when="+osmesa")
# VTK will need Qt5OpenGL, and qt needs '-opengl' for that # VTK will need Qt5OpenGL, and qt needs '-opengl' for that
depends_on("qt+opengl", when="+qt") depends_on("qt+opengl", when="+qt")
@ -415,7 +409,7 @@ def cmake_args(self):
cmake_args.append("-DVTK_RENDERING_BACKEND:STRING=" + opengl_ver) cmake_args.append("-DVTK_RENDERING_BACKEND:STRING=" + opengl_ver)
if "+osmesa" in spec: if spec.satisfies("^[virtuals=gl] osmesa"):
cmake_args.extend( cmake_args.extend(
[ [
"-DVTK_USE_X:BOOL=OFF", "-DVTK_USE_X:BOOL=OFF",