Commit 089e414b authored by incardon's avatar incardon

Adding support for intel compiler

parent 5f826f6a
...@@ -42,7 +42,7 @@ while getopts :di:smhc: FLAG; do ...@@ -42,7 +42,7 @@ while getopts :di:smhc: FLAG; do
configure_options=$OPTARG configure_options=$OPTARG
;; ;;
m) m)
echo "Skip make" echo "Skip to make the testing"
nomake=1 nomake=1
;; ;;
h) #show help h) #show help
......
#! /bin/bash #! /bin/bash
function detect_gcc_or_clang() function detect_compiler()
{ {
gpp_found=0
icpc_found=0
command -v $1 >/dev/null 2>&1 command -v $1 >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
dgc_ret=0 dgc_ret=0
...@@ -30,20 +33,25 @@ function detect_gcc_or_clang() ...@@ -30,20 +33,25 @@ function detect_gcc_or_clang()
echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=clang++ dgc_compiler=clang++
dgc_ret=1 dgc_ret=1
gpp_found=1
elif [ $dgc_major -lt 6 ]; then elif [ $dgc_major -lt 6 ]; then
echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your Apple clang $dgc_major.$dgc_middle;$dgc_minor is too old, 6.1.0 or higher is required" echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your Apple clang $dgc_major.$dgc_middle;$dgc_minor is too old, 6.1.0 or higher is required"
dgc_ret=0 dgc_ret=0
gpp_found=0
elif [ $dgc_middle -gt 1 ]; then elif [ $dgc_middle -gt 1 ]; then
echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=clang++ dgc_compiler=clang++
dgc_ret=1 dgc_ret=1
gpp_found=1
elif [ $dgc_middle -lt 1 ]; then elif [ $dgc_middle -lt 1 ]; then
echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your Apple clang $dgc_major.$dgc_middle;$dgc_minor is too old, 6.1.0 or higher is required" echo -e "clang++ $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your Apple clang $dgc_major.$dgc_middle;$dgc_minor is too old, 6.1.0 or higher is required"
dgc_ret=0 dgc_ret=0
gpp_found=0
else else
echo -e "Apple clang++ version $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "Apple clang++ version $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=clang++ dgc_compiler=clang++
dgc_ret=1 dgc_ret=1
gpp_found=1
fi fi
return return
fi fi
...@@ -62,23 +70,29 @@ function detect_gcc_or_clang() ...@@ -62,23 +70,29 @@ function detect_gcc_or_clang()
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=g++ dgc_compiler=g++
dgc_ret=1 dgc_ret=1
gpp_found=1
elif [ $dgc_major -lt 4 ]; then elif [ $dgc_major -lt 4 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your g++ version is too old, 4.8.2 at least required" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your g++ version is too old, 4.8.2 at least required"
dgc_ret=0 dgc_ret=0
gpp_found=0
elif [ $dgc_middle -gt 8 ]; then elif [ $dgc_middle -gt 8 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=g++ dgc_compiler=g++
dgc_ret=1 dgc_ret=1
gpp_found=1
elif [ $dgc_middle -lt 8 ]; then elif [ $dgc_middle -lt 8 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your g++ version is too old, 4.8.2 at least required" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your g++ version is too old, 4.8.2 at least required"
dgc_ret=0 dgc_ret=0
gpp_found=0
elif [ $dgc_minor -gt 1 ]; then elif [ $dgc_minor -gt 1 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=g++ dgc_compiler=g++
dgc_ret=1 dgc_ret=1
gpp_found=1
else else
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m FAILED \033[0m your g++ version is too old, 4.8.2 at least required" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m FAILED \033[0m your g++ version is too old, 4.8.2 at least required"
dgc_ret=0 dgc_ret=0
gpp_found=0
fi fi
return return
fi fi
...@@ -93,24 +107,71 @@ function detect_gcc_or_clang() ...@@ -93,24 +107,71 @@ function detect_gcc_or_clang()
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=clang++ dgc_compiler=clang++
dgc_ret=1 dgc_ret=1
gpp_found=1
elif [ $dgc_major -lt 3 ]; then elif [ $dgc_major -lt 3 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your clang version is too old 3.6.0 at least required" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your clang version is too old 3.6.0 at least required"
dgc_ret=0 dgc_ret=0
gpp_found=0
elif [ $dgc_middle -gt 6 ]; then elif [ $dgc_middle -gt 6 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=clang++ dgc_compiler=clang++
dgc_ret=1 dgc_ret=1
gpp_found=1
elif [ $dgc_middle -lt 6 ]; then elif [ $dgc_middle -lt 6 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your clang version is too old 3.6.0 at least required" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your clang version is too old 3.6.0 at least required"
dgc_ret=0 dgc_ret=0
gpp_found=0
else else
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m" echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=clang++ dgc_compiler=clang++
dgc_ret=0 dgc_ret=0
gpp_found=0
fi
return
fi
$1 --version | grep $1
if [ $? == 0 -a x"$1" == x"icpc" ]; then
dgc_major=$($1 --version | grep $1 | sed 's/.*\([0-9][0-9]\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
dgc_middle=$($1 --version | grep $1 | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
dgc_minor=$($1 --version | grep $1 | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
if [ $dgc_major -gt 16 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=icpc
dgc_ret=1
icpc_found=1
elif [ $dgc_major -lt 16 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your icpc version is too old intel 16.0.2 at least required"
dgc_ret=0
icpc_found=0
elif [ $dgc_middle -gt 0 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=icpc
dgc_ret=1
icpc_found=1
elif [ $dgc_middle -lt 0 ]; then
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[91;5;1m FAILED \033[0m your icpc version is too old 16.0.2 at least required"
dgc_ret=0
icpc_found=0
else
echo -e "$1 $dgc_major.$dgc_middle.$dgc_minor \033[92;1m SUCCESS \033[0m"
dgc_compiler=icpc
dgc_ret=0
icpc_found=0
fi fi
return return
fi fi
### If we detect more than one valid compiler ask to choose
if [ icpc_found -eq 1 -a gpp_found -eq 1 ]; then
echo "Two different valid compilers has been found please choose one"
commands[0]="icpc"
commands[1]="g++"
possible_solutions "${commands[@]}"
dgc_compiler=possible_solutions_ret
fi
dgc_ret=0 dgc_ret=0
} }
......
...@@ -10,7 +10,7 @@ function HELP { ...@@ -10,7 +10,7 @@ function HELP {
echo -e " \033[1;34m-s\033[0m skip user input" echo -e " \033[1;34m-s\033[0m skip user input"
echo -e " \033[1;34m-c\033[0m foward this options to configure" echo -e " \033[1;34m-c\033[0m foward this options to configure"
echo -e " \033[1;34m-h\033[0m Displays this help message"\\n echo -e " \033[1;34m-h\033[0m Displays this help message"\\n
echo -e " \033[1;34m-m\033[0m Skip make"\\n echo -e " \033[1;34m-m\033[0m Skip to make the test"\\n
echo -e " \033[1mExample:\033[0m ./install -i /dependencies/here -s -c\"some_options someother_option\""\\n echo -e " \033[1mExample:\033[0m ./install -i /dependencies/here -s -c\"some_options someother_option\""\\n
exit 1 exit 1
} }
......
...@@ -205,7 +205,7 @@ fi ...@@ -205,7 +205,7 @@ fi
#### Detecting g++ #### Detecting g++
detect_gcc_or_clang g++ detect_compiler
if [ $dgc_ret -eq 0 ]; then if [ $dgc_ret -eq 0 ]; then
echo -e "g++ \033[91;5;1m FAILED \033[0m" echo -e "g++ \033[91;5;1m FAILED \033[0m"
solve_gpp $platform solve_gpp $platform
......
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