From 0427ba48e6e22be20f4c9cca526d4098f0af38ea Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 28 Sep 2018 10:01:49 -0700 Subject: [PATCH 01/16] dependencies/misc: Add openmp 5.0 preliminary support ICC 19 has openmp support, but it's 5.0 preliminary (rev 1, while rev 7 is current). It passes our tests though, so lets add it. Fixes: #4491 --- mesonbuild/dependencies/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index f220a8e68..1dab19c9d 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -235,6 +235,7 @@ class OpenMPDependency(ExternalDependency): # Map date of specification release (which is the macro value) to a version. VERSIONS = { '201811': '5.0', + '201611': '5.0-revision1', # This is supported by ICC 19.x '201511': '4.5', '201307': '4.0', '201107': '3.1', From 484fca9866f6b477a2ca30bb75be8a15de598e66 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 8 Oct 2018 15:40:15 -0700 Subject: [PATCH 02/16] compilers: Fix the set of features that ICC exposes --- mesonbuild/compilers/compilers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 85a84807a..ca8c09ca9 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1731,10 +1731,17 @@ class ArmclangCompiler: return ['--symdefs=' + implibname] -# Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1 +# Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0.0 class IntelCompiler(GnuLikeCompiler): def __init__(self, compiler_type): super().__init__(compiler_type) + # As of 19.0.0 ICC doesn't have sanitizer, color, or lto support. + # + # It does have IPO, which serves much the same purpose as LOT, but + # there is an unfortunate rule for using IPO (you can't control the + # name of the output file) which break assumptions meson makes + self.base_options = ['b_pch', 'b_lundef', 'b_asneeded', 'b_pgo', + 'b_coverage', 'b_ndebug', 'b_staticpic', 'b_pie'] self.id = 'intel' self.lang_header = 'none' From f2d503ca3416fc44eae5bed98ef0ab62773153c5 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 9 Oct 2018 16:11:02 -0700 Subject: [PATCH 03/16] unittests: don't run sanitizer tests for on compilers without sanitizer support This commit adds a nice decorator helper for skipping tests when they require the compiler to implement a specific base option, and uses it to turn off b_sanitize tests, which fixes some tests on ICC. --- run_unittests.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/run_unittests.py b/run_unittests.py index bc1173288..cdb04c0b7 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -144,6 +144,24 @@ def skip_if_env_value(value): return wrapped return wrapper +def skip_if_not_base_option(feature): + """Skip tests if The compiler does not support a given base option. + + for example, ICC doesn't currently support b_sanitize. + """ + def actual(f): + @functools.wraps(f) + def wrapped(*args, **kwargs): + env = get_fake_env('', '', '') + cc = env.detect_c_compiler(False) + if feature not in cc.base_options: + raise unittest.SkipTest( + '{} not available with {}'.format(feature, cc.id)) + return f(*args, **kwargs) + return wrapped + return actual + + class PatchModule: ''' Fancy monkey-patching! Whee! Can't use mock.patch because it only @@ -3522,6 +3540,7 @@ class LinuxlikeTests(BasePlatformTests): self.assertRegex('\n'.join(mesonlog), r'Dependency qt5 \(modules: Core\) found: YES 5.* \(pkg-config\)\n') + @skip_if_not_base_option('b_sanitize') def test_generate_gir_with_address_sanitizer(self): if is_cygwin(): raise unittest.SkipTest('asan not available on Cygwin') @@ -3984,6 +4003,7 @@ class LinuxlikeTests(BasePlatformTests): install_rpath = get_rpath(os.path.join(self.installdir, 'usr/bin/progcxx')) self.assertEqual(install_rpath, 'baz') + @skip_if_not_base_option('b_sanitize') def test_pch_with_address_sanitizer(self): if is_cygwin(): raise unittest.SkipTest('asan not available on Cygwin') From 80f8c9930c1cca060dceb0f79d58823e66ea63e3 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 8 Oct 2018 15:46:46 -0700 Subject: [PATCH 04/16] unittests: don't override LD_LIBRARY_PATH part of using ICC is configuring LD_LIBRARY_PATH so that you can link with several Intel specific .so's. Currently meson blanket overrides the LD_LIBRARARY_PATH in several tests which breaks them. Instead prepend the test dir td LD_LIBRARY_PATH. Fixes 6 tests with ICC. --- run_unittests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_unittests.py b/run_unittests.py index cdb04c0b7..e149dedf6 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3918,7 +3918,7 @@ class LinuxlikeTests(BasePlatformTests): # when all tests are run (but works when only this test is run), # but doing this explicitly works. env = os.environ.copy() - env['LD_LIBRARY_PATH'] = installed_libdir + env['LD_LIBRARY_PATH'] = ':'.join([installed_libdir, env.get('LD_LIBRARY_PATH', '')]) self.assertEqual(subprocess.call(installed_exe, env=env), 0) # Ensure that introspect --installed works installed = self.introspect('--installed') @@ -4119,7 +4119,7 @@ endian = 'little' self.init(testdir2) self.build() myenv = os.environ.copy() - myenv['LD_LIBRARY_PATH'] = lib_dir + myenv['LD_LIBRARY_PATH'] = ':'.join([lib_dir, myenv.get('LD_LIBRARY_PATH', '')]) if is_cygwin(): bin_dir = os.path.join(tempdirname, 'bin') myenv['PATH'] = bin_dir + os.pathsep + myenv['PATH'] From 21a7528b2fe3176445d918e921fe374acafb6de2 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 28 Sep 2018 10:08:14 -0700 Subject: [PATCH 05/16] compilers/c_function_attributes: fix for ICC ICC doesn't like the extra set of parens, GCC 8.2.1 and Clang 6.0.1 don't have a problem with this. --- mesonbuild/compilers/c_function_attributes.py | 8 ++++---- test cases/common/204 function attributes/meson.build | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mesonbuild/compilers/c_function_attributes.py b/mesonbuild/compilers/c_function_attributes.py index 9aeaaf202..a522a1a7d 100644 --- a/mesonbuild/compilers/c_function_attributes.py +++ b/mesonbuild/compilers/c_function_attributes.py @@ -91,10 +91,10 @@ C_FUNC_ATTRIBUTES = { 'used': 'int foo(void) __attribute__((used));', 'visibility': ''' - int foo_def(void) __attribute__((visibility(("default")))); - int foo_hid(void) __attribute__((visibility(("hidden")))); - int foo_int(void) __attribute__((visibility(("internal")))); - int foo_pro(void) __attribute__((visibility(("protected"))));''', + int foo_def(void) __attribute__((visibility("default"))); + int foo_hid(void) __attribute__((visibility("hidden"))); + int foo_int(void) __attribute__((visibility("internal"))); + int foo_pro(void) __attribute__((visibility("protected")));''', 'warning': 'int foo(void) __attribute__((warning("")));', 'warn_unused_result': diff --git a/test cases/common/204 function attributes/meson.build b/test cases/common/204 function attributes/meson.build index c906b4918..1e9380302 100644 --- a/test cases/common/204 function attributes/meson.build +++ b/test cases/common/204 function attributes/meson.build @@ -63,7 +63,7 @@ if host_machine.system() != 'darwin' attributes += 'visibility' endif -if c.get_id() == 'gcc' +if ['gcc', 'intel'].contains(c.get_id()) # not supported by clang as of 5.0.0 (at least up to 6.0.1) attributes += 'artificial' attributes += 'error' @@ -73,7 +73,7 @@ if c.get_id() == 'gcc' attributes += 'optimize' attributes += 'warning' - if c.version().version_compare('>= 7.0.0') + if c.get_id() == 'gcc' and c.version().version_compare('>= 7.0.0') attributes += 'fallthrough' endif endif From 28fd725d61bec363d9bcc403e78b38312dfeb276 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 9 Oct 2018 11:04:27 -0700 Subject: [PATCH 06/16] compilers: fix compiler.compile for Intel Compilers has_arguments is the wrong thing to fix, since all checks that require compiler options are based on compiles, it's the right thing to modify. --- mesonbuild/compilers/c.py | 8 ++++---- mesonbuild/compilers/compilers.py | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 1b198b645..240d424bf 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -410,12 +410,12 @@ class CCompiler(Compiler): dependencies=dependencies) def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'): - if callable(extra_args): - extra_args = extra_args(mode) if extra_args is None: extra_args = [] - elif isinstance(extra_args, str): - extra_args = [extra_args] + else: + extra_args = listify(extra_args) + extra_args = listify([e(mode) if callable(e) else e for e in extra_args]) + if dependencies is None: dependencies = [] elif not isinstance(dependencies, list): diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index ca8c09ca9..306e5d69b 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -19,7 +19,10 @@ from ..linkers import StaticLinker from .. import coredata from .. import mlog from .. import mesonlib -from ..mesonlib import EnvironmentException, MesonException, OrderedSet, version_compare, Popen_safe +from ..mesonlib import ( + EnvironmentException, MesonException, OrderedSet, version_compare, + Popen_safe +) """This file contains the data files of all compilers Meson knows about. To support a new compiler, add its information below. @@ -1733,6 +1736,7 @@ class ArmclangCompiler: # Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0.0 class IntelCompiler(GnuLikeCompiler): + def __init__(self, compiler_type): super().__init__(compiler_type) # As of 19.0.0 ICC doesn't have sanitizer, color, or lto support. @@ -1764,9 +1768,16 @@ class IntelCompiler(GnuLikeCompiler): else: return ['-openmp'] - def has_arguments(self, args, env, code, mode): - # -diag-error 10148 is required to catch invalid -W options - return super().has_arguments(args + ['-diag-error', '10006', '-diag-error', '10148'], env, code, mode) + def compiles(self, *args, **kwargs): + # This covers a case that .get('foo', []) doesn't, that extra_args is + # defined and is None + extra_args = kwargs.get('extra_args') or [] + kwargs['extra_args'] = [ + extra_args, + '-diag-error', '10006', # ignoring unknown option + '-diag-error', '10148', # Option not supported + ] + return super().compiles(*args, **kwargs) class ArmCompiler: From 7329ae3ce62ef525ea269adbfd95aad07d484abb Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 10 Oct 2018 09:42:20 -0700 Subject: [PATCH 07/16] fortran: ifort doesn't have -pipe --- mesonbuild/compilers/fortran.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 23c489200..8eea4e745 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -342,6 +342,12 @@ class IntelFortranCompiler(IntelCompiler, FortranCompiler): def get_preprocess_only_args(self): return ['-cpp', '-EP'] + def get_always_args(self): + """Ifort doesn't have -pipe.""" + val = super().get_always_args() + val.remove('-pipe') + return val + class PathScaleFortranCompiler(FortranCompiler): def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags): From f46adb44bf7eeeb15ddaed81f73433b5e7a3bff6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 10 Oct 2018 10:17:55 -0700 Subject: [PATCH 08/16] compilers: Enable PGO for ICC ICC doesn't use the same -fprofile-generate/-fprofile-use that GCC and Clang use, instead it has -prof-gen and -prof-use. I've gone ahead and added the threadsafe option to -prof-gen, as meson currently doesn't have a way to specify that level of granularity and GCC and Clang's profiles are threadsafe. --- mesonbuild/compilers/compilers.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 306e5d69b..755bd4640 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -457,9 +457,9 @@ def get_base_compile_args(options, compiler): try: pgo_val = options['b_pgo'].value if pgo_val == 'generate': - args.append('-fprofile-generate') + args.extend(compiler.get_profile_generate_args()) elif pgo_val == 'use': - args.extend(['-fprofile-use', '-fprofile-correction']) + args.extend(compiler.get_profile_use_args()) except KeyError: pass try: @@ -503,9 +503,9 @@ def get_base_link_args(options, linker, is_shared_module): try: pgo_val = options['b_pgo'].value if pgo_val == 'generate': - args.append('-fprofile-generate') + args.extend(linker.get_profile_generate_args()) elif pgo_val == 'use': - args.extend(['-fprofile-use', '-fprofile-correction']) + args.extend(linker.get_profile_use_args()) except KeyError: pass try: @@ -674,7 +674,6 @@ class CompilerArgs(list): to recursively search for symbols in the libraries. This is not needed with other linkers. ''' - # A standalone argument must never be deduplicated because it is # defined by what comes _after_ it. Thus dedupping this: # -D FOO -D BAR @@ -1258,6 +1257,14 @@ class Compiler: """ return 'other' + def get_profile_generate_args(self): + raise EnvironmentException( + '%s does not support get_profile_generate_args ' % self.get_id()) + + def get_profile_use_args(self): + raise EnvironmentException( + '%s does not support get_profile_use_args ' % self.get_id()) + @enum.unique class CompilerType(enum.Enum): @@ -1498,6 +1505,12 @@ class GnuLikeCompiler(abc.ABC): def get_argument_syntax(self): return 'gcc' + def get_profile_generate_args(self): + return ['-fprofile-generate'] + + def get_profile_use_args(self): + return ['-fprofile-use', '-fprofile-correction'] + class GnuCompiler(GnuLikeCompiler): """ @@ -1779,6 +1792,12 @@ class IntelCompiler(GnuLikeCompiler): ] return super().compiles(*args, **kwargs) + def get_profile_generate_args(self): + return ['-prof-gen=threadsafe'] + + def get_profile_use_args(self): + return ['-prof-use'] + class ArmCompiler: # Functionality that is common to all ARM family compilers. From 3ab9620180b1f6506a7a3486044db236afbfafba Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 10 Oct 2018 11:42:35 -0700 Subject: [PATCH 09/16] compilers: Add ICC setting for get_allow_undefined_link_args --- mesonbuild/compilers/c.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 240d424bf..393354d36 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -174,6 +174,8 @@ class CCompiler(Compiler): elif isinstance(self, VisualStudioCCompiler): # link.exe return ['/FORCE:UNRESOLVED'] + elif self.id == 'intel': + return ['-Wl,--allow-shlib-undefined'] # FIXME: implement other linkers return [] From 315d07d3062718b270ee90f0970d66715716fdb6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 10 Oct 2018 12:50:54 -0700 Subject: [PATCH 10/16] compilers: Set the correct values for undefined modules on apple with icc --- mesonbuild/compilers/c.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 393354d36..bc90381d1 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -175,7 +175,11 @@ class CCompiler(Compiler): # link.exe return ['/FORCE:UNRESOLVED'] elif self.id == 'intel': - return ['-Wl,--allow-shlib-undefined'] + if self.compiler_type.is_osx_compiler: + # Apple ld + return ['-Wl,-undefined,dynamic_lookup'] + else: + return ['-Wl,--allow-shlib-undefined'] # FIXME: implement other linkers return [] From a480de1cb55c9efa88a9a520d0d776743b4e5664 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 10 Oct 2018 13:36:23 -0700 Subject: [PATCH 11/16] compilers: ICC should error when an unknown __attribute__ is tested --- mesonbuild/compilers/compilers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 755bd4640..3d53f27e8 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1789,6 +1789,7 @@ class IntelCompiler(GnuLikeCompiler): extra_args, '-diag-error', '10006', # ignoring unknown option '-diag-error', '10148', # Option not supported + '-diag-error', '1292', # unknown __attribute__ ] return super().compiles(*args, **kwargs) From 9f9cfd21396db5cd5eb1711916c8b0c6e433c702 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Sat, 13 Oct 2018 20:00:38 -0700 Subject: [PATCH 12/16] compilers: Move get_allow_undefined_link_args to Compiler This allows each implementation (gnu-like) and msvc to be implemented in their respective classes rather than through an if tree in the CCompiler class. This is cleaner abstraction and allows us to clean up the Fortran compiler, which was calling CCompiler bound methods without an instance. --- mesonbuild/compilers/c.py | 32 ++++++------------------------- mesonbuild/compilers/compilers.py | 14 ++++++++++++++ mesonbuild/compilers/fortran.py | 3 --- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index bc90381d1..9a2d7dbc6 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -157,32 +157,6 @@ class CCompiler(Compiler): ''' return self.get_no_optimization_args() - def get_allow_undefined_link_args(self): - ''' - Get args for allowing undefined symbols when linking to a shared library - ''' - if self.id in ('clang', 'gcc'): - if self.compiler_type.is_osx_compiler: - # Apple ld - return ['-Wl,-undefined,dynamic_lookup'] - elif self.compiler_type.is_windows_compiler: - # For PE/COFF this is impossible - return [] - else: - # GNU ld and LLVM lld - return ['-Wl,--allow-shlib-undefined'] - elif isinstance(self, VisualStudioCCompiler): - # link.exe - return ['/FORCE:UNRESOLVED'] - elif self.id == 'intel': - if self.compiler_type.is_osx_compiler: - # Apple ld - return ['-Wl,-undefined,dynamic_lookup'] - else: - return ['-Wl,--allow-shlib-undefined'] - # FIXME: implement other linkers - return [] - def get_output_args(self, target): return ['-o', target] @@ -1600,11 +1574,17 @@ class VisualStudioCCompiler(CCompiler): def get_argument_syntax(self): return 'msvc' + def get_allow_undefined_link_args(self): + # link.exe + return ['/FORCE:UNRESOLVED'] + + class ClangClCCompiler(VisualStudioCCompiler): def __init__(self, exelist, version, is_cross, exe_wrap, is_64): super().__init__(exelist, version, is_cross, exe_wrap, is_64) self.id = 'clang-cl' + class ArmCCompiler(ArmCompiler, CCompiler): def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 3d53f27e8..f464ec85f 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1265,6 +1265,12 @@ class Compiler: raise EnvironmentException( '%s does not support get_profile_use_args ' % self.get_id()) + def get_undefined_link_args(self): + ''' + Get args for allowing undefined symbols when linking to a shared library + ''' + return [] + @enum.unique class CompilerType(enum.Enum): @@ -1511,6 +1517,14 @@ class GnuLikeCompiler(abc.ABC): def get_profile_use_args(self): return ['-fprofile-use', '-fprofile-correction'] + def get_allow_undefined_link_args(self): + if self.compiler_type.is_osx_compiler: + # Apple ld + return ['-Wl,-undefined,dynamic_lookup'] + else: + # GNU ld and LLVM lld + return ['-Wl,--allow-shlib-undefined'] + class GnuCompiler(GnuLikeCompiler): """ diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 8eea4e745..0afdfdf82 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -144,9 +144,6 @@ end program prog def get_compiler_check_args(self): return CCompiler.get_compiler_check_args(self) - def get_allow_undefined_link_args(self): - return CCompiler.get_allow_undefined_link_args(self) - def get_output_args(self, target): return CCompiler.get_output_args(self, target) From a7845d91aa896c22d0b09e2f25d393bbfe5e9553 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 18 Oct 2018 13:53:40 -0700 Subject: [PATCH 13/16] ifort: ifort needs to have -lifcore like gfotran needs -lgfortran --- mesonbuild/compilers/fortran.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 0afdfdf82..fe25067d6 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -345,6 +345,9 @@ class IntelFortranCompiler(IntelCompiler, FortranCompiler): val.remove('-pipe') return val + def language_stdlib_only_link_flags(self): + return ['-lifcore', '-limf'] + class PathScaleFortranCompiler(FortranCompiler): def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags): From b17ab09eaf049bb4ce002419ec29cf1192bf7c57 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 18 Oct 2018 14:23:52 -0700 Subject: [PATCH 14/16] compilers/fortran: pass -module ${path} instead of -module${path} ifort doesn't like the latter, and gfortran seems happy with the former. I don't have any of the other supported fortran compilers to test with. --- mesonbuild/compilers/fortran.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index fe25067d6..75db26d5b 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -169,7 +169,7 @@ end program prog return ('-I', ) def get_module_outdir_args(self, path): - return ['-module' + path] + return ['-module', path] def module_name_to_filename(self, module_name): return module_name.lower() + '.mod' From 64107f5fe1c5a27762d7ff6ff770c0298c40e3b8 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 18 Oct 2018 14:04:30 -0700 Subject: [PATCH 15/16] tests: Fix fortran + cpp test for ifort To make ifort like rand we need to link with ifport, or we don't get rand. --- test cases/fortran/9 cpp/meson.build | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test cases/fortran/9 cpp/meson.build b/test cases/fortran/9 cpp/meson.build index 49497c07d..93037aa1b 100644 --- a/test cases/fortran/9 cpp/meson.build +++ b/test cases/fortran/9 cpp/meson.build @@ -6,5 +6,16 @@ if cpp.get_id() == 'clang' error('MESON_SKIP_TEST Clang C++ does not find -lgfortran for some reason.') endif -e = executable('cppfort', 'main.cpp', 'fortran.f') +fc = meson.get_compiler('fortran') +link_with = [] +if fc.get_id() == 'intel' + link_with += fc.find_library('ifport') +endif + +e = executable( + 'cppfort', + ['main.cpp', 'fortran.f'], + dependencies : [link_with], +) + test('C++ FORTRAN', e) From 842d8556ecc873abf3c580b725bb8d1fe5230246 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 12 Nov 2018 16:32:56 -0800 Subject: [PATCH 16/16] compilers: quiet ICC messages about pch These are useful for debugging, but not interesting for end users, where it just adds lines between ninja jobs without adding value. --- mesonbuild/compilers/c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 9a2d7dbc6..4a79ca0c5 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -1245,7 +1245,7 @@ class IntelCCompiler(IntelCompiler, CCompiler): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) IntelCompiler.__init__(self, compiler_type) self.lang_header = 'c-header' - default_warn_args = ['-Wall', '-w3', '-diag-disable:remark', '-Wpch-messages'] + default_warn_args = ['-Wall', '-w3', '-diag-disable:remark'] self.warn_args = {'1': default_warn_args, '2': default_warn_args + ['-Wextra'], '3': default_warn_args + ['-Wextra']}