switch to C++14 compilation

* configure.ac: Compile in C++14 by default and rename
--enable-c++14 as c++17.
* doc/org/compile.org, doc/org/concepts.org, doc/org/index.org,
doc/org/install.org, doc/org/tut.org, doc/org/upgrade2.org, HACKING,
NEWS, README: Adjust all mentions of C++11.
* spot/twaalgos/stats.hh: Use std::make_unique.
This commit is contained in:
Alexandre Duret-Lutz 2017-08-22 11:25:57 +02:00
parent 7f42782701
commit f5dce597c6
11 changed files with 71 additions and 105 deletions

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#+TITLE: Compiling against Spot
#+DESCRIPTION: How to compile C++11 programs using Spot
#+DESCRIPTION: How to compile C++14 programs using Spot
#+SETUPFILE: setup.org
#+HTML_LINK_UP: tut.html
@ -39,10 +39,10 @@ obvisously. On this page, we are going to assume that you use =g++=
same user interface. To successfully build the =hello= program, we
might need to tell the compiler several things:
1. The language that we use is C++11 (or C++14). This usually
requires passing an option like =-std=c++11=. Note that with
version 6 of =g++= the default is now to compile C++14, so this
option is not necessary.
1. The language that we use is C++14 (or optionally C++17). This
usually requires passing an option like =-std=c++14=. Note that
with version 6 of =g++= the default is now to compile C++14, so
this option is not necessary.
2. The C++ preprocessor should be able to find =spot/misc/version.hh=.
This might require appending another directory to the include
search path with =-I location=.
@ -78,7 +78,7 @@ be able to find everything by default, and you should be able to
compile =hello.cc= and then execute =hello= with
#+BEGIN_SRC sh
g++ -std=c++11 hello.cc -lspot -o hello
g++ -std=c++14 hello.cc -lspot -o hello
./hello
#+END_SRC
@ -101,11 +101,11 @@ This means that all spot headers have been installed in
Usually, these directories are searched by default, so
#+BEGIN_SRC sh
g++ -std=c++11 hello.cc -lspot -o hello
g++ -std=c++14 hello.cc -lspot -o hello
#+END_SRC
should still work. But if that is not the case, add
#+BEGIN_SRC sh
g++ -std=c++11 -I/usr/local/include hello.cc -L/usr/local/lib -lspot -o hello
g++ -std=c++14 -I/usr/local/include hello.cc -L/usr/local/lib -lspot -o hello
#+END_SRC
If running =./hello= fails with a message about not finding =libspot.so=,
@ -131,7 +131,7 @@ libraries in =$HOME/usr/lib=.
You would compile =hello.cc= with
#+BEGIN_SRC sh
g++ -std=c++11 -I$HOME/usr/include hello.cc -L$HOME/usr/lib -lspot -o hello
g++ -std=c++14 -I$HOME/usr/include hello.cc -L$HOME/usr/lib -lspot -o hello
#+END_SRC
and execute with
#+BEGIN_SRC sh
@ -184,7 +184,7 @@ There are at least two traps with this scenario:
So compiling against a non-installed Spot would look like this:
#+BEGIN_SRC sh
/dir/spot-X.Y/libtool link g++ -std=c++11 -I/dir/spot-X.Y -I/dir/spot-X.Y/buddy/src hello.cc /dir/spot-X.Y/spot/libspot.la -o hello
/dir/spot-X.Y/libtool link g++ -std=c++14 -I/dir/spot-X.Y -I/dir/spot-X.Y/buddy/src hello.cc /dir/spot-X.Y/spot/libspot.la -o hello
#+END_SRC
Using =libtool link g++= instead of =g++= will cause =libtool= to

View file

@ -1022,7 +1022,7 @@ components that are distributed and installed by Spot.
- =libbddx= is a customized version of [[https://sourceforge.net/projects/buddy/][the BuDDy library]], for
manipulating [[#bdd][BDDs]].
- =libspot= is the main library, containing a C++11 implementation of all the
- =libspot= is the main library, containing a C++14 implementation of all the
data structures and algorithms. This depends on =libddx=.
- =libspotgen= is an auxiliary library that contains functions to
generate families of automata, useful for benchmarking and testing
@ -1034,7 +1034,7 @@ components that are distributed and installed by Spot.
SpinS or a patched version of DiVinE, but you have to install
those third-party tools first. See [[https://gitlab.lrde.epita.fr/spot/spot/blob/next/tests/ltsmin/README][=tests/ltsmin/README=]]
for details.
- In addition to the C++11 API, we also provide Python bindings for
- In addition to the C++14 API, we also provide Python bindings for
=libspotgen=, =libspotltsmin=, =libbddx=, and most of =libspot=.
These are available by importing =spot.gen=, =spot.ltsmin=, =bdd=,
and =spot=. Those Python bindings also includes some additional

View file

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
#+TITLE: Spot: a platform for LTL and ω-automata manipulation
#+DESCRIPTION: Spot is a library and tool suite for LTL and ω-automata
#+KEYWORDS: Spot,C++11,library,platform,framework,tool-suite,LTL,PSL,omega-automata
#+KEYWORDS: Spot,C++14,library,platform,framework,tool-suite,LTL,PSL,omega-automata
#+SETUPFILE: setup.org
#+HTML_HEAD_EXTRA: <style>#org-div-home-and-up { display: none; }</style>
Spot is a C++11 library for LTL, ω-automata manipulation and model
Spot is a C++14 library for LTL, ω-automata manipulation and model
checking. It has the following notable features:
- Support for [[file:concepts.org::#ltl][LTL]] (several syntaxes supported) and

View file

@ -16,7 +16,7 @@ successful development build]].
** Requirements
Spot requires a C++11-compliant compiler. =g++= 4.8 or later, as well
Spot requires a C++14-compliant compiler. =g++= 5.0 or later, as well
as =clang++= 3.5 or later should work.
Spot expects a complete installation of Python (version 3.3 or later).
@ -75,7 +75,7 @@ apt-get install spot libspot-dev spot-doc python3-spot # Or a subset of those
#+END_SRC
The package =spot= contains the [[file:tools.org][command-line tools]]. =libspot-dev=
contains the header files if you plan to use Spot in a C++11
contains the header files if you plan to use Spot in a C++14
program. =spot-doc= contains some html (including these pages) and pdf
documentation. Finally =python3-spot= contains some Python bindings
(this package also installs some ipython notebooks that you can use as

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#+TITLE: Code Examples
#+DESCRIPTION: Directory of code examples for using Spot in C++11, Python, and shell.
#+DESCRIPTION: Directory of code examples for using Spot in C++14, Python, and shell.
#+SETUPFILE: setup.org
#+HTML_LINK_UP: index.html

View file

@ -20,7 +20,7 @@ experience of updating a couple of projects that are using Spot.
Spot 1.2.6 and Spot 2.0, just to get an idea of what will need to be
updated.
1. [[#cpp11][Spot now compiles using the C++11 standard]]. Compliant compiler
1. [[#cpp14][Spot now compiles using the C++14 standard]]. Compliant compiler
are sufficiently widespread now that this should not be an issue.
2. The layout of the source-tree and the layout of the installed
@ -83,23 +83,22 @@ experience of updating a couple of projects that are using Spot.
numbered. Many algorithms have been rewritten on top of this
=twa_graph= class, and this simplified them a lot.
* Upgrading to C++11
* Upgrading to C++14
:PROPERTIES:
:CUSTOM_ID: cpp11
:END:
Because Spot now relies on C++11 features, programs that use Spot
Because Spot now relies on C++14 features, programs that use Spot
should at least be compiled using this version (or a later one) of
the language.
Before the =g++= 6.0, the default C++ standard used was C++98, and
enabling C++11 is usually done by passing the option =-std=c++11=.
enabling C++14 is usually done by passing the option =-std=c++14=.
In =g++= 6.0 the default C++ standard used is C++14, so passing
=-std=c++11= is only necessary in projects that are incompatible
with C++14.
=-std=c++14= is not necessary.
Upgrading from C++98 or C++03 to C++11 should be relatively smooth
as the language is /mostly/ backward compatible.
Upgrading from C++98, C++03 or C++11 to C++14 should be relatively
smooth as the language is /mostly/ backward compatible.
* Upgrading =#include= directives
:PROPERTIES:
@ -600,7 +599,6 @@ for (auto i: aut->succ(s))
automatically unregistered when the automaton is destroyed.
* Various renamings
:PROPERTIES: