diff --git a/tensorflow/tools/ci_build/linux/mkl/set-build-env.py b/tensorflow/tools/ci_build/linux/mkl/set-build-env.py index ba19c6174b7b55..1c6f1dffde239d 100755 --- a/tensorflow/tools/ci_build/linux/mkl/set-build-env.py +++ b/tensorflow/tools/ci_build/linux/mkl/set-build-env.py @@ -106,8 +106,9 @@ def gcc_version_ok(self, min_gcc_major_version, min_gcc_minor_version): raise ValueError( "{} does not exist or is not executable.".format(gcc_path)) - gcc_output = subprocess.check_output([gcc_path, "-dumpversion"], - stderr=subprocess.STDOUT) + gcc_output = subprocess.check_output( + [gcc_path, "-dumpfullversion", "-dumpversion"], + stderr=subprocess.STDOUT).strip() # handle python2 vs 3 (bytes vs str type) if isinstance(gcc_output, bytes): gcc_output = gcc_output.decode("utf-8")