diff options
author | Seth R. Johnson <johnsonsr@ornl.gov> | 2020-02-11 15:00:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 14:00:02 -0600 |
commit | 5c33f638d7278602728c04e16ff2486f479b8575 (patch) | |
tree | f9151eaac294ee764c8b2715cc90ba8b6c601669 | |
parent | e8b6c40b316358b01eec3e84c45bc7aab6071b64 (diff) | |
download | spack-5c33f638d7278602728c04e16ff2486f479b8575.tar.gz spack-5c33f638d7278602728c04e16ff2486f479b8575.tar.bz2 spack-5c33f638d7278602728c04e16ff2486f479b8575.tar.xz spack-5c33f638d7278602728c04e16ff2486f479b8575.zip |
Fix QT4 platform detection for linux clang (#14891)
* Fix QT4 platform name for linux clang
* Fix clang compiler flags on QT4
-rw-r--r-- | var/spack/repos/builtin/packages/qt/package.py | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 1bc0f1df93..3753f4166c 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -5,6 +5,8 @@ from spack import * from spack.operating_systems.mac_os import macos_version +import llnl.util.tty as tty +import itertools import os import sys @@ -18,6 +20,7 @@ class Qt(Package): url = 'http://download.qt.io/archive/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz' list_url = 'http://download.qt.io/archive/qt/' list_depth = 3 + maintainers = ['sethrj'] phases = ['configure', 'build', 'install'] @@ -178,7 +181,9 @@ class Qt(Package): use_xcode = True # Mapping for compilers/systems in the QT 'mkspecs' - compiler_mapping = {'intel': 'icc', 'clang': 'clang-libc++', 'gcc': 'g++'} + compiler_mapping = {'intel': ('icc',), + 'clang': ('clang-libc++', 'clang'), + 'gcc': ('g++',)} platform_mapping = {'darwin': 'macx'} def url_for_version(self, version): @@ -235,17 +240,26 @@ class Qt(Package): """ spec = self.spec cname = spec.compiler.name - cname = self.compiler_mapping.get(cname, cname) pname = spec.architecture.platform + + # Transform spack compiler name to a list of possible QT compilers + cnames = self.compiler_mapping.get(cname, [cname]) + # Transform platform name to match those in QT pname = self.platform_mapping.get(pname, pname) qtplat = None mkspec_dir = 'qtbase/mkspecs' if spec.satisfies('@5:') else 'mkspecs' - for subdir in ('', 'unsupported'): + for subdir, cname in itertools.product(('', 'unsupported/'), cnames): platdirname = "".join([subdir, pname, "-", cname]) + tty.debug("Checking for platform '{0}' in {1}".format( + platdirname, mkspec_dir)) if os.path.exists(os.path.join(mkspec_dir, platdirname)): qtplat = platdirname break + else: + tty.warn("No matching QT platform was found in {0} " + "for platform '{1}' and compiler {2}".format( + mkspec_dir, pname, ",".join(cnames))) return (mkspec_dir, qtplat) @@ -341,6 +355,14 @@ class Qt(Package): with open(conf_file, 'a') as f: f.write("QMAKE_CXXFLAGS += -std=gnu++98\n") + @when('@4 %clang') + def patch(self): + (mkspec_dir, platform) = self.get_mkspec() + conf_file = os.path.join(mkspec_dir, platform, "qmake.conf") + + with open(conf_file, 'a') as f: + f.write("QMAKE_CXXFLAGS += -std=gnu++98\n") + @property def common_config_args(self): # incomplete list is here http://doc.qt.io/qt-5/configure-options.html |