Hi, I've just just bumped the minimum C++ language support for the compiler to C++11. I did this because C++11 is a better language and it's widely supported by now. Sticking to C++98 would require us to sometimes write convoluted patches. All in all it's a minor thing: configure makes sure that proper compiler options are chosen and the change doesn't even break the ABI. Still, I thought I should announce this here. All my best, -richy.
Hi Richy,
I've just just bumped the minimum C++ language support for the compiler to C++11.
Unfortunately, this removes the ability to build with the MSVC compiler: The configuration bails out with configure: error: *** A compiler with support for C++11 language features is required. This is with MSVC 14 (Visual Studio 2015) [1] which is quite recent. The '#ifdef _MSC_VER' in include/cln/number.h shows that there is some interest in having MSVC support, no? Bruno [1] https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#2015
Hi, On 10/27/19 2:31 PM, Bruno Haible wrote:
Unfortunately, this removes the ability to build with the MSVC compiler: The configuration bails out with configure: error: *** A compiler with support for C++11 language features is required.
This is with MSVC 14 (Visual Studio 2015) [1] which is quite recent.
The '#ifdef _MSC_VER' in include/cln/number.h shows that there is some interest in having MSVC support, no?
Hmm, I'm confused about the status of MSVC: Jan Rheinländer has proposed f725e59b specifically for Win64, but that's clearly a C++11 language feature. Is a compiler that came out in 2014 really recent? Visual Studio 2017 claims to be C++17, after all. I have no Windows machine. And I just committed the second patch relying on C++11. :-/ -richy.
Hi, the problem is not the MSVC compiler but the configure script. If you just remove the requirement from configure.ac, then it works fine. I always comment out the line AX_CXX_COMPILE_STDCXX_11 and it works. MSVC seems to accept C++11 by default. For some reason, in spite of that the configure test fails on MSVC. Jan Am 27.10.19 um 15:03 schrieb Richard B. Kreckel:
Hi,
On 10/27/19 2:31 PM, Bruno Haible wrote:
Unfortunately, this removes the ability to build with the MSVC compiler: The configuration bails out with configure: error: *** A compiler with support for C++11 language features is required.
This is with MSVC 14 (Visual Studio 2015) [1] which is quite recent.
The '#ifdef _MSC_VER' in include/cln/number.h shows that there is some interest in having MSVC support, no?
Hmm, I'm confused about the status of MSVC: Jan Rheinländer has proposed f725e59b specifically for Win64, but that's clearly a C++11 language feature. Is a compiler that came out in 2014 really recent? Visual Studio 2017 claims to be C++17, after all. I have no Windows machine.
And I just committed the second patch relying on C++11. :-/
-richy.
_______________________________________________ CLN-list mailing list CLN-list@ginac.de https://www.cebix.net/mailman/listinfo/cln-list
On 27.10.19 16:03, Jan Rheinländer wrote:
MSVC seems to accept C++11 by default. For some reason, in spite of that> the configure test fails on MSVC.
Maybe you could check and see why ax_cxx_compile_stdcxx.m4 fails? One of the tests after _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 must be failing. If it's an issue with that script, it should be discussed upstream. All in all, after having ported lots of code to C++11, I must say that things simply become much more consistent. C++11 gives us lambda expressions, rvalue references, more consistent constructors, uniform initialization, etc. etc. Are really many people stuck with MSVC 14? -richy.
Richard B. Kreckel wrote:
MSVC seems to accept C++11 by default. For some reason, in spite of that the configure test fails on MSVC.
Maybe you could check and see why ax_cxx_compile_stdcxx.m4 fails?
It's quite obvious: The test checks for 12 language features of C++11. As standards evolve in big steps, and compiler support evolves in small steps, it is normal that a compiler supports only a portion of the language feature of every standard. CLN needs 1 out of these 12 features, namely static_assert. It's pointless to throw our arms in the air and say "we can't support MSVC 14 because it does not support all of the C++11 features", when in fact we need only 1 out of 12 features.
All in all, after having ported lots of code to C++11, I must say that things simply become much more consistent. C++11 gives us lambda expressions, rvalue references, more consistent constructors, uniform initialization, etc. etc.
All these C++11 features mean an increased learning curve for the developer. As long as a feature does not provide clear benefit, my vote is to NOT use it. Rvalue references, for example: I read the description, maybe even twice, and the impression I got is that it complicates things; it does not simplify things. Bruno
On 27.10.19 22:16, Bruno Haible wrote:
It's quite obvious: The test checks for 12 language features of C++11. As standards evolve in big steps, and compiler support evolves in small steps, it is normal that a compiler supports only a portion of the language feature of every standard.
It would still be interested to lear which ones fail.
CLN needs 1 out of these 12 features, namely static_assert.
Well, the union f : intE is C++11, too.
It's pointless to throw our arms in the air and say "we can't support MSVC 14 because it does not support all of the C++11 features", when in fact we need only 1 out of 12 features.
Agreed, let's see how long it goes well! -richy.
I wrote:
As standards evolve in big steps, and compiler support evolves in small steps, it is normal that a compiler supports only a portion of the language feature of every standard.
More details about this here: https://en.cppreference.com/w/cpp/compiler_support You can see from the C++11 table that MSVC 14 (here denoted as 19.0) supports 39 out of 43 C++11 features. Bruno
Jan Rheinländer wrote:
the problem is not the MSVC compiler but the configure script. If you just remove the requirement from configure.ac, then it works fine. I always comment out the line
AX_CXX_COMPILE_STDCXX_11
and it works.
Right. Either comment it out, or don't request a C++11 compiler as mandatory. I'm pushing this; with this, the configuration with MSVC succeeds again. diff --git a/configure.ac b/configure.ac index c1a8a59..8a81007 100644 --- a/configure.ac +++ b/configure.ac @@ -90,7 +90,7 @@ AC_SUBST(CL_VERSION) dnl checks for compiler characteristics dnl AC_LANG([C++]) -AX_CXX_COMPILE_STDCXX([11]) +AX_CXX_COMPILE_STDCXX([11], [ext], [optional]) dnl CL_LONGLONG dnl DEFS HAVE_LONGLONG
participants (3)
-
Bruno Haible
-
Jan Rheinländer
-
Richard B. Kreckel