Skip Menu |

This queue is for tickets about the Math-Int128 CPAN distribution.

Report information
The Basics
Id: 80603
Status: resolved
Worked: 45 min
Priority: 0/
Queue: Math-Int128

People
Owner: Nobody in particular
Requestors: peter.john.acklam [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.05
Fixed in: (no value)



Subject: Makefile.PL doesn't accept "gcc-4"
Here is the output from running "Makefile.PL": $ perl Makefile.PL PREFIX=/usr/local Checking if your kit is complete... Looks good Writing Makefile for Math::Int128 Writing MYMETA.yml and MYMETA.json This module requires version 4.4 or above of the GCC compiler. Aborting! It turns out that the $cc variable in "Makefile.PL" is set to "gcc-4", and $cc_version, the output from "$cc --version" is $ gcc-4 --version gcc-4 (GCC) 4.5.3 which does not match the regex used to check the compiler version, so the compiler is rejected, although it is "version 4.4 or above" of the GCC compiler.
Solved in version 0.06_07 that I have just uploaded to CPAN. Thank you for reporting the bug!
Thanks for the fix! I checked output from "gcc --version" for various old versions of GCC, and the syntax "<progname> (GCC) X.Y.Z" was introduced somewhere in version 3. It is not used in version 3.0, but it is used in version 3.4.6 and onwards. So it seems that this bug could also have been solved with the slightly simpler code my $cc_version = `$cc --version 2>&1`; unless ($cc_version =~ /\(GCC\)\s+(4\.(\d+)\S*)/ and $2 > 4) { (...)
On Tue Nov 06 03:46:44 2012, pjacklam wrote: Show quoted text
> my $cc_version = `$cc --version 2>&1`; > unless ($cc_version =~ /\(GCC\)\s+(4\.(\d+)\S*)/ and $2 > 4) { > (...)
The second line should be ... $2 >= 4) ...
On Tue Nov 06 03:46:44 2012, pjacklam wrote: Show quoted text
> Thanks for the fix! > > I checked output from "gcc --version" for various old versions of GCC, > and the syntax "<progname> (GCC) X.Y.Z" was introduced somewhere in > version 3. It is not used in version 3.0, but it is used in version > 3.4.6 and onwards. So it seems that this bug could also have been solved > with the slightly simpler code > > my $cc_version = `$cc --version 2>&1`; > unless ($cc_version =~ /\(GCC\)\s+(4\.(\d+)\S*)/ and $2 > 4) { > (...)
It is not as easy as that. There is a high variability on the version string. For instance, on Ubuntu I get "cc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2" Hopefully the version string for the slave C compiler is more stable.