Gentoo Archives: gentoo-science

From: grozin@g.o
To: gentoo-science@l.g.o
Subject: [gentoo-science] -std=c++11
Date: Sun, 05 Feb 2017 20:17:49
Message-Id: alpine.LRH.2.20.1702060042220.62380@star.inp.nsk.su
1 Hello *,
2
3 Sorry, I'm not a C++ expert, and I need some help. I'm trying to bump
4 sci-mathematics/ginac and some of its revdeps. The current ginac is 1.7.2,
5 and it needs -std=c++11 (or gnu++11). I added append-cxxflags -std=c++11
6 to src_configure; also added src_test which was missing previously. ginac
7 compiles and passes tests, also ginsh works. Fine.
8
9 The current sci-physics/nestedsums is 1.5.1, it depends on
10 >=sci-mathematics/ginac-1.7 and needs -std=c++11. I've made the necessary
11 changes to the ebuild, it compiles and seems to work (its testsuite is
12 broken, cannot use it). Also fine.
13
14 Then there's sci-physics/reduze. It is still 2.1, no new versions have
15 appeared. It has to be recompiles after upgrading ginac.
16
17 If I compile it without -std=c++11, I get a lot of syntax errors in .h
18 files from ginac:
19
20 /usr/include/ginac/ptr.h:37:13: error: expected ‘;’ at end of member
21 declaration
22 /usr/include/ginac/ptr.h:37:15: error: ‘noexcept’ does not name a type
23 /usr/include/ginac/ptr.h:57:31: error: ‘>>’ should be ‘> >’ within a
24 nested template argument list
25 /usr/include/ginac/ptr.h:124:44: error: expected initializer before
26 ‘noexcept’
27
28 etc. etc.
29
30 If I compile it with -std=c++11, I get errors about operators from stdlib:
31
32 /var/tmp/portage/sci-physics/reduze-2.1/work/reduze-2.1/reduze/files.cpp:726:27:
33 error: no match for ‘operator<<’ (operand types are
34 ‘std::basic_ostream<char>’ and ‘std::ofstream {aka
35 std::basic_ofstream<char>}’)
36 /var/tmp/portage/sci-physics/reduze-2.1/work/reduze-2.1/reduze/functions.h:258:46:
37 error: cannot bind ‘std::basic_ostream<char>’ lvalue to
38 ‘std::basic_ostream<char>&&’
39
40 etc.
41
42 Does this mean that in order to compile it stdlib should be recompiled
43 with -std=c++11? Will it break all the other C++ packages in the system?
44
45 Many thanks in advance,
46 Andrey

Replies

Subject Author
Re: [gentoo-science] -std=c++11 David Seifert <soap@g.o>