diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-06-20 14:07:01 -0400 |
---|---|---|
committer | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-06-24 14:06:32 -0400 |
commit | 5b109c9ad27aea39ce49d1da8ef0c957ccaef3b9 (patch) | |
tree | 5c28afec73ad304f9e27e6a873492adb39b94139 /mesonbuild/compilers | |
parent | 59e5ad66f2017e17692d64e2aa7d745ea3fe849d (diff) | |
download | meson-5b109c9ad27aea39ce49d1da8ef0c957ccaef3b9.zip meson-5b109c9ad27aea39ce49d1da8ef0c957ccaef3b9.tar.gz meson-5b109c9ad27aea39ce49d1da8ef0c957ccaef3b9.tar.bz2 |
correct missing argument for IntelClFortranCompiler
ifort passes all tests
cleanup logic
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/fortran.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index fe23b6b..244e6f6 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -65,10 +65,13 @@ class FortranCompiler(CLikeCompiler, Compiler): extra_flags = environment.coredata.get_external_args(self.for_machine, self.language) extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language) extra_flags += self.get_always_args() - # %% build the test executable - pc = subprocess.Popen(self.exelist + extra_flags + [str(source_name), '-o', str(binary_name)]) - pc.wait() - if pc.returncode != 0: + # %% build the test executable "sanitycheckf" + # cwd=work_dir is necessary on Windows especially for Intel compilers to avoid error: cannot write on sanitycheckf.obj + # this is a defect with how Windows handles files and ifort's object file-writing behavior vis concurrent ProcessPoolExecutor. + # This simple workaround solves the issue. + returncode = subprocess.run(self.exelist + extra_flags + [str(source_name), '-o', str(binary_name)], + cwd=work_dir).returncode + if returncode != 0: raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string()) if self.is_cross: if self.exe_wrapper is None: @@ -79,9 +82,8 @@ class FortranCompiler(CLikeCompiler, Compiler): cmdlist = [str(binary_name)] # %% Run the test executable try: - pe = subprocess.Popen(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - pe.wait() - if pe.returncode != 0: + returncode = subprocess.run(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode + if returncode != 0: raise EnvironmentException('Executables created by Fortran compiler %s are not runnable.' % self.name_string()) except OSError: raise EnvironmentException('Executables created by Fortran compiler %s are not runnable.' % self.name_string()) @@ -271,8 +273,8 @@ class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler): 'custom': [], } - def __init__(self, exelist, version, is_cross, target: str, exe_wrapper=None): - FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) + def __init__(self, exelist, for_machine: MachineChoice, version, is_cross, target: str, exe_wrapper=None): + FortranCompiler.__init__(self, exelist, for_machine, version, is_cross, exe_wrapper) IntelVisualStudioLikeCompiler.__init__(self, target) default_warn_args = ['/warn:general', '/warn:truncated_source'] |