mesa: Retire older autotools mesa as mesa18 and create current meson mesa (#19528)
This commit is contained in:
parent
6a381940ae
commit
aaa1afe9ec
@ -23,8 +23,8 @@ packages:
|
|||||||
daal: [intel-daal]
|
daal: [intel-daal]
|
||||||
elf: [elfutils]
|
elf: [elfutils]
|
||||||
fftw-api: [fftw]
|
fftw-api: [fftw]
|
||||||
gl: [mesa+opengl, opengl]
|
gl: [mesa+opengl, mesa18+opengl, opengl]
|
||||||
glx: [mesa+glx, opengl]
|
glx: [mesa+glx, mesa18+glx, opengl]
|
||||||
glu: [mesa-glu, openglu]
|
glu: [mesa-glu, openglu]
|
||||||
golang: [gcc]
|
golang: [gcc]
|
||||||
iconv: [libiconv]
|
iconv: [libiconv]
|
||||||
@ -38,6 +38,7 @@ packages:
|
|||||||
mpi: [openmpi, mpich]
|
mpi: [openmpi, mpich]
|
||||||
mysql-client: [mysql, mariadb-c-client]
|
mysql-client: [mysql, mariadb-c-client]
|
||||||
opencl: [pocl]
|
opencl: [pocl]
|
||||||
|
osmesa: [mesa+osmesa, mesa18+osmesa]
|
||||||
pil: [py-pillow]
|
pil: [py-pillow]
|
||||||
pkgconfig: [pkgconf, pkg-config]
|
pkgconfig: [pkgconf, pkg-config]
|
||||||
rpc: [libtirpc]
|
rpc: [libtirpc]
|
||||||
|
@ -70,7 +70,7 @@ class Catalyst(CMakePackage):
|
|||||||
depends_on('py-mpi4py', when='+python3+mpi', type=('build', 'run'))
|
depends_on('py-mpi4py', when='+python3+mpi', type=('build', 'run'))
|
||||||
|
|
||||||
depends_on('gl@3.2:', when='+rendering')
|
depends_on('gl@3.2:', when='+rendering')
|
||||||
depends_on('mesa+osmesa', when='+rendering+osmesa')
|
depends_on('osmesa', when='+rendering+osmesa')
|
||||||
depends_on('glx', when='+rendering~osmesa')
|
depends_on('glx', when='+rendering~osmesa')
|
||||||
depends_on('cmake@3.3:', type='build')
|
depends_on('cmake@3.3:', type='build')
|
||||||
|
|
||||||
|
@ -8,41 +8,34 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
class Mesa(AutotoolsPackage):
|
class Mesa(MesonPackage):
|
||||||
"""Mesa is an open-source implementation of the OpenGL specification
|
"""Mesa is an open-source implementation of the OpenGL specification
|
||||||
- a system for rendering interactive 3D graphics."""
|
- a system for rendering interactive 3D graphics."""
|
||||||
|
|
||||||
homepage = "http://www.mesa3d.org"
|
homepage = "http://www.mesa3d.org"
|
||||||
maintainers = ['v-dobrev']
|
maintainers = ['chuckatkins', 'v-dobrev']
|
||||||
|
|
||||||
# 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"
|
git = "https://gitlab.freedesktop.org/mesa/mesa.git"
|
||||||
|
url = "https://archive.mesa3d.org/mesa-20.2.1.tar.xz"
|
||||||
|
|
||||||
version('18.3.6', tag='mesa-18.3.6', preferred=True)
|
version('master', tag='master')
|
||||||
|
version('20.2.1', sha256='d1a46d9a3f291bc0e0374600bdcb59844fa3eafaa50398e472a36fc65fd0244a')
|
||||||
|
|
||||||
|
depends_on('meson@0.52:', type='build')
|
||||||
|
|
||||||
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('pkgconfig', type='build')
|
||||||
depends_on('binutils', when=(sys.platform != 'darwin'), type='build')
|
depends_on('binutils', when=(sys.platform != 'darwin'), type='build')
|
||||||
depends_on('bison', type='build')
|
depends_on('bison', type='build')
|
||||||
depends_on('flex', type='build')
|
depends_on('flex', type='build')
|
||||||
depends_on('gettext', type='build')
|
depends_on('gettext', type='build')
|
||||||
depends_on('pkgconfig', type='build')
|
depends_on('python@3:', type='build')
|
||||||
depends_on('python', type='build')
|
|
||||||
depends_on('py-mako@0.8.0:', type='build')
|
depends_on('py-mako@0.8.0:', type='build')
|
||||||
depends_on('libxml2')
|
|
||||||
depends_on('zlib')
|
|
||||||
depends_on('expat')
|
|
||||||
depends_on('ncurses+termlib')
|
|
||||||
|
|
||||||
# Internal options
|
# Internal options
|
||||||
variant('llvm', default=True, description="Enable LLVM.")
|
variant('llvm', default=True, description="Enable LLVM.")
|
||||||
variant('swr', values=any_combination_of('avx', 'avx2', 'knl', 'skx'),
|
variant('swr', default='auto',
|
||||||
|
values=('auto', 'none', 'avx', 'avx2', 'knl', 'skx'),
|
||||||
|
multi=True,
|
||||||
description="Enable the SWR driver.")
|
description="Enable the SWR driver.")
|
||||||
# conflicts('~llvm', when='~swr=none')
|
# conflicts('~llvm', when='~swr=none')
|
||||||
|
|
||||||
@ -68,98 +61,89 @@ class Mesa(AutotoolsPackage):
|
|||||||
provides('gl@4.5', when='+opengl')
|
provides('gl@4.5', when='+opengl')
|
||||||
provides('glx@1.4', when='+glx')
|
provides('glx@1.4', when='+glx')
|
||||||
# provides('egl@1.5', when='+egl')
|
# provides('egl@1.5', when='+egl')
|
||||||
|
provides('osmesa', when='+osmesa')
|
||||||
|
|
||||||
# Variant dependencies
|
# Variant dependencies
|
||||||
depends_on('llvm@6:10', when='+llvm')
|
depends_on('llvm@6:', when='+llvm')
|
||||||
depends_on('libx11', when='+glx')
|
depends_on('libx11', when='+glx')
|
||||||
depends_on('libxcb', when='+glx')
|
depends_on('libxcb', when='+glx')
|
||||||
depends_on('libxext', 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', type='build')
|
depends_on('glproto@1.4.14:', when='+glx', type='build')
|
||||||
|
|
||||||
# Prevent an unnecessary xcb-dri dependency
|
def meson_args(self):
|
||||||
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 autoreconf(self, spec, prefix):
|
|
||||||
which('autoreconf')('--force', '--verbose', '--install')
|
|
||||||
|
|
||||||
def configure_args(self):
|
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
args = [
|
args = [
|
||||||
'LDFLAGS={0}'.format(self.spec['ncurses'].libs.search_flags),
|
'-Dvulkan-drivers=',
|
||||||
'--enable-shared',
|
'-Dgallium-vdpau=disabled',
|
||||||
'--disable-static',
|
'-Dgallium-xvmc=disabled',
|
||||||
'--disable-libglvnd',
|
'-Dgallium-omx=disabled',
|
||||||
'--disable-nine',
|
'-Dgallium-va=disabled',
|
||||||
'--disable-omx-bellagio',
|
'-Dgallium-xa=disabled',
|
||||||
'--disable-omx-tizonia',
|
'-Dgallium-nine=false',
|
||||||
'--disable-opencl',
|
'-Dgallium-opencl=disabled',
|
||||||
'--disable-opencl-icd',
|
'-Dbuild-tests=false',
|
||||||
'--disable-va',
|
'-Dglvnd=false']
|
||||||
'--disable-vdpau',
|
|
||||||
'--disable-xa',
|
|
||||||
'--disable-xvmc',
|
|
||||||
'--disable-osmesa',
|
|
||||||
'--with-vulkan-drivers=']
|
|
||||||
args_platforms = []
|
args_platforms = []
|
||||||
args_gallium_drivers = ['swrast']
|
args_gallium_drivers = ['swrast']
|
||||||
args_dri_drivers = []
|
args_dri_drivers = []
|
||||||
|
|
||||||
|
opt_enable = lambda c, o: '-D%s=%sabled' % (o, 'en' if c else 'dis')
|
||||||
|
opt_bool = lambda c, o: '-D%s=%s' % (o, str(c).lower())
|
||||||
if spec.target.family == 'arm' or spec.target.family == 'aarch64':
|
if spec.target.family == 'arm' or spec.target.family == 'aarch64':
|
||||||
args.append('--disable-libunwind')
|
args.append('-Dlibunwind=disabled')
|
||||||
|
|
||||||
num_frontends = 0
|
num_frontends = 0
|
||||||
if '+osmesa' in spec:
|
if '+osmesa' in spec:
|
||||||
num_frontends += 1
|
num_frontends += 1
|
||||||
args.append('--enable-gallium-osmesa')
|
args.append('-Dosmesa=gallium')
|
||||||
else:
|
else:
|
||||||
args.append('--disable-gallium-osmesa')
|
args.append('-Dosmesa=none')
|
||||||
|
|
||||||
if '+glx' in spec:
|
if '+glx' in spec:
|
||||||
num_frontends += 1
|
num_frontends += 1
|
||||||
if '+egl' in spec:
|
if '+egl' in spec:
|
||||||
args.append('--enable-glx=dri')
|
args.append('-Dglx=dri')
|
||||||
else:
|
else:
|
||||||
args.append('--enable-glx=gallium-xlib')
|
args.append('-Dglx=gallium-xlib')
|
||||||
args_platforms.append('x11')
|
args_platforms.append('x11')
|
||||||
else:
|
else:
|
||||||
args.append('--disable-glx')
|
args.append('-Dglx=disabled')
|
||||||
|
|
||||||
if '+egl' in spec:
|
if '+egl' in spec:
|
||||||
num_frontends += 1
|
num_frontends += 1
|
||||||
args.extend(['--enable-egl', '--enable-gbm', '--enable-dri'])
|
args.extend(['-Degl=enabled', '-Dgbm=enabled', '-Ddri3=enabled'])
|
||||||
args_platforms.append('surfaceless')
|
args_platforms.append('surfaceless')
|
||||||
else:
|
else:
|
||||||
args.extend(['--disable-egl', '--disable-gbm', '--disable-dri'])
|
args.extend(
|
||||||
|
['-Degl=disabled', '-Dgbm=disabled', '-Ddri3=disabled'])
|
||||||
|
|
||||||
if '+opengl' in spec:
|
args.append(opt_bool('+opengl' in spec, 'opengl'))
|
||||||
args.append('--enable-opengl')
|
args.append(opt_enable('+opengles' in spec, 'gles1'))
|
||||||
else:
|
args.append(opt_enable('+opengles' in spec, 'gles2'))
|
||||||
args.append('--disable-opengl')
|
|
||||||
|
|
||||||
if '+opengles' in spec:
|
args.append(opt_enable(num_frontends > 1, 'shared-glapi'))
|
||||||
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:
|
if '+llvm' in spec:
|
||||||
args.append('--enable-llvm')
|
args.append('-Dllvm=enabled')
|
||||||
args.append('--with-llvm-prefix=%s' % spec['llvm'].prefix)
|
args.append(opt_enable(
|
||||||
if '+link_dylib' in spec['llvm']:
|
'+link_dylib' in spec['llvm'], 'shared-llvm'))
|
||||||
args.append('--enable-llvm-shared-libs')
|
|
||||||
else:
|
else:
|
||||||
args.append('--disable-llvm-shared-libs')
|
args.append('-Dllvm=disabled')
|
||||||
else:
|
|
||||||
args.append('--disable-llvm')
|
|
||||||
|
|
||||||
args_swr_arches = []
|
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:
|
if 'swr=avx' in spec:
|
||||||
args_swr_arches.append('avx')
|
args_swr_arches.append('avx')
|
||||||
if 'swr=avx2' in spec:
|
if 'swr=avx2' in spec:
|
||||||
@ -168,24 +152,62 @@ def configure_args(self):
|
|||||||
args_swr_arches.append('knl')
|
args_swr_arches.append('knl')
|
||||||
if 'swr=skx' in spec:
|
if 'swr=skx' in spec:
|
||||||
args_swr_arches.append('skx')
|
args_swr_arches.append('skx')
|
||||||
|
|
||||||
if args_swr_arches:
|
if args_swr_arches:
|
||||||
if '+llvm' not in spec:
|
if '+llvm' not in spec:
|
||||||
raise SpecError('Variant swr requires +llvm')
|
raise SpecError('Variant swr requires +llvm')
|
||||||
args_gallium_drivers.append('swr')
|
args_gallium_drivers.append('swr')
|
||||||
args.append('--with-swr-archs=' + ','.join(args_swr_arches))
|
args.append('-Dswr-arches=' + ','.join(args_swr_arches))
|
||||||
|
|
||||||
# Add the remaining list args
|
# Add the remaining list args
|
||||||
args.append('--with-platforms=' + ','.join(args_platforms))
|
args.append('-Dplatforms=' + ','.join(args_platforms))
|
||||||
args.append('--with-gallium-drivers=' + ','.join(args_gallium_drivers))
|
args.append('-Dgallium-drivers=' + ','.join(args_gallium_drivers))
|
||||||
args.append('--with-dri-drivers=' + ','.join(args_dri_drivers))
|
args.append('-Ddri-drivers=' + ','.join(args_dri_drivers))
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def libs(self):
|
def libs(self):
|
||||||
for dir in ['lib64', 'lib']:
|
spec = self.spec
|
||||||
libs = find_libraries(['libGL', 'libOSMesa'],
|
libs_to_seek = set()
|
||||||
join_path(self.prefix, dir),
|
|
||||||
shared=True, recursive=False)
|
if '+osmesa' in spec:
|
||||||
if libs:
|
libs_to_seek.add('libOSMesa')
|
||||||
return libs
|
|
||||||
|
if '+glx' in spec:
|
||||||
|
libs_to_seek.add('libGL')
|
||||||
|
|
||||||
|
if '+opengl' in spec:
|
||||||
|
libs_to_seek.add('libGL')
|
||||||
|
|
||||||
|
if '+opengles' in spec:
|
||||||
|
libs_to_seek.add('libGLES')
|
||||||
|
libs_to_seek.add('libGLES2')
|
||||||
|
|
||||||
|
if libs_to_seek:
|
||||||
|
return find_libraries(list(libs_to_seek),
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
return LibraryList()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def osmesa_libs(self):
|
||||||
|
return find_libraries('libOSMesa',
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def glx_libs(self):
|
||||||
|
return find_libraries('libGL',
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gl_libs(self):
|
||||||
|
return find_libraries('libGL',
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
229
var/spack/repos/builtin/packages/mesa18/package.py
Normal file
229
var/spack/repos/builtin/packages/mesa18/package.py
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
# Copyright 2013-2020 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)
|
||||||
|
|
||||||
|
from spack import *
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
class Mesa18(AutotoolsPackage):
|
||||||
|
"""Mesa is an open-source implementation of the OpenGL specification
|
||||||
|
- a system for rendering interactive 3D graphics."""
|
||||||
|
|
||||||
|
homepage = "http://www.mesa3d.org"
|
||||||
|
maintainers = ['v-dobrev', 'chuckatkins']
|
||||||
|
|
||||||
|
# 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', preferred=True)
|
||||||
|
|
||||||
|
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', 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', type='build')
|
||||||
|
depends_on('py-mako@0.8.0:', type='build')
|
||||||
|
depends_on('libxml2')
|
||||||
|
depends_on('zlib')
|
||||||
|
depends_on('expat')
|
||||||
|
depends_on('ncurses+termlib')
|
||||||
|
|
||||||
|
# Internal options
|
||||||
|
variant('llvm', default=True, description="Enable LLVM.")
|
||||||
|
variant('swr', values=any_combination_of('avx', 'avx2', 'knl', 'skx'),
|
||||||
|
description="Enable the SWR driver.")
|
||||||
|
# conflicts('~llvm', when='~swr=none')
|
||||||
|
|
||||||
|
# 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.")
|
||||||
|
|
||||||
|
# TODO: effectively deal with EGL. The implications of this have not been
|
||||||
|
# worked through yet
|
||||||
|
# variant('egl', default=False, description="Enable the EGL frontend.")
|
||||||
|
|
||||||
|
# TODO: Effectively deal with hardware drivers
|
||||||
|
# The implication of this is enabling DRI, among other things, and
|
||||||
|
# needing to check which llvm targets were built (ptx or amdgpu, etc.)
|
||||||
|
|
||||||
|
# Back ends
|
||||||
|
variant('opengl', default=True, description="Enable full OpenGL support.")
|
||||||
|
variant('opengles', default=False, description="Enable OpenGL ES support.")
|
||||||
|
|
||||||
|
# Provides
|
||||||
|
provides('gl@4.5', when='+opengl')
|
||||||
|
provides('glx@1.4', when='+glx')
|
||||||
|
# provides('egl@1.5', when='+egl')
|
||||||
|
provides('osmesa', when='+osmesa')
|
||||||
|
|
||||||
|
# Variant dependencies
|
||||||
|
depends_on('llvm@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', type='build')
|
||||||
|
|
||||||
|
# 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 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=']
|
||||||
|
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
|
||||||
|
if '+egl' in spec:
|
||||||
|
args.append('--enable-glx=dri')
|
||||||
|
else:
|
||||||
|
args.append('--enable-glx=gallium-xlib')
|
||||||
|
args_platforms.append('x11')
|
||||||
|
else:
|
||||||
|
args.append('--disable-glx')
|
||||||
|
|
||||||
|
if '+egl' in spec:
|
||||||
|
num_frontends += 1
|
||||||
|
args.extend(['--enable-egl', '--enable-gbm', '--enable-dri'])
|
||||||
|
args_platforms.append('surfaceless')
|
||||||
|
else:
|
||||||
|
args.extend(['--disable-egl', '--disable-gbm', '--disable-dri'])
|
||||||
|
|
||||||
|
if '+opengl' in spec:
|
||||||
|
args.append('--enable-opengl')
|
||||||
|
else:
|
||||||
|
args.append('--disable-opengl')
|
||||||
|
|
||||||
|
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['llvm'].prefix)
|
||||||
|
if '+link_dylib' in spec['llvm']:
|
||||||
|
args.append('--enable-llvm-shared-libs')
|
||||||
|
else:
|
||||||
|
args.append('--disable-llvm-shared-libs')
|
||||||
|
else:
|
||||||
|
args.append('--disable-llvm')
|
||||||
|
|
||||||
|
args_swr_arches = []
|
||||||
|
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:
|
||||||
|
if '+llvm' not in spec:
|
||||||
|
raise SpecError('Variant swr requires +llvm')
|
||||||
|
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 '+osmesa' in spec:
|
||||||
|
libs_to_seek.add('libOSMesa')
|
||||||
|
|
||||||
|
if '+glx' in spec:
|
||||||
|
libs_to_seek.add('libGL')
|
||||||
|
|
||||||
|
if '+opengl' in spec:
|
||||||
|
libs_to_seek.add('libGL')
|
||||||
|
|
||||||
|
if '+opengles' in spec:
|
||||||
|
libs_to_seek.add('libGLES')
|
||||||
|
libs_to_seek.add('libGLES2')
|
||||||
|
|
||||||
|
if libs_to_seek:
|
||||||
|
return find_libraries(list(libs_to_seek),
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
return LibraryList()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def osmesa_libs(self):
|
||||||
|
return find_libraries('libOSMesa',
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def glx_libs(self):
|
||||||
|
return find_libraries('libGL',
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gl_libs(self):
|
||||||
|
return find_libraries('libGL',
|
||||||
|
root=self.spec.prefix,
|
||||||
|
shared='+shared' in self.spec,
|
||||||
|
recursive=True)
|
@ -95,7 +95,7 @@ class Paraview(CMakePackage, CudaPackage):
|
|||||||
depends_on('qt~opengl', when='@5.3.0:+qt~opengl2')
|
depends_on('qt~opengl', when='@5.3.0:+qt~opengl2')
|
||||||
depends_on('qt@:4', when='@:5.2.0+qt')
|
depends_on('qt@:4', when='@:5.2.0+qt')
|
||||||
|
|
||||||
depends_on('mesa+osmesa', when='+osmesa')
|
depends_on('osmesa', when='+osmesa')
|
||||||
depends_on('gl@3.2:', when='+opengl2')
|
depends_on('gl@3.2:', when='+opengl2')
|
||||||
depends_on('gl@1.2:', when='~opengl2')
|
depends_on('gl@1.2:', when='~opengl2')
|
||||||
depends_on('libxt', when='~osmesa platform=linux')
|
depends_on('libxt', when='~osmesa platform=linux')
|
||||||
|
@ -74,7 +74,7 @@ class Vtk(CMakePackage):
|
|||||||
|
|
||||||
# Note: it is recommended to use mesa+llvm, if possible.
|
# Note: it is recommended to use mesa+llvm, if possible.
|
||||||
# mesa default is software rendering, llvm makes it faster
|
# mesa default is software rendering, llvm makes it faster
|
||||||
depends_on('mesa+osmesa', when='+osmesa')
|
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')
|
||||||
|
Loading…
Reference in New Issue
Block a user