Skip to content
This repository

[config] Report GMP version from Configure.pl #882

Merged
merged 1 commit into from over 1 year ago

3 participants

Duke Leto James E Keenan Reini Urban
Duke Leto
Owner

This information was not stored or shown anywhere else, which makes it
inconvenient to debug issues relating to GMP.

@jkeenan can you do a code review? I am not sure if this will work on Windows, but I am crossing my fingers.

This branch also needs some tests before being merged.

Duke Leto leto [config] Report GMP version from Configure.pl
This information was not stored or shown anywhere else, which makes it
inconvenient to debug issues relating to GMP.
582558b
James E Keenan
Owner
Reini Urban rurban merged commit 582558b into from
Duke Leto
Owner

@jkeenan looks like this just got merged, but I am still open for code review feedback and tests

James E Keenan
Owner

On 12/13/12 1:31 PM, leto wrote:

@jkeenan looks like this just got merged, but I am still open for code review feedback and tests

The merge and the closing of the ticket were premature, IMO.

As I stated yesterday, I hoped to get to this by the end of the weekend. Today, when I saw that the branch had been merged, I had a few minutes to run 'perl Configure.pl' on a machine where I did not previously know whether GMP was installed.

Before performing the merge, configuring in 'master' I got this output (ellipses trimmed).

auto::gmp -           Does your platform support GMP.............no.
auto::readline -      Does your platform support readline.......yes.
auto::pcre -          Does your platform support pcre.....yes, 8.02.

After performing the merge (0d2f918) configuring in 'master' I got this output:

auto::gmp -           Does your platform support GMP...........done.
auto::readline -      Does your platform support readline.......yes.
auto::pcre -          Does your platform support pcre.....yes, 8.02.

Note that the result has changed from no to done. IIRC, done is the default result of configuration steps. I would have expected the answer to remain: no. So that suggests something has changed in the execution path within auto::gmp.

'done' is not really an appropriate result for a configuration step like auto::gmc. done is appropriate for steps like these:

gen::config_h -       Generate C headers.......................done.
gen::core_pmcs -      Generate core pmc list...................done.
gen::opengl -         Generating OpenGL bindings...............done.
gen::makefiles -      Generate makefiles and other build files.done.

What we really want for auto::gmp is either:

  yes, <major_version>.<minor_version>.

... as we have for auto::pcre, or

  no.

... as we previously had for auto::gmc.

I will look into this this weekend.


Reply to this email directly or view it on GitHub:
#882 (comment)

Reini Urban rurban referenced this pull request from a commit
Reini Urban rurban [GH #882] Better gmp Configure result: skipped/yes, num/no
Print skipped with --without-gmp, not no.
Print yes, number if found.
Print no if not found.
4ac84cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 13, 2012
Duke Leto leto [config] Report GMP version from Configure.pl
This information was not stored or shown anywhere else, which makes it
inconvenient to debug issues relating to GMP.
582558b
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 20 additions and 6 deletions. Show diff stats Hide diff stats

  1. +13 6 config/auto/gmp.pm
  2. +7 0 config/auto/gmp/gmp_c.in
19 config/auto/gmp.pm
@@ -34,7 +34,7 @@ sub _init {
34 34 $data{description} = q{Does your platform support GMP};
35 35 $data{result} = q{};
36 36 $data{cc_run_expected} =
37   -"6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151 0\n";
  37 +"6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151 0";
38 38
39 39 return \%data;
40 40 }
@@ -70,18 +70,25 @@ sub runstep {
70 70 if ($has_gmp) {
71 71 $conf->data->add( ' ', libs => $extra_libs );
72 72 }
73   - $self->set_result($has_gmp ? 'yes' : 'no');
74 73
75 74 return 1;
76 75 }
77 76
78 77 sub _evaluate_cc_run {
79 78 my ($self, $conf, $test, $has_gmp) = @_;
80   - if ( $test eq $self->{cc_run_expected} ) {
81   - $has_gmp = 1;
82   - $conf->debug(" (yes) ");
83   - $self->set_result('yes');
  79 + my ($expected_line, $version_line)= split /\n/, $test;
84 80
  81 + if ( $expected_line eq $self->{cc_run_expected} ) {
  82 + $has_gmp = 1;
  83 + my $gmp_version = (split(/ /, $version_line))[1];
  84 +
  85 + if ($gmp_version) {
  86 + $conf->debug("(yes, $gmp_version) ");
  87 + $self->set_result("yes, $gmp_version");
  88 + } else {
  89 + $conf->debug(" (yes) ");
  90 + $self->set_result('yes');
  91 + }
85 92 $conf->data->set(
86 93 gmp => 'define',
87 94 HAS_GMP => $has_gmp,
7 config/auto/gmp/gmp_c.in
@@ -35,6 +35,13 @@ main(int argc, char *argv[])
35 35
36 36 s = mpz_get_str(NULL, 10, prime);
37 37 printf("%s %d\n", s, y);
  38 +
  39 + /* Print GMP version so Configure.pl can report it */
  40 + printf("%s %d.%d.%d\n", "version",
  41 + __GNU_MP_VERSION,
  42 + __GNU_MP_VERSION_MINOR,
  43 + __GNU_MP_VERSION_PATCHLEVEL
  44 + );
38 45 free(s);
39 46 return 0;
40 47 }

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.