From 32cc0db1512bd1e7063ff0e3ae080602bb7849d2 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Thu, 7 Dec 2017 17:31:38 +0800 Subject: [PATCH] check if cmake has been installed --- paddle/scripts/check_env.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paddle/scripts/check_env.sh b/paddle/scripts/check_env.sh index 564c1c09be..af16b84ca8 100755 --- a/paddle/scripts/check_env.sh +++ b/paddle/scripts/check_env.sh @@ -150,7 +150,12 @@ echo "OS Version : `cat /etc/redhat-release`" echo "Kernel Release Version : `uname -r`" echo "Kernel Patch Version : `uname -v`" echo "GCC Version :`gcc --version | head -n 1|awk -F '\\\(GCC\\\)' '{print $2}'`" -echo "CMake Version :`cmake --version | head -n 1 | awk -F 'version' '{print $2}'`" +if command -v cmake >/dev/null 2>&1; then + cmake_ver=`cmake --version | head -n 1 | awk -F 'version' '{print $2}'` +else + cmake_ver=" Not installed" +fi +echo "CMake Version :$cmake_ver" echo "------------------ Environment Variables Information -------------------" kmp_affinity=`env | grep KMP_AFFINITY` omp_dynamic=`env | grep OMP_DYNAMIC` -- GitLab