mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2009-03-13, 14:47   #1
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

32×163 Posts
Default Installing gmp under Ubuntu

I've some problems: I've tried to install gmp-4.2.4 (currently the newest) under Ubuntu by (after download and unzip):
./configure
make
make check
make install
But on the last step at make install I've gotten an error message because the program wanted to install some file in another directory where I have only simple user rights and not root rights. So it hasn't installed gmp-4.2.4.
Today an admin answered that "apt-cache show libgmp3c2" and he claims that this means that gmp-3 is already installed on this computer. My questions:

1. If there was really gmp-3 on this computer then haven't I overwritten by the semi reinstallation by gmp-4.2.4 ?
2. How can I compile gmp code under Ubuntu? Before installation I've tried
gcc -o bernstein bernstein.c .libs/libgmp.a
But Ubuntu hasn't found libgmp.a
3. Are the above installation steps good under Ubuntu?? If I will find an admin then I would try to install the newer gmp.

I will use that computer at Tuesday morning.

Last fiddled with by R. Gerbicz on 2009-03-13 at 14:48
R. Gerbicz is offline   Reply With Quote
Old 2009-03-13, 15:14   #2
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

143608 Posts
Default

libgmp3c2 is a Debian package containing version 4.2.2 of gmp - the naming is, I agree, unclear.

If you're installing libgmp yourself, I strongly recommend doing

./configure --prefix=somewhere_under_your_home_directory

at which point 'make install' installs libgmp in the place you requested, rather than running the risk of overwriting the system library.

The Debian package puts gmp in /usr/lib/libgmp.a, so you can compile things that require gmp with just

gcc -o bernstein bernstein.c -lgmp

Last fiddled with by fivemack on 2009-03-13 at 15:14
fivemack is offline   Reply With Quote
Old 2009-03-13, 15:40   #3
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

32×163 Posts
Default

Thanks for the answers! I will try it on Tuesday. Another thing:
which should I use under Ubuntu:
#include "gmp.h" or
#include <gmp.h> in the code?

Last fiddled with by R. Gerbicz on 2009-03-13 at 15:44
R. Gerbicz is offline   Reply With Quote
Old 2009-03-13, 15:49   #4
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

24×3×7×19 Posts
Default

It ought to work with either; you should use <angle brackets> because gmp.h is a system include file rather than part of your own program.
fivemack is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing YAFU 1.34 on Linux Romuald YAFU 12 2015-12-06 09:52
Problems installing Prime95 on Mac OS X 10.4 peterhowarth Software 4 2015-02-18 10:40
Installing mprime on Linux lidocorc Software 9 2009-11-06 20:59
Ubuntu 9.04: Installing GMP-ECM; problems with GMP Andi47 Linux 4 2009-10-01 06:31
Installing GGNFS Zeta-Flux Factoring 33 2005-06-10 21:19

All times are UTC. The time now is 14:57.

Sat May 15 14:57:57 UTC 2021 up 37 days, 9:38, 0 users, load averages: 2.01, 2.25, 2.20

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.