diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2013-03-22 22:05:57 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2013-03-22 22:05:57 (GMT) |
commit | 5c459618453c684cd7bcd8c2b8117bb3e6ad1b27 (patch) | |
tree | a5e8cc656f655fc9cb2f6e2f49f468ad64df5a6e /config | |
parent | f593b6e71296c74b2da8790a062c2a6076c8ce6d (diff) | |
download | hdf5-5c459618453c684cd7bcd8c2b8117bb3e6ad1b27.zip hdf5-5c459618453c684cd7bcd8c2b8117bb3e6ad1b27.tar.gz hdf5-5c459618453c684cd7bcd8c2b8117bb3e6ad1b27.tar.bz2 |
[svn-r23434] Improvement: DFFV-8245
Use Clang as the compiler for the Mac platform.
Changed all Mac to use clang/clang++ as the default C and CXX compilers if
not provided by the user. Still use gfortran as the default fortran
compiler since Apple does not provide any fortran compiler.
Tested: passed all three macs OS, snow leapord (fred), lion (duck) and
mountain lion (wren). Also passed test using Apple gcc, Gnu gcc, Intel
as the C compilers and all corresponding CXX compilers fits in.
Did not run h5committest or other non-mac platform since this change
affect Apple platforms only.
Diffstat (limited to 'config')
-rw-r--r-- | config/apple | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/config/apple b/config/apple index c5c0a19..d2d4663 100644 --- a/config/apple +++ b/config/apple @@ -20,17 +20,16 @@ # # See BlankForm in this directory for details. -# The default compiler is `gcc' +# The default compiler is `clang' if test "X-" = "X-$CC"; then - CC=gcc - CC_BASENAME=gcc + CC=clang + CC_BASENAME=clang fi # Figure out compiler flags . $srcdir/config/gnu-flags # temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not # use -O option as it causes failures in test/dt_arith. -#echo host_os=$host_os case "$host_os" in darwin1[12].*) # lion & mountain lion #echo cc_vendor=$cc_vendor'-'cc_version=$cc_version @@ -48,6 +47,11 @@ esac . $srcdir/config/intel-flags if test "X-" = "X-$FC"; then case $CC_BASENAME in + clang) + # clang has no fortran compiler. Use gfortran. + FC=gfortran + FC_BASENAME=gfortran + ;; gcc*) FC=gfortran FC_BASENAME=gfortran @@ -59,8 +63,30 @@ if test "X-" = "X-$FC"; then esac fi +if test "X-" = "X-$CXX"; then + case $CC_BASENAME in + clang) + CXX=clang++ + CXX_BASENAME=clang++ + ;; + gcc) + CXX=g++ + CXX_BASENAME=g++ + ;; + icc) + CXX=icpc + CXX_BASENAME=icpc + ;; + esac +fi + # compiler version strings case $CC in + clang) + cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\ + grep 'Apple' | sed 's/(.*//'` + ;; + *gcc*) cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 | grep -v 'PathScale' |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` @@ -97,6 +123,11 @@ esac # get c++ version info case $CXX in + clang++) + cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ + grep 'Apple' | sed 's/(.*//'` + ;; + *g++*) cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` |