Commit aa5b7c2f authored by Mark Florisson's avatar Mark Florisson

Don't fail if the C compiler is not found

parent acfbf762
...@@ -112,11 +112,23 @@ def get_openmp_compiler_flags(language): ...@@ -112,11 +112,23 @@ def get_openmp_compiler_flags(language):
try: try:
import subprocess import subprocess
except ImportError: except ImportError:
in_, out, err = os.popen(cc = " -v") try:
in_, out, err = os.popen(cc + " -v")
except EnvironmentError, e:
warnings.warn("Unable to find the %s compiler: %s: %s" %
(language, os.strerror(e.errno), cc))
return None
output = out.read() or err.read() output = out.read() or err.read()
else: else:
p = subprocess.Popen([cc, "-v"], stdout=subprocess.PIPE, try:
stderr=subprocess.STDOUT) p = subprocess.Popen([cc, "-v"], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
except EnvironmentError, e:
warnings.warn("Unable to find the %s compiler: %s: %s" %
(language, os.strerror(e.errno), cc))
return None
output = p.stdout.read() output = p.stdout.read()
compiler_version = matcher(output).group(1) compiler_version = matcher(output).group(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment