Update gl/qt options for vtk package (#6551)

This provides options for hardware and software rendering with the
gl API and updates the vtk package to make use of those options:

* Create new "gl" virtual package, provided by mesa
* Add external-only "opengl" package, which represents a system
  install that provides gl
* For vtk: prefer system gl implementation by default to get speed
  up from hardware rendering. When software rendering is specifically
  requested (+osmesa), try to use the llvmpipe approach, as it is
  much faster.
* Make qt dependency optional for vtk
* Add basic support for VTK on osx
* qt: Depend on virtual gl package, rather than mesa impl
This commit is contained in:
Scott Wittenburg
2018-01-22 11:46:44 -07:00
committed by scheibelp
parent 55c3451b87
commit d2c3441527
5 changed files with 168 additions and 22 deletions

View File

@@ -0,0 +1,58 @@
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class Opengl(Package):
"""Placeholder for external OpenGL libraries from hardware vendors"""
homepage = "https://www.opengl.org/"
url = "https://www.opengl.org/"
version('3.2', 'N/A')
provides('gl@:4.5', when='@4.5:')
provides('gl@:4.4', when='@4.4:')
provides('gl@:4.3', when='@4.3:')
def install(self, spec, prefix):
msg = """This package is intended to be a placeholder for
system-provided OpenGL libraries from hardware vendors. Please
download and install OpenGL drivers/libraries for your graphics
hardware separately, and then set that up as an external package.
An example of a working packages.yaml:
packages:
opengl:
paths:
opengl@4.5.0: /opt/opengl
buildable: False
In that case, /opt/opengl/ should contain these two folders:
include/GL/ (opengl headers, including "gl.h")
lib (opengl libraries, including "libGL.so")"""
raise InstallError(msg)