summaryrefslogtreecommitdiffstats
path: root/config/linux-gnulibc1
diff options
context:
space:
mode:
Diffstat (limited to 'config/linux-gnulibc1')
-rw-r--r--config/linux-gnulibc121
1 files changed, 21 insertions, 0 deletions
diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1
index 39225e7..1a12006 100644
--- a/config/linux-gnulibc1
+++ b/config/linux-gnulibc1
@@ -42,6 +42,9 @@ fi
# Figure out Intel C compiler flags
. $srcdir/config/intel-flags
+# Figure out Clang C compiler flags
+. $srcdir/config/clang-flags
+
# Use default Fortran 90 compiler according to what C compiler is used.
if test "X-" = "X-$FC"; then
case $CC_BASENAME in
@@ -61,6 +64,10 @@ if test "X-" = "X-$FC"; then
FC=mpif90
FC_BASENAME=mpif90
;;
+ clang*)
+ FC=gfortran
+ FC_BASENAME=gfortran
+ ;;
esac
else
case $FC in
@@ -194,6 +201,9 @@ fi
# Figure out GNU CXX compiler flags
. $srcdir/config/gnu-cxxflags
+# Figure out Clang CXX compiler flags
+. $srcdir/config/clang-cxxflags
+
# compiler version strings
# check if the compiler_version_info is already set
@@ -223,6 +233,17 @@ case $CC in
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
+ *clang*)
+ # clang -v will return version number following "clang" on Linux machines,
+ # but on Macs the version number will follow "Apple LLVM version"
+ cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
+ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
+ else
+ cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
+ grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`"
+ fi
+ ;;
+
*)
echo "No match to get cc_version_info for $CC"
;;