giomasce / mmpp

Metamath in C++
11 stars 2 forks source link

Installation does not succeed on Ubuntu 16.04 #1

Closed jkingdon closed 6 years ago

jkingdon commented 6 years ago

Ubuntu 16.04 is the most recent LTS release for Ubuntu.

When I follow the instructions in the README, I get the following error in the make step:

g++ -c -m64 -pipe -g -ftemplate-backtrace-limit=0 -O2 -Wall -W -fPIC -DPROJ_DIR="\"/home/jkingdon/work/mmpp\"" -DUSE_MICROHTTPD -DUSE_Z3 -I../../mmpp -I. -isystem /usr/include/p11-kit-1 -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o main.o ../main.cpp
In file included from /usr/include/c++/5/chrono:35:0,
                 from ../utils/utils.h:14,
                 from ../main.cpp:8:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^

There are more errors after that point but perhaps that makes the point. Editing the makefile with -std=c++17 gets slightly farther but only slightly.

Running g++ -v shows gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)

If the answer is a newer GCC, perhaps the directions should point to ppa:jonathonf/gcc-7.1 as shown at https://askubuntu.com/questions/1008744/when-will-gcc-be-updated-in-16-04-and-18-04/1008746

For myself, I suppose I'll just wait for 18.04 although I guess it will be several months before that is a recommended upgrade from 16.04.

giomasce commented 6 years ago

I usually use GCC 7 to build mmpp. I just pushed a little change to allow GCC 6, but I believe that GCC 5 is just too old in terms of supporting C++17 and it would require a lot of changes that I would like to avoid. So unfortunately I think that you need to either install a more recent GCC from the PPA, or install a little virtual machine to test mmpp, or just wait until it is safe to upgrade to 18.04.

I will write about this in the README.

jkingdon commented 6 years ago

Sounds good. As long as the installation instructions mention it, requiring GCC 6 is fine.

david-a-wheeler commented 6 years ago

Not working on the compiler for the current long term support version seems a little strong. What functionality is it that you're really depending on?

giomasce commented 6 years ago

As a matter of fact, it turned out that it was not too difficult to port the codebase to C++14, so now GCC 5 works as well. I though I used more of C++17 features, but apparently they are all actual C++14 features. So thanks for insisting! I have updated mmpp.po and the readme to reflect the new situation.

So, for the moment I consider C++14 the official standard for the codebase. Fortunately Ubuntu should soon ship a new LTS release with GCC 7 in it, so if there is a need for some C++17 feature I will not have to wait too much.