Skip to content

Commit 973fde1

Browse files
authored
Merge pull request #281 from FloopCZ/allow-gcc-11
Allow gcc with no version
2 parents e1ed6c6 + b76dc4d commit 973fde1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tensorflow_cc/cmake/build_tensorflow.sh.in

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ if [ "$cuda_allowed" == true ] && [ "$cuda_available" == true ]; then
6565

6666
# choose the right version of CUDA compiler
6767
if [ -z "$GCC_HOST_COMPILER_PATH" ]; then
68-
if hash gcc-10 2>/dev/null && version_gt 10.3 `gcc-10 -dumpversion`; then
68+
if hash gcc-11 2>/dev/null && version_gt 11.1 `gcc-11 -dumpversion`; then
69+
export GCC_HOST_COMPILER_PATH=${GCC_HOST_COMPILER_PATH:-"/usr/bin/gcc-11"}
70+
elif hash gcc-10 2>/dev/null && version_gt 10.3 `gcc-10 -dumpversion`; then
6971
export GCC_HOST_COMPILER_PATH=${GCC_HOST_COMPILER_PATH:-"/usr/bin/gcc-10"}
7072
elif hash gcc-9 2>/dev/null && version_gt 9.4 `gcc-9 -dumpversion`; then
7173
export GCC_HOST_COMPILER_PATH=${GCC_HOST_COMPILER_PATH:-"/usr/bin/gcc-9"}
@@ -80,12 +82,7 @@ if [ "$cuda_allowed" == true ] && [ "$cuda_available" == true ]; then
8082
elif hash gcc-4 2>/dev/null && version_gt 4.9 `gcc-4 -dumpversion`; then
8183
export GCC_HOST_COMPILER_PATH=${GCC_HOST_COMPILER_PATH:-"/usr/bin/gcc-4"}
8284
else
83-
echo "No supported CUDA compiler available. If you are sure your compiler"
84-
echo "version is supported by your CUDA version, please run e.g.:"
85-
echo "export GCC_HOST_COMPILER_PATH=/usr/bin/gcc"
86-
echo "before the build. For the list of supported compilers refer to:"
87-
echo "https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html"
88-
exit 1
85+
export GCC_HOST_COMPILER_PATH=${GCC_HOST_COMPILER_PATH:-"/usr/bin/gcc"}
8986
fi
9087
fi
9188

0 commit comments

Comments
 (0)