Skip to content

Commit

Permalink
check only the major version number of GMP in __init__()
Browse files Browse the repository at this point in the history
Only the major version number of GMP determines the compile time
path (in type `RangeGeneratorBigInt`), so no need to check that
the full version number correpdonds at run time.

Cf. JuliaLang/METADATA.jl#1840.
  • Loading branch information
rfourquet committed Dec 10, 2014
1 parent 0d29ddb commit b5f94b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ _gmp_clear_func = C_NULL
_mpfr_clear_func = C_NULL

function __init__()
if gmp_version() != GMP_VERSION || gmp_bits_per_limb() != GMP_BITS_PER_LIMB
if gmp_version().major != GMP_VERSION.major || gmp_bits_per_limb() != GMP_BITS_PER_LIMB
error(string("The dynamically loaded GMP library (version $(gmp_version()) with __gmp_bits_per_limb == $(gmp_bits_per_limb()))\n",
"does not correspond to the compile time version (version $GMP_VERSION with __gmp_bits_per_limb == $GMP_BITS_PER_LIMB).\n",
"Please rebuild Julia."))
Expand Down

1 comment on commit b5f94b6

@ivarne
Copy link
Member

@ivarne ivarne commented on b5f94b6 Dec 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is somewhat surprising that when this check actually triggered and called error() everything works just fine (until the actual API incompatibility causes a crash).

I think we should either change this to a warning, or make exeptions from __init__() somehow cause the module load to fail.

cc: @vtjnash

Please sign in to comment.