diff --git a/.travis.yml b/.travis.yml index b86634a232ec6920def2b6be818ad7b1b8020c2b..8f095c34f116562c3b32f98fae5909fa48496372 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,6 @@ matrix: dist: trusty sudo: required env: PLUMED_CC=gcc PLUMED_CXX=g++ PLUMED_CXXFLAGS=-O3 LAPACK=yes -# then I try serial compiler on UBUNTU precise - - os: linux - dist: precise - sudo: required - env: PLUMED_CC=gcc PLUMED_CXX=g++ # test using external blas with internal lapack - os: linux dist: trusty diff --git a/configure b/configure index eda363efcf5554e750586b2f6633b7dae06d89af..0b4f7aef76a1a233a818fd471bc1f442d76f492b 100755 --- a/configure +++ b/configure @@ -4443,9 +4443,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -ansi" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -ansi" >&5 -$as_echo_n "checking whether $CXX accepts -ansi... " >&6; } + CXXFLAGS="$CXXFLAGS -std=c++11" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -std=c++11" >&5 +$as_echo_n "checking whether $CXX accepts -std=c++11... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5056,11 +5056,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports explicit" >&5 -$as_echo_n "checking whether $CXX supports explicit... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX declares c++11 support" >&5 +$as_echo_n "checking whether $CXX declares c++11 support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - class A{explicit A(){}}; + +#if __cplusplus <= 199711L +this_compiler_does_not_support_cxx11 +#endif + int main () { @@ -5075,13 +5079,14 @@ $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; - $as_echo "#define explicit /**/" >>confdefs.h - + as_fn_error $? "C++11 support is required" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "$dependency_tracking" = true then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX can generate dependency file with -MM -MF" >&5 diff --git a/configure.ac b/configure.ac index b9ecf5beca7dcd5c71370523c3220f583dc00891..be80486cdf7ff2a14bf00375e621c8396ba4cbf8 100644 --- a/configure.ac +++ b/configure.ac @@ -252,7 +252,7 @@ if test $basic_warnings == true then PLUMED_CHECK_CXXFLAG([-Wall]) PLUMED_CHECK_CXXFLAG([-pedantic]) - PLUMED_CHECK_CXXFLAG([-ansi]) + PLUMED_CHECK_CXXFLAG([-std=c++11]) fi if test $debug == true @@ -282,11 +282,17 @@ then PLUMED_CHECK_CXXFLAG([-Wold-style-cast]) fi -AC_MSG_CHECKING([whether $CXX supports explicit]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ class A{explicit A(){}};])], +AC_MSG_CHECKING([whether $CXX declares c++11 support]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +#if __cplusplus <= 199711L +this_compiler_does_not_support_cxx11 +#endif +])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) ; - AC_DEFINE([explicit],[])]) + AC_MSG_ERROR([C++11 support is required])]) + + AC_SUBST(disable_dependency_tracking) diff --git a/src/maketools/codecheck b/src/maketools/codecheck index 15b6bd2f21a623123de2bc858ab6849052005f39..89781a37143d7dee8a667cfb13bfba991aa5c09a 100755 --- a/src/maketools/codecheck +++ b/src/maketools/codecheck @@ -34,7 +34,7 @@ if [ $do_cppcheck == true ] ; then else files="$(echo */*.{h,cpp})" fi - cppcheck --std=c++03 --std=posix 4 -j 4 --platform=unix64 \ + cppcheck --std=c++11 --std=posix 4 -j 4 --platform=unix64 \ --template='[{file}:{line}] ({severity}) :{id}: {message}' --enable=all --inline-suppr --force \ $files fi