Julia: GMP version mismatch in ubuntu package

Created on 22 Aug 2015  路  26Comments  路  Source: JuliaLang/julia

After updating Julia today, when I try to run Julia I get the following error:

fatal: error thrown and no exception handler available.
Base.InitError(mod=:GMP, error=ErrorException("The dynamically loaded GMP library (version 6.0.0 with __gmp_bits_per_limb == 64)
does not correspond to the compile time version (version 5.1.3 with __gmp_bits_per_limb == 64).
Please rebuild Julia."))
rec_backtrace at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
jl_throw at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
unknown function (ip: 0x7f9bed0483c9)
unknown function (ip: 0x7f9bea04dd04)
jl_apply_generic at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
__init__ at ./gmp.jl:62
unknown function (ip: 0x7f9bea232939)
jl_apply_generic at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
jl_module_run_initializer at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
unknown function (ip: 0x7f9bed04e6f3)
unknown function (ip: 0x7f9bed04746c)
julia_init at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
unknown function (ip: 0x401633)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x401685)
unknown function (ip: (nil))

Apparently this update suddenly has a problem with the GMP version 6.0.0. #6527 might be relevant, but I couldn't translate and apply any of the semi-workarounds there; because I'm not building julia from the git source. To upgrade Julia(or almost anything) I just use:

sudo apt-get update
sudo apt-get upgrade

The update I'm referring to is julia 0.4.0-2531; and I'm running it on Ubuntu 15.04.

build linux

Most helpful comment

You guys who is using ubuntu 14.04 can just install libgmp3-dev with
sudo apt-get install libgmp3-dev

It works for me.

All 26 comments

This seems like an incorrect or missing dependency in the julia binary package. Newer 0.4 versions do use GMP 6.0.0 though, so I might be missing something. In any case if you want to use 0.4 (which is a development version), I'd recommend building from source.

Or the version check is too strict? Do we use any 6.0-only features yet? That error should be changed into a warning fairly soon.

it's still giving the same error in 0.4.0-2538.

I believe GMP 6 is only used if available.

It is recommended to use the generic linux binaries though.

(by "soon" I meant when #12742 gets merged)

How soon do you think the merge will happen?

So after the update from few days ago, I no longer get that error message and I'm able to use Julia. Instead of that I get a million warnings, which although being annoying are still bearable. Anyway, I think the issue is technically resolved, so I am closing it. Thanks.

Hi,
I think this is still happening on CentOS 7, just installed julia from naliman repo today. I can start julia and run commands through the interactive REPL, but when I do a version check "julia --version" I get:

julia --version
Warning: error initializing module GMP:
ErrorException("The dynamically loaded GMP library (version 6.0.0 with __gmp_bits_per_limb == 64)
does not correspond to the compile time version (version 5.1.1 with __gmp_bits_per_limb == 64).
Please rebuild Julia.")
julia version 0.4.0-dev

I think since that's a major version number difference the warning message is intended. Do you get the warning in normal REPL use? It might be #12841 at play here.

cc @nalimilan

That's really strange. The logs show that only GMP6 was installed when the package was built:
https://copr-be.cloud.fedoraproject.org/results/nalimilan/julia-nightlies/epel-7-x86_64/00115247-julia/root.log.gz

@Divided-Pi Can you run dnf info julia gmp to check what exact versions you are using?

@tkelman I'm able to use the normal REPL and run code from the base package. I do encounter errors when trying to load DataFrames and DataArrays, but that might not be related so I don't want to further muddy the waters. Looks like I'm just getting the warnings you mention earlier in the thread, apologies

edit: Both DataFrames & DataArrays were added via Pkg.add()

Yet this shouldn't happen. Warnings are an indication that something is wrong. Can you run the command I posted in my previous comment?

@nalimilan unfortunately my dnf is broken on centos7 (related to https://bugs.centos.org/view.php?id=9367 & https://bugzilla.redhat.com/show_bug.cgi?id=1258416 far as I can tell)

I ran yum info julia instead:

Installed Packages
Name : julia
Arch : x86_64
Version : 0.4.0
Release : 0.20150201.el7.centos
Size : 24 M
Repo : installed
From repo : nalimilan-julia
Summary : High-level, high-performance dynamic language for technical computing
URL : http://julialang.org/
License : MIT and LGPLv2+ and GPLv2+
....

Hope this helps

Indeed it helps: you don't have the latest version of Julia at all. For some reason, you're using a nightly from 2015-02-01. I'm not sure what happened, as that package is said to come from the stable repository, not from the nightlies. I think you should enable the julia-nightlies Copr, and then update or reinstall Julia.

@nalimilan thanks! No more warnings

now running:

Name : julia
Arch : x86_64
Version : 0.4.0
Release : 0.20150913.el7.centos

I am getting this error in CentOS 7, installed today. The yum info is

Installed Packages
Name        : julia
Arch        : x86_64
Version     : 0.4.1
Release     : 1.el7.centos
Size        : 50 M
Repo        : installed
From repo   : nalimilan-julia

the CentOS 7 is clean from today. Looking at RPM search it doesn't seem that there could actually be some different version of GMP. Any idea how to resolve this or at least debug this?

Hi @tomaskrehlik,

I think the issue is that the centOS7 nalimilan-julia is perpetually out of date. I don't think it's been updated since september at least (when I was having the same issue).

I switched to the nalimilan-julia-nightlies RPM which you can add from the julia lang docs page. That is kept up to date and will you give you the proper v0.5 build. If that doesn't work I'm out of ideas ;)

I think it doesn't require the libgmp to be of version 6. It only requires to have libgmp to be of version at least 5. Hence, the old library stays there and only it only simlinks against the old library. I think that updating the libgmp provided by CentOS should work fine. (I don't have the root privileges for the cluster, so will see tomorrow when the admin runs the update.) I don't want the nightlies, rather stable version. Will update tomorrow on progress. :)

I updated the repo just a few days ago, it should never have been out of date. And indeed you appear to have the latest stable Julia version.

@tomaskrehlik What version of GMP do you have? What's the exact error message?

Ok, so the thing was that libgmp 5.1.1 was by default in the CentOS installed. In the specfile there is BuildRequires: gmp-devel >= 5.0 which is obviously satisfied by the libgmp 5.1.1, but the binary is built against 6.0.0, if I understand everything correctly.
The message can be rid of, when you update the library to this. My pure guess would be that if you change the specfile line to BuildRequires: gmp-devel >= 6.0 everything should get resolved.
Edit: the error message was exactly as the one above, warning complaining that it was built against 6 however you only have 5.1.1

The problem is that RPM specs do not allow changing the Requires version based on what was used when building the package. This would be done automatically if we actually linked Julia to this library (https://github.com/JuliaLang/julia/issues/6742).

For now, I've raised the requirement to 6.0 on distributions more recent than RHEL6 (which isn't supported ATM). Please check the new package when it's built (in about 1h).

This problem still occurs on Ubuntu 14.04, Julia 0.5.0
steps to reproduce
1) Fresh install on Ubuntu via:

sudo add-apt-repository ppa:staticfloat/juliareleases
sudo add-apt-repository ppa:staticfloat/julia-deps
sudo apt-get update
sudo apt-get install julia

2) run julia> Pkg.add("PyCall") to produce the error message on GMP mismatch

I tried the following as well

sudo apt-get update
sudo apt-get upgrade

Use the generic Linux binaries.

I am facing the same issue on Ubuntu 14.04
INFO: Cloning cache of Gurobi from https://github.com/JuliaOpt/Gurobi.jl.git
INFO: Installing Gurobi v0.2.6
WARNING: Error during initialization of module GMP:
ErrorException("The dynamically loaded GMP library (version 5.1.3 with __gmp_bits_per_limb == 64)
does not correspond to the compile time version (version 6.1.0 with __gmp_bits_per_limb == 64).
Please rebuild Julia.")

I installed it both using the package manager as well as using Tar file. Can someone please share a solution

You guys who is using ubuntu 14.04 can just install libgmp3-dev with
sudo apt-get install libgmp3-dev

It works for me.

Was this page helpful?
0 / 5 - 0 ratings