JuliaCrypto / Nettle.jl

Julia wrapper around nettle cryptographic hashing/encryption library providing MD5, SHA1, SHA2 hashing and HMAC functionality, as well as AES encryption/decryption

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/usr/bin/ld: cannot find -lgmp

jgbos opened this issue · comments

So unfortunately on the Linux system I am trying to install this package on the libgmp is not called libgmp.so but rather libgmp.so.3 and therefore gcc does not find it. Do you know the correct environment variable or change to the Makefile needed to get Nettle to build?

Thanks

Try installing the libgmp-dev package or the equivalent on your system. There should be a -dev or -devel package that provides libgmp.so in addition to libgmp.so.3.

My only option there is to download gmp source and compile and store the lib locally. If I add it to the Julia lib directory will it work? I do not have root access, and unfortunately our administrators don't realize they should install the development packages.

As an FYI, I did compile libnettle without gmp and everything is working.

Sorry, I should add that by working, I mean IJulia is working, which is what I need libnettle for.

How did you compile libnettle without gmp? I wasn't aware it was an optional dependency.

I went into the Nettle/deps/src/nettle-*/ directory and did configure and make. When you do configure it warns you that gmp is not going to be used. Once I compiled, I copied libnettle.so to the Julia lib directory.

Can you try editing deps/build.jl line 25, remove "LIBS" => "-lgmp " completely so that the LIBS entry in that dictionary is not set anymore, and try re-building? You'll likely have to remove your custom-built nettle, but I think that's the line that is forcing usage of gmp when it is otherwise perhaps not necessary.

Edited the line and rebuilt and everything looks good. It installed libnettle.so in .julia/v0.3/Nettle/deps/usr/lib directory.

Great! Looks like that's an over-eager linker flag then.