I'm doing some heavy number crunching on one system and I'd like to compile (and finetune) a custom GMP 6.1.0 for the user launching the number crunching computation. Previously I had a Debian wheezy (7.6) system on which I installed a custom GMP lib while being root and modificating things left and right in the filesystem (because I didn't know any better). It ended up working: my custom GMP lib was crunching numbers about 15% faster than the stock GMP.
Now I installed a new Debian (Jessie 8.3) on that computer with the "stock" GMP (the one that comes with Debian Jessie):
# gcc --version
gcc (Debian 4.9.2-10) 4.9.2
# apt-get install libgmp10
# apt-get install libgmp-dev
Which is apparently GMP 6.0.0.
I'm compiling my number crunching program doing:
$ gcc crunch.c -o crunch.o -L/gmp_install/lib -lgmp
(I know I could probably gain some by messing with some parameters passed to GCC, but the big problem here is the "slowness" of the non-custom GMP).
I then invoke ./crunch.o and it works but it is 15% slower than my custom build GMP on my old system (using the exact same gcc compilation command pasted above on the exact same computer).
I'd now like to compile a custom GMP 6.1.0 again, but only accessible for the user running the heavy computation.
In other words: I'd now like to install a custom GMP cleanly instead of messing (while being root) with the entire filesystem.
But I don't understand what -L/gmp_install/lib refers to nor what -lgmp does either.
I take it the first steps I need to do are:
- go to https://ftp.gnu.org/gnu/gmp/
- download gmp-6.1.0.tar.bz2
So how can I compile a custom GMP for one (non root) user account and how would I go about then compiling my crunch.c program?