mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Lounge

Reply
 
Thread Tools
Old 2008-01-17, 20:29   #1
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2·2,383 Posts
Default GCC and Cygwin

Hi everybody!

I have installed Cygwin, and GCC 3.4.4.3

Now, I discovered that GCC has come to version 4.2, C99 ready; I'm interested to it because of the possible use of long long int (64 bit).

My question: is it feasible to download GCC 4.2 source code, recompile and use it under Cygwin? I tried an upgrade with setup applet but it seems to not upgrade to GCC 4.2

Luigi
ET_ is offline   Reply With Quote
Old 2008-01-17, 21:08   #2
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

352910 Posts
Default

Quote:
Originally Posted by ET_ View Post
My question: is it feasible to download GCC 4.2 source code, recompile and use it under Cygwin? I tried an upgrade with setup applet but it seems to not upgrade to GCC 4.2
Compiling and installing gcc on a linux system is easy, but I don't have much hope for cygwin. gcc 4.x is available for MinGW.

Note that the gcc 3.4 series also has support for long longs.
jasonp is offline   Reply With Quote
Old 2008-01-17, 21:58   #3
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

112368 Posts
Default

Quote:
Originally Posted by jasonp View Post
Compiling and installing gcc on a linux system is easy, but I don't have much hope for cygwin. gcc 4.x is available for MinGW.

Note that the gcc 3.4 series also has support for long longs.
Really? :surprised

Would you mind sending me a small snippet of code by PM to check it?
I had problems even to printf() it...

Thank you for the answer.

Luigi
ET_ is offline   Reply With Quote
Old 2008-01-17, 23:28   #4
Chris Card
 
Chris Card's Avatar
 
Aug 2004

12910 Posts
Default

Yes, you can build gcc 4.x under Cygwin. I know, because I've done it.
Just be careful not to build in the same directory that you unzip the source files to, because that confuses it a lot.

Edit: and gcc 4.x produces faster code than gcc 3.4, so it's worth it

Chris

Last fiddled with by Chris Card on 2008-01-17 at 23:29
Chris Card is offline   Reply With Quote
Old 2008-01-18, 03:03   #5
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3,529 Posts
Default

Quote:
Originally Posted by ET_ View Post
Would you mind sending me a small snippet of code by PM to check it?
I had problems even to printf() it...
64-bit linux has support for things like printf("%lld\n", my_var), but 32-bit gcc can't do that in my experience. Instead you can #include<inttypes.h> and try something like printf("%" PRId64 "\n", my_var). Whether you try to print them or not, arithmetic using long long types should work fine.
jasonp is offline   Reply With Quote
Old 2008-01-18, 16:55   #6
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2×2,383 Posts
Default

Thank you Chris and Jason !

Luigi
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
GCP-ECM Pentium IV Cygwin binary : Usage question grandpascorpion Software 12 2005-02-08 17:58

All times are UTC. The time now is 22:58.

Fri Sep 25 22:58:22 UTC 2020 up 15 days, 20:09, 1 user, load averages: 1.30, 1.39, 1.36

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.