Closed coatless closed 6 years ago
I don't follow. If it is deemed NOT sufficient we stop on error. Ergo when we don't stop ...
I suppose this is looking for uniformity across configure messages, e.g.
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether clang++ accepts -g... (cached) yes
checking whether g++ version is sufficient... checking LAPACK_LIBS... fallback LAPACK from R 3.3.0 or later used
checking for macOS... not found as on Linux
checking for OpenMP... found
There is a multi-line check that should be split to:
checking whether g++ version is sufficient... yes
checking LAPACK_LIBS... fallback LAPACK from R 3.3.0 or later used
Works here:
edd@bud:~/git/rcpparmadillo(master)$ ./configure
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether ccache g++ accepts -g... yes
checking how to run the C++ preprocessor... ccache g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether ccache g++ accepts -g... (cached) yes
checking whether g++ version is sufficient... (6.3.0) yes
checking LAPACK_LIBS... system LAPACK found
checking for macOS... not found as on Linux
checking for OpenMP... found
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
edd@bud:~/git/rcpparmadillo(master)$
I guess we have a false positive on crapOS then because the code is just
## Check the C++ compiler using the CXX value set
AC_PROG_CXX
## If it is g++, we have GXX set so let's examine it
if test "${GXX}" = yes; then
AC_MSG_CHECKING([whether g++ version is sufficient])
gxx_version=$(${CXX} -v 2>&1 | awk '/^.*g.. version/ {print $3}')
case ${gxx_version} in
1.*|2.*|3.*|4.0.*|4.1.*|4.2.*|4.3.*|4.4.*|4.5.*|4.6.*|4.7.0|4.7.1)
AC_MSG_RESULT([no])
AC_MSG_WARN([Only g++ version 4.7.2 or greater can be used with RcppArmadillo.])
AC_MSG_ERROR([Please use a different compiler.])
;;
4.7.[2-9]|4.8.*|4.9.*|5.*|6.*|7.*|8.*)
gxx_newer_than_45="-fpermissive"
AC_MSG_RESULT([(${gxx_version}) yes])
;;
esac
fi
and GXX
should not be "yes" for you poor souls on the wrongOS. But if it is, we should better get a result from the short shell fragment. And no, I don't think we need s/CXX/GXX/
. I think that is a been there done that.
Yeah. Digging into this issue shows that the AC_PROG_CXX
check is detecting the __GNUC__
define being issued by clang.
https://lists.gnu.org/archive/html/autoconf/2014-09/msg00025.html
One way around this is the ax_compiler_vendor
check, c.f.
https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html#ax_compiler_vendor
An alternative is to just check for a difference between __clang__
and __GNUC__
used by the llvm project prior to its switch over to using CMake:
Though, I'm a fan of the occam's razor approach of defining a default case like:
case ${gxx_version} in
1.*|2.*|3.*|4.0.*|4.1.*|4.2.*|4.3.*|4.4.*|4.5.*|4.6.*|4.7.0|4.7.1)
AC_MSG_RESULT([no])
AC_MSG_WARN([Only g++ version 4.7.2 or greater can be used with RcppArmadillo.])
AC_MSG_ERROR([Please use a different compiler.])
;;
4.7.[2-9]|4.8.*|4.9.*|5.*|6.*|7.*|8.*)
gxx_newer_than_45="-fpermissive"
AC_MSG_RESULT([(${gxx_version}) yes])
;;
*)
AC_MSG_RESULT([compiler self-identifies as being compliant with GNUC extensions.])
;;
esac
Yep, agree on Occam. I'll fold those additional three lines in. Easiest and cleanest.
modified configure.ac
@@ -43,6 +43,10 @@ if test "${GXX}" = yes; then
gxx_newer_than_45="-fpermissive"
AC_MSG_RESULT([(${gxx_version}) yes])
;;
+ *)
+ AC_MSG_RESULT([nope])
+ AC_MSG_WARN([Compiler self-identifies as being compliant with GNUC extensions but is not g++.])
+ ;;
esac
fi
Maybe I change nope to almost :) Either is better than the wtf I had first...
Closing this as dee02abec9aed7935971886699d0d5c1b6eaa72d fixed the check for a non-gcc compiler being used.
Minor blip, but it would be nice to have a new line / msg status after "checking whether g++ version is sufficient"...
e.g.
c.f. @dorianps's configure output in #163