mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2006-05-02, 10:02   #1
maqableh
 
May 2006
Malaysia

316 Posts
Default Where I should write C code (thread moved)

Quote:
Originally Posted by JHansen
Sure!

1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download
and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download

1.5) I also downloaded the MinGW Runtime thingy's. Don't know if they are nessesary, but they won't hurt.

2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW

2.5) I extracted the new runtime stuff and just overwrote what has there

3) I installed MSYS in c:\GNU\msys

Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again.

4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Jes )

5) Start the MinSys up again from the desktop and type

gunzip gmp-4.1.4.tar.gz
tar -xvf gmp-4.1.4.tar
cd gmp-4.1.4
./configure
make install

Then GMP installs (takes about two or three cups of cofee ).

6) Afterwards, download ECM-GMP 6 from http://home.in.tum.de/~kruppa/ecm-6.0.tar.gz and place the file in your home folder.

7) In the "home" directory (type cd ~ RETURN to get there) type
gunzip ecm-6.0.tar.gz
tar -xvf ecm-6.0.tar
cd ecm-6.0
./configure --with-gmp=/usr/local
make

8) Look and behold! 4 executables have appeared, and the one to look out for is ecm.exe

Have fun

--
Cheers,
Jes
Thank you for your Explaining how to install the Library Step-by-Step

Please can Anyone tell me where I should write the C Code.
After I did all the step I have only Msys in the start menu
So I intalled the MinGW Developer Studio, then I wrote the simple C Code
like this :

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h>
#include<conio.h>

int main()
{
mpf_t r;
mpf_init(r);


printf("\n\t The valuse of Xn = %F",r);

mpf_clear (r);
return 0;
}

When I do the Compile there is no any Error, but if I do Run
I have 2 Errors:
H:\Simple.c:16: undefined reference to `__gmpf_init'
H:\Simple.c:21: undefined reference to `__gmpf_clear'


Can Anyone Help me to eliminate these Errors.
My E-mail : Maqableh_cs@yahoo.com
Mahmoud Maqableh, Balila
maqableh is offline   Reply With Quote
Old 2006-05-03, 06:33   #2
maqableh
 
May 2006
Malaysia

3 Posts
Exclamation Please I need the Help urgent.

Helllo Everyone

I want to install GMP Library on windows XP, I did that but I have problem
I did the Installation like this :

1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download
and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download

2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW

3) I installed MSYS in c:\GNU\msys

Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again.

4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Maqableh )

5) Start the MinSys up again from the desktop and type

gunzip gmp-4.1.4.tar.gz
tar -xvf gmp-4.1.4.tar
cd gmp-4.1.4
./configure
make install

Please can Anyone tell me where I should write the C Code.
After I did all the step I have only Msys.exe in the start menu
So I intalled the MinGW Developer Studio, then I wrote the simple C Code
like this :

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h>
#include<conio.h>

int main()
{
mpf_t r;
mpf_init(r);


printf("\n\t The valuse of Xn = %F",r);

mpf_clear (r);
return 0;
}
When I do the Compile there is no any Error, but if I do Run
I have 2 Errors:
H:\Simple.c:16: undefined reference to `__gmpf_init'
H:\Simple.c:21: undefined reference to `__gmpf_clear'

I do not know what was the problem.
Can Anyone Help me to eliminate these Errors."correct the Linking Error"
OR send to me Step-by-step How I can install GMP-4.2 on Windows XP and
do Run to the previous Code.

Please I need the Help urgent.

Note: My PC CPU is : Intel(R) Celeron CPU 2.4GHzis it compatible with Intel P4???? I think GMP do not work with any CPU!!!!!!!

My E-mail : Maqableh_cs@yahoo.com
Mahmoud Maqableh, Balila
maqableh is offline   Reply With Quote
Old 2006-05-03, 06:39   #3
maqableh
 
May 2006
Malaysia

3 Posts
Default Please I need the Help urgent.

Helllo Everyone

I want to install GMP Library on windows XP, I did that but I have problem
I did the Installation like this :

1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download
and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download

2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW

3) I installed MSYS in c:\GNU\msys

Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again.

4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Maqableh )

5) Start the MinSys up again from the desktop and type

gunzip gmp-4.1.4.tar.gz
tar -xvf gmp-4.1.4.tar
cd gmp-4.1.4
./configure
make install

Please can Anyone tell me where I should write the C Code.
After I did all the step I have only Msys.exe in the start menu
So I intalled the MinGW Developer Studio, then I wrote the simple C Code
like this :

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h>
#include<conio.h>

int main()
{
mpf_t r;
mpf_init(r);


printf("\n\t The valuse of Xn = %F",r);

mpf_clear (r);
return 0;
}

When I do the Compile there is no any Error, but if I do Run
I have 2 Errors:
H:\Simple.c:16: undefined reference to `__gmpf_init'
H:\Simple.c:21: undefined reference to `__gmpf_clear'

I do not know what was the problem.
Can Anyone Help me to eliminate these Errors."correct the Linking Error"
OR send to me Step-by-step How I can install GMP-4.2 on Windows XP and
do Run to the previous Code.

Please I need the Help urgent.

Note: My PC CPU is : Intel(R) Celeron CPU 2.4GHz
is it compatible with Intel P4???? I think GMP do not work with any CPU!!!!!!!

My E-mail : Maqableh_cs@yahoo.com
Mahmoud Maqableh, Balila
maqableh is offline   Reply With Quote
Old 2006-05-03, 06:54   #4
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

246410 Posts
Default

Posts moved, they don't relate to GMP-ECM 6.0.

Alex
akruppa is offline   Reply With Quote
Old 2006-05-03, 07:39   #5
ColdFury
 
ColdFury's Avatar
 
Aug 2002

26×5 Posts
Default

You have to link with the GMP library.

If you're using the command-line, try adding -lgmp
ColdFury is offline   Reply With Quote
Old 2006-05-05, 04:44   #6
Marten
 
May 2006
USA

2 Posts
Thumbs down How to multipy Two Big numbers using GMP

Hello,

Please, Can I ask you question????
I am using GMP library, and I want to multiply two big
numbers each one consist of 160-bit. One of these numbers
should be less than 1.
Example :

A=12345678901234567890123456789012345678901234567890.

B=0.12345678901234567890123456789012345678901234567890.


I tried to do the following but I can not successed.

void multip
{
mpf_t A,B;

mpf_init2(A,160);
mpf_init2(B,160);

mpf_set (A,12345678901234567890123456789012345678901234567890);
mpf_set (B,0.12345678901234567890123456789012345678901234567890);

gmp_printf("\n\t The valuse of A n = %Ff ",A);
gmp_printf("\n\t The valuse of A n = %Ff ",B);

mpf_clear (A);
mpf_clear (B);

}


The compile Result:

chaos.c: In function `main':
chaos.c:25: warning: integer constant is too large for this configuration of the compiler - truncated to 64 bits
chaos.c:25: warning: decimal constant is so large that it is unsigned
chaos.c:25: warning: passing arg 2 of `__gmpf_set' makes pointer from integer without a cast
chaos.c:71:3: warning: no newline at end of file


if I want to see the chaos.exe I can not, and told me you
should close theprogram.


Please Can you tell me how to do assignment to those variable,
and how to multipy like this big numbers.

Thanks in Advans

Marten,
Marten is offline   Reply With Quote
Old 2006-05-05, 04:53   #7
Marten
 
May 2006
USA

2 Posts
Thumbs down How to multipy Two Big numbers using GMP

How to multipy Two Big numbers using GMP

-------------------------------------------------------------------------

Hello,

Please, Can I ask you question????
I am using GMP library, and I want to multiply two big
numbers each one consist of 160-bit. One of these numbers
should be less than 1.
Example :

A=12345678901234567890123456789012345678901234567890.

B=0.12345678901234567890123456789012345
678901234567890.

I tried to do the following but I can not successed.

void multip
{
mpf_t A,B;

mpf_init2(A,160);
mpf_init2(B,160);

mpf_set (A,12345678901234567890123456789012345678901234567890);
mpf_set (B,0.12345678901234567890123456789012345678901234567890);

gmp_printf("\n\t The valuse of A n = %Ff ",A);
gmp_printf("\n\t The valuse of A n = %Ff ",B);

mpf_clear (A);
mpf_clear (B);

}


The compile Result:

chaos.c: In function `main':
chaos.c:25: warning: integer constant is too large for this configuration of the compiler - truncated to 64 bits
chaos.c:25: warning: decimal constant is so large that it is unsigned
chaos.c:25: warning: passing arg 2 of `__gmpf_set' makes pointer from integer without a cast
chaos.c:71:3: warning: no newline at end of file

if I want to see the chaos.exe I can not, and told me you
should close theprogram.

Please Can you tell me how to do assignment to those variable,
and how to multipy like this big numbers.

Thanks in Advans

Marten,

Last fiddled with by akruppa on 2006-05-05 at 09:29 Reason: Post merged with your earlier thread.
Marten is offline   Reply With Quote
Old 2006-05-05, 09:34   #8
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

25×7×11 Posts
Default

Try the GMP manual at http://www.swox.com/gmp/manual/, especially the "Basics: What every GMP user should know" section.

Alex

Last fiddled with by akruppa on 2006-05-05 at 09:34
akruppa is offline   Reply With Quote
Old 2006-05-05, 18:31   #9
ColdFury
 
ColdFury's Avatar
 
Aug 2002

1010000002 Posts
Default

You can't use literals that big. Use the functions that accept strings.
ColdFury is offline   Reply With Quote
Old 2006-05-12, 16:22   #10
ValerieVonck
 
ValerieVonck's Avatar
 
Mar 2004
Belgium

83710 Posts
Default

FWIW, in Java you can use the BigInteger Class (java.lang.math.BigInteger)

Regards
Cedric
ValerieVonck is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abortion debate (moved from 2012 election thread) Christenson Soap Box 112 2016-07-01 15:15
Escaping drivers (moved from 4788 thread) schickel Aliquot Sequences 10 2012-05-22 10:50
DNS Hijack (moved from Server problems thread) c10ck3r Lounge 10 2012-05-18 06:02
Factor5 source code thread ET_ Operation Billion Digits 10 2008-09-17 12:28
Mfactor sieve code thread ewmayer Operation Billion Digits 27 2006-11-03 08:05

All times are UTC. The time now is 19:05.

Sat Oct 24 19:05:01 UTC 2020 up 44 days, 16:15, 0 users, load averages: 1.47, 1.60, 1.73

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.