1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
#!/bin/sh
# Check for g++ to avoid using different versions of gcc and g++ on systems
# with both g++-X and gcc-Y but not g++-Y installed.
prog=false
if g++-#DEFAULT_GCC_VERSION# --version >/dev/null 2>&1; then
prog=gcc-#DEFAULT_GCC_VERSION#
elif g++-13 --version >/dev/null 2>&1; then
prog=gcc-13
elif g++-12 --version >/dev/null 2>&1; then
prog=gcc-12
elif g++-11 --version >/dev/null 2>&1; then
prog=gcc-11
elif g++-10 --version >/dev/null 2>&1; then
prog=gcc-10
elif g++-9 --version >/dev/null 2>&1; then
prog=gcc-9
elif g++-8 --version >/dev/null 2>&1; then
prog=gcc-8
elif g++-7 --version >/dev/null 2>&1; then
prog=gcc-7
elif g++-6 --version >/dev/null 2>&1; then
prog=gcc-6
elif clang-17 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-17 is available." >&2
echo " Use 'nvcc -ccbin clang-17' to use that instead." >&2
exit 1
elif clang-16 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-16 is available." >&2
echo " Use 'nvcc -ccbin clang-16' to use that instead." >&2
exit 1
elif clang-15 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-15 is available." >&2
echo " Use 'nvcc -ccbin clang-15' to use that instead." >&2
exit 1
elif clang-14 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-14 is available." >&2
echo " Use 'nvcc -ccbin clang-14' to use that instead." >&2
exit 1
elif clang-13 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-13 is available." >&2
echo " Use 'nvcc -ccbin clang-13' to use that instead." >&2
exit 1
elif clang-12 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-12 is available." >&2
echo " Use 'nvcc -ccbin clang-12' to use that instead." >&2
exit 1
elif clang-11 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-11 is available." >&2
echo " Use 'nvcc -ccbin clang-11' to use that instead." >&2
exit 1
elif clang-10 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-10 is available." >&2
echo " Use 'nvcc -ccbin clang-10' to use that instead." >&2
exit 1
elif clang-9 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-9 is available." >&2
echo " Use 'nvcc -ccbin clang-9' to use that instead." >&2
exit 1
elif clang-8 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-8 is available." >&2
echo " Use 'nvcc -ccbin clang-8' to use that instead." >&2
exit 1
elif clang-7 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-7 is available." >&2
echo " Use 'nvcc -ccbin clang-7' to use that instead." >&2
exit 1
elif clang-6.0 --version >/dev/null 2>&1; then
echo "ERROR: No supported gcc/g++ host compiler found, but clang-6.0 is available." >&2
echo " Use 'nvcc -ccbin clang-6.0' to use that instead." >&2
exit 1
else
echo "ERROR: No supported gcc/g++ host compiler found." >&2
echo " Use 'nvcc -ccbin <compiler>' to specify a host compiler." >&2
exit 1
fi
exec $prog "$@"
|