Commit 1e78f478 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Check CXX compiler.

parent 064e026f
......@@ -24,7 +24,7 @@ do
shift
done
#
if test -z "$COMP" ; then COMP=gcc ; fi
if test -z "$COMP" ; then COMP=gnu ; fi
#
set -x
#
......@@ -43,31 +43,18 @@ case "${HOSTNAME}" in
--with-proj=/opt/local \
--with-szlib=$HOME/local/libaec-0.3.2"
if test "$COMP" = icpc ; then
${CONFPATH}configure --enable-cxx \
$CDOLIBS \
CC=icc CXX="icpc --std=c++11" CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native"
elif test "$COMP" = icc ; then
${CONFPATH}configure \
$CDOLIBS \
CC=icc CFLAGS="-g -Wall -Wwrite-strings -O2 -qopt-report=5 -march=native"
elif test "$COMP" = clang++ ; then
${CONFPATH}configure --enable-cxx \
if test "$COMP" = intel ; then
${CONFPATH}configure \
$CDOLIBS \
CC=clang CXX="clang++ --std=c++11" CFLAGS="-g -Wall -O3"
CC=icc CXX=icpc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native" CXXFLAGS=$CFLAGS
elif test "$COMP" = clang ; then
${CONFPATH}configure \
$CDOLIBS \
CC=clang CFLAGS="-g -Wall -Wwrite-strings -O3"
elif test "$COMP" = g++ ; then
${CONFPATH}configure --enable-cxx \
${CONFPATH}configure \
$CDOLIBS \
CC=gcc CXX="g++ --std=c++11" CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O3 -march=native"
elif test "$COMP" = gcc ; then
${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \
CC=clang CXX=clang++ CFLAGS="-g -Wall -O3" CXXFLAGS=$CFLAGS
elif test "$COMP" = gnu ; then
${CONFPATH}configure \
$CDOLIBS \
CC=gcc CFLAGS="-g -pipe -Wall -W -Wfloat-equal -Wwrite-strings -pedantic -O3 -march=native -fstack-protector"
CC=gcc CXX=g++ CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O3 -march=native -march=native" CXXFLAGS=$CFLAGS
# --with-libxml2=/usr
# --with-magics=/Users/m214003/local/magics-2.14.9
else
......
......@@ -17687,20 +17687,38 @@ done
 
# Check compiler version
case "$CC" in
pgcc*) COMP_VERSION=`$CC -V | head -2 | tail -n 1`;;
*gcc*) COMP_VERSION=`$CC --version | head -n 1`;;
g++*) COMP_VERSION=`$CC --version | head -n 1`;;
clang*) COMP_VERSION=`$CC --version | head -n 1`;;
icc*) COMP_VERSION=`$CC --version | head -n 1`;;
sxc*) COMP_VERSION=`$CC -V 2>&1 | tail -n 1`;;
xlc*) COMP_VERSION=`$CC -qversion 2>&1 | head -n 1`;;
*) COMP_VERSION=`$CC -V 2>&1 | head -n 1 | grep -v error`;;
pgcc*) CXX_VERSION=`$CXX -V | head -2 | tail -n 1`;;
*gcc*) CXX_VERSION=`$CXX --version | head -n 1`;;
g++*) CXX_VERSION=`$CXX --version | head -n 1`;;
clang*) CXX_VERSION=`$CXX --version | head -n 1`;;
icpc*) CXX_VERSION=`$CXX --version | head -n 1`;;
sxc*) CXX_VERSION=`$CXX -V 2>&1 | tail -n 1`;;
xlc*) CXX_VERSION=`$CXX -qversion 2>&1 | head -n 1`;;
*) CXX_VERSION=`$CXX -V 2>&1 | head -n 1 | grep -v error`;;
esac
 
if test -z "$COMP_VERSION" ; then COMP_VERSION="unknown"; fi;
case "$CC" in
pgcc*) C_VERSION=`$CC -V | head -2 | tail -n 1`;;
*gcc*) C_VERSION=`$CC --version | head -n 1`;;
g++*) C_VERSION=`$CC --version | head -n 1`;;
clang*) C_VERSION=`$CC --version | head -n 1`;;
icc*) C_VERSION=`$CC --version | head -n 1`;;
sxc*) C_VERSION=`$CC -V 2>&1 | tail -n 1`;;
xlc*) C_VERSION=`$CC -qversion 2>&1 | head -n 1`;;
*) C_VERSION=`$CC -V 2>&1 | head -n 1 | grep -v error`;;
esac
if test -z "$CXX_VERSION" ; then CXX_VERSION="unknown"; fi;
cat >>confdefs.h <<_ACEOF
#define CXX_VERSION "$CXX_VERSION"
_ACEOF
if test -z "$C_VERSION" ; then C_VERSION="unknown"; fi;
 
cat >>confdefs.h <<_ACEOF
#define COMP_VERSION "$COMP_VERSION"
#define C_VERSION "$C_VERSION"
_ACEOF
 
 
......@@ -17879,6 +17897,7 @@ ENABLE_DATA=$enable_data
 
# ----------------------------------------------------------------------
CFLAGS="$CFLAGS ${OPENMP_CFLAGS}"
CXXFLAGS="$CXXFLAGS ${OPENMP_CFLAGS}"
# ----------------------------------------------------------------------
 
# Add configure options
......@@ -18350,6 +18369,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
$as_echo "CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS" ;; #(
*) :
......@@ -21150,10 +21170,16 @@ ENABLE_CXX=$enable_cxx
 
 
# Checks for compiler
COMPILER="$CC $CFLAGS"
C_COMPILER="$CC $CFLAGS"
cat >>confdefs.h <<_ACEOF
#define C_COMPILER "$C_COMPILER"
_ACEOF
CXX_COMPILER="$CXX $CXXFLAGS"
 
cat >>confdefs.h <<_ACEOF
#define COMPILER "$COMPILER"
#define CXX_COMPILER "$CXX_COMPILER"
_ACEOF
 
 
......
......@@ -82,18 +82,32 @@ AC_CHECK_FUNCS(gethostname)
# Check compiler version
case "$CC" in
pgcc*) COMP_VERSION=`$CC -V | head -2 | tail -n 1`;;
*gcc*) COMP_VERSION=`$CC --version | head -n 1`;;
g++*) COMP_VERSION=`$CC --version | head -n 1`;;
clang*) COMP_VERSION=`$CC --version | head -n 1`;;
icc*) COMP_VERSION=`$CC --version | head -n 1`;;
sxc*) COMP_VERSION=`$CC -V 2>&1 | tail -n 1`;;
xlc*) COMP_VERSION=`$CC -qversion 2>&1 | head -n 1`;;
*) COMP_VERSION=`$CC -V 2>&1 | head -n 1 | grep -v error`;;
pgcc*) CXX_VERSION=`$CXX -V | head -2 | tail -n 1`;;
*gcc*) CXX_VERSION=`$CXX --version | head -n 1`;;
g++*) CXX_VERSION=`$CXX --version | head -n 1`;;
clang*) CXX_VERSION=`$CXX --version | head -n 1`;;
icpc*) CXX_VERSION=`$CXX --version | head -n 1`;;
sxc*) CXX_VERSION=`$CXX -V 2>&1 | tail -n 1`;;
xlc*) CXX_VERSION=`$CXX -qversion 2>&1 | head -n 1`;;
*) CXX_VERSION=`$CXX -V 2>&1 | head -n 1 | grep -v error`;;
esac
if test -z "$COMP_VERSION" ; then COMP_VERSION="unknown"; fi;
AC_DEFINE_UNQUOTED(COMP_VERSION, ["$COMP_VERSION"], [Compiler version])
case "$CC" in
pgcc*) C_VERSION=`$CC -V | head -2 | tail -n 1`;;
*gcc*) C_VERSION=`$CC --version | head -n 1`;;
g++*) C_VERSION=`$CC --version | head -n 1`;;
clang*) C_VERSION=`$CC --version | head -n 1`;;
icc*) C_VERSION=`$CC --version | head -n 1`;;
sxc*) C_VERSION=`$CC -V 2>&1 | tail -n 1`;;
xlc*) C_VERSION=`$CC -qversion 2>&1 | head -n 1`;;
*) C_VERSION=`$CC -V 2>&1 | head -n 1 | grep -v error`;;
esac
if test -z "$CXX_VERSION" ; then CXX_VERSION="unknown"; fi;
AC_DEFINE_UNQUOTED(CXX_VERSION, ["$CXX_VERSION"], [CXX Compiler version])
if test -z "$C_VERSION" ; then C_VERSION="unknown"; fi;
AC_DEFINE_UNQUOTED(C_VERSION, ["$C_VERSION"], [C Compiler version])
# Checks for username, hostname and system type
USERNAME=$LOGNAME
......@@ -144,6 +158,7 @@ AC_MSG_RESULT([$enable_data])
AC_SUBST([ENABLE_DATA],[$enable_data])
# ----------------------------------------------------------------------
CFLAGS="$CFLAGS ${OPENMP_CFLAGS}"
CXXFLAGS="$CXXFLAGS ${OPENMP_CFLAGS}"
# ----------------------------------------------------------------------
# Add configure options
......@@ -244,8 +259,10 @@ AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AR])
# Checks for compiler
COMPILER="$CC $CFLAGS"
AC_DEFINE_UNQUOTED(COMPILER, ["$COMPILER"], [Compiler])
C_COMPILER="$CC $CFLAGS"
AC_DEFINE_UNQUOTED(C_COMPILER, ["$C_COMPILER"], [C Compiler])
CXX_COMPILER="$CXX $CXXFLAGS"
AC_DEFINE_UNQUOTED(CXX_COMPILER, ["$CXX_COMPILER"], [CXX Compiler])
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_PROG_AWK
......
......@@ -17,6 +17,7 @@ AS_CASE([$with_threads],
ENABLE_THREADS=yes],[AC_MSG_ERROR([multithreaded settings NOT found])])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AS_ECHO(["CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"])],
[*],[THREADS_ROOT=$with_threads
......
......@@ -194,11 +194,17 @@ void cdo_version(void)
#if defined(USER_NAME) && defined(HOST_NAME) && defined(SYSTEM_TYPE)
fprintf(stderr, "Compiled: by %s on %s (%s) %s %s\n", USER_NAME, HOST_NAME, SYSTEM_TYPE, __DATE__, __TIME__);
#endif
#if defined(COMPILER)
fprintf(stderr, "Compiler: %s\n", COMPILER);
#if defined(CXX_COMPILER)
fprintf(stderr, "CXX Compiler: %s\n", CXX_COMPILER);
#endif
#if defined(COMP_VERSION)
fprintf(stderr, " version: %s\n", COMP_VERSION);
#if defined(CXX_VERSION)
fprintf(stderr, "CXX version : %s\n", CXX_VERSION);
#endif
#if defined(C_COMPILER)
fprintf(stderr, "C Compiler: %s\n", C_COMPILER);
#endif
#if defined(C_VERSION)
fprintf(stderr, "C version : %s\n", C_VERSION);
#endif
printFeatures();
......
......@@ -3,11 +3,17 @@
/* CDO version */
#undef CDO
/* Compiler */
#undef COMPILER
/* CXX Compiler */
#undef CXX_COMPILER
/* Compiler version */
#undef COMP_VERSION
/* CXX Compiler version */
#undef CXX_VERSION
/* C Compiler */
#undef C_COMPILER
/* C Compiler version */
#undef C_VERSION
/* Define to 1 for DATA support */
#undef ENABLE_DATA
......
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