Skip to content
Snippets Groups Projects
Verified Commit cc8b2fd9 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Bump to C++20 standard (with GNU extensions)

In practice, for the time being, we limit ourselves to C++20 features available
in GCC 10.
parent ce2c1e0d
Branches
Tags
No related merge requests found
Pipeline #7012 passed
...@@ -67,7 +67,7 @@ a 32-bit Octave. ...@@ -67,7 +67,7 @@ a 32-bit Octave.
A number of tools and libraries are needed in order to recompile everything. You don't necessarily need to install everything, depending on what you want to compile. A number of tools and libraries are needed in order to recompile everything. You don't necessarily need to install everything, depending on what you want to compile.
- A POSIX compliant shell and an implementation of Make (mandatory) - A POSIX compliant shell and an implementation of Make (mandatory)
- The [GNU Compiler Collection](http://gcc.gnu.org/), version 9 or later, with - The [GNU Compiler Collection](http://gcc.gnu.org/), version 10 or later, with
gcc, g++ and gfortran (mandatory) gcc, g++ and gfortran (mandatory)
- [MATLAB](https://mathworks.com) (if you want to compile the MEX for MATLAB) - [MATLAB](https://mathworks.com) (if you want to compile the MEX for MATLAB)
- [GNU Octave](http://www.octave.org) with - [GNU Octave](http://www.octave.org) with
......
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl Copyright © 2009-2021 Dynare Team dnl Copyright © 2009-2022 Dynare Team
dnl dnl
dnl This file is part of Dynare. dnl This file is part of Dynare.
dnl dnl
...@@ -26,7 +26,6 @@ AC_CONFIG_SUBDIRS([preprocessor]) ...@@ -26,7 +26,6 @@ AC_CONFIG_SUBDIRS([preprocessor])
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_17
AC_CANONICAL_HOST AC_CANONICAL_HOST
case ${host_os} in case ${host_os} in
...@@ -50,7 +49,7 @@ esac ...@@ -50,7 +49,7 @@ esac
# Use C++ for testing headers # Use C++ for testing headers
AC_LANG([C++]) AC_LANG([C++])
AM_CXXFLAGS="-Wall -Wno-parentheses -Wold-style-cast" AM_CXXFLAGS="-std=gnu++20 -Wall -Wno-parentheses -Wold-style-cast"
AC_SUBST([AM_CXXFLAGS]) AC_SUBST([AM_CXXFLAGS])
# If default 'ar' is not available, try to find one with a host prefix (see ticket #145) # If default 'ar' is not available, try to find one with a host prefix (see ticket #145)
......
...@@ -292,19 +292,6 @@ Files: m4/ax_compare_version.m4 ...@@ -292,19 +292,6 @@ Files: m4/ax_compare_version.m4
Copyright: 2008 Tim Toolan <toolan@ele.uri.edu> Copyright: 2008 Tim Toolan <toolan@ele.uri.edu>
License: FSFAP License: FSFAP
Files: m4/ax_cxx_compile_stdcxx.m4
m4/ax_cxx_compile_stdcxx_17.m4
Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com>
2012 Zack Weinberg <zackw@panix.com>
2013 Roy Stogner <roystgnr@ices.utexas.edu>
2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
2015 Paul Norman <penorman@mac.com>
2015 Moritz Klammler <moritz@klammler.eu>
2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
2019 Enji Cooper <yaneurabeya@gmail.com>
2020 Jason Merrill <jason@redhat.com>
License: FSFAP
Files: m4/ax_latex_class.m4 m4/ax_latex_test.m4 Files: m4/ax_latex_class.m4 m4/ax_latex_test.m4
Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch> Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch>
2009 Dynare Team 2009 Dynare Team
...@@ -341,19 +328,6 @@ Copyright: 2008-2009 Thomas Porschberg <thomas@randspringer.de> ...@@ -341,19 +328,6 @@ Copyright: 2008-2009 Thomas Porschberg <thomas@randspringer.de>
2009 Peter Adolphs 2009 Peter Adolphs
License: FSFAP License: FSFAP
Files: preprocessor/m4/ax_cxx_compile_stdcxx.m4
preprocessor/m4/ax_cxx_compile_stdcxx_17.m4
Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com>
2012 Zack Weinberg <zackw@panix.com>
2013 Roy Stogner <roystgnr@ices.utexas.edu>
2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
2015 Paul Norman <penorman@mac.com>
2015 Moritz Klammler <moritz@klammler.eu>
2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
2019 Enji Cooper <yaneurabeya@gmail.com>
2020 Jason Merrill <jason@redhat.com>
License: FSFAP
Files: preprocessor/m4/ax_latex_class.m4 Files: preprocessor/m4/ax_latex_class.m4
preprocessor/m4/ax_latex_test.m4 preprocessor/m4/ax_latex_test.m4
Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch> Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch>
......
This diff is collapsed.
# =============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html
# =============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++17
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++17. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 2
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])])
...@@ -48,7 +48,6 @@ esac ...@@ -48,7 +48,6 @@ esac
AC_PROG_FC AC_PROG_FC
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_17
AC_PROG_RANLIB AC_PROG_RANLIB
AX_PROG_LN_S AX_PROG_LN_S
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
......
...@@ -9,7 +9,7 @@ DEFS += -DMEXEXT=\"$(MEXEXT)\" ...@@ -9,7 +9,7 @@ DEFS += -DMEXEXT=\"$(MEXEXT)\"
AM_CFLAGS = $(MATLAB_CFLAGS) -Wall -Wno-parentheses AM_CFLAGS = $(MATLAB_CFLAGS) -Wall -Wno-parentheses
AM_FCFLAGS = $(MATLAB_FCFLAGS) -Wall -Wimplicit-interface AM_FCFLAGS = $(MATLAB_FCFLAGS) -Wall -Wimplicit-interface
AM_CXXFLAGS = $(MATLAB_CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast AM_CXXFLAGS = -std=gnu++20 $(MATLAB_CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast
AM_LDFLAGS = $(MATLAB_LDFLAGS) AM_LDFLAGS = $(MATLAB_LDFLAGS)
LIBS += $(MATLAB_LIBS) LIBS += $(MATLAB_LIBS)
......
...@@ -46,7 +46,6 @@ AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [6.2.0], [AC_MSG_ERROR([Your Octave ...@@ -46,7 +46,6 @@ AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [6.2.0], [AC_MSG_ERROR([Your Octave
AC_PROG_FC AC_PROG_FC
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_17
AC_PROG_RANLIB AC_PROG_RANLIB
AX_PROG_LN_S AX_PROG_LN_S
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
......
...@@ -7,7 +7,7 @@ DEFS += -DMEXEXT=\".mex\" ...@@ -7,7 +7,7 @@ DEFS += -DMEXEXT=\".mex\"
AM_CFLAGS = $(shell $(MKOCTFILE) -p CPICFLAG) -Wall -Wno-parentheses AM_CFLAGS = $(shell $(MKOCTFILE) -p CPICFLAG) -Wall -Wno-parentheses
AM_FCFLAGS = $(shell $(MKOCTFILE) -p FPICFLAG) -Wall -Wimplicit-interface AM_FCFLAGS = $(shell $(MKOCTFILE) -p FPICFLAG) -Wall -Wimplicit-interface
AM_CXXFLAGS = $(shell $(MKOCTFILE) -p CXXPICFLAG) -Wall -Wno-parentheses -Wold-style-cast AM_CXXFLAGS = -std=gnu++20 $(shell $(MKOCTFILE) -p CXXPICFLAG) -Wall -Wno-parentheses -Wold-style-cast
AM_LDFLAGS = $(shell $(MKOCTFILE) -p DL_LDFLAGS) AM_LDFLAGS = $(shell $(MKOCTFILE) -p DL_LDFLAGS)
# See the comments in configure.ac # See the comments in configure.ac
......
Subproject commit 3a820fffa2f7291be5732c33bde552526eab1602 Subproject commit 46a85644d8d1cd04a1e97b8121c99d94003b01f0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment