Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 604722

Summary: dev-libs/icu-58.1-r1: ebuild adds requirement for c++14 standard, but it is not defined by my gcc (4.8.4)
Product: Gentoo Linux Reporter: Vaibhav Niku <vaibhav.niku>
Component: Current packagesAssignee: Gentoo Office Team <office>
Status: RESOLVED DUPLICATE    
Severity: normal CC: dennisn, rene.rheaume
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
emerge -v icu output [failed in configure phase]
./configure in source directory (stock) [success]

Description Vaibhav Niku 2017-01-05 07:47:32 UTC
Created attachment 458796 [details]
emerge --info

Emerging for icu-58.1-r1 fails, but succeeds for icu-57.1.

The ebuild for 58.1-r1 (linked below) adds:

<quote>
src_configure() {
	# Use C++14
	append-cxxflags -std=c++14
[snip]
}
</quote>

But -std=c++14 is not defined for my gcc (4.8.4, 2014-12-19). So, emerging fails at the step:
<quote>
checking if we have a C++ compiler... no
configure: error: C++ compiler x86_64-pc-linux-gnu-g++ -m32 does not work or no compiler found
</quote>

The C++14 standards get defined around gcc 5 (link below).


`make install' in /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source seems to complete successfully. Note that when ./configure-ing for installation, the very last line of the (successful) output says the following:

C++ apps may want to build with CXXFLAGS =  --std=c++0x

(c++0x is another name for c++11.) So, is c++14, even for those with newer gcc, useful anyway? (I have no idea!)

As mentioned above, emerging succeeds for icu-57.1, where the ebuild only asks for --std=c++11 (which is defined for my gcc).

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/icu/icu-58.1-r1.ebuild
https://gcc.gnu.org/projects/cxx-status.html#cxx14


Recommendation: check if c++14 is defined, if not use c++11.

Thanks!
Comment 1 Vaibhav Niku 2017-01-05 07:49:27 UTC
Created attachment 458798 [details]
emerge -v icu output [failed in configure phase]
Comment 2 Vaibhav Niku 2017-01-05 07:50:56 UTC
Created attachment 458800 [details]
./configure in source directory (stock) [success]
Comment 3 Vaibhav Niku 2017-01-06 03:58:10 UTC
I successfully emerged icu-58.1-r1 after I edited its ebuild to change
`--std=c++14' --> `--std=c++11'. 

(Afterwards I did `emerge =dev-libs/icu-58.1-r1'.)
(edited file: /usr/portage/dev-libs/icu/icu-58.1-r1.ebuild)
(Note to newbies: changes to the above file will be lost when you next do `emerge --sync'.)
Comment 4 Vaibhav Niku 2017-01-06 04:00:54 UTC
> `--std=c++14' --> `--std=c++11'. 

Sorry, a typo:

`-std=c++14' to `std=c++11'
Comment 5 Dennis Nezic 2017-01-27 14:00:51 UTC
Googling suggests that gcc after 4.9.3'ish supports std=c++14. Maybe we should add this as a dependency?
Comment 6 Vaibhav Niku 2017-01-28 07:01:05 UTC
A couple of minor comments:
1) A confession, but hopefully irrelevant: I came to Gentoo from GaryOS, which is itself based on Funtoo. (When I submitted the bug report, I was not very clear about the difference between the three!) So, gcc 4.8.4 is Funtoo's gcc. 

I now have a fresh Gentoo amd64 (stable) installation, in which the gcc 4.9.4 is the primary gcc, which recognizes -std=c++14.

2) I have no idea about the intricacies of Gentoo, but, if you still care for my opinion:
Adding a gcc version number requirement does not seem to be an elegant solution. If icu does not asks for >= a particular version of gcc, why should we? Given than the ebuild _adds_ something extra, which breaks the installation, the obvious solution seems to make the ebuild stop adding this extra requirement.
Comment 7 Dennis Nezic 2017-01-28 12:24:58 UTC
I wonder why the ebuild added that cxxflag?
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2017-02-05 12:05:21 UTC

*** This bug has been marked as a duplicate of bug 601588 ***