Thread: free 64-bit C++ compiler on Windows

  1. #1
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229

    free 64-bit C++ compiler on Windows

    Does a free (at least as in beer), working 64-bit C++ compiler on Windows exist?

    I have tried mingw-w64, but apparently at the current state, optimization is not supported (and performance is the reason I need a 64-bit compiler, so that's out of the question).

    Cygwin's GCC I haven't tried, but I heard it cannot compile to 64-bit binaries?

    Intel C++ compiler isn't free, and worse still, it requires Visual Studio.

    I don't want to use the Microsoft compiler because my code is largely GCC-centric (using intrinsics and such).

    Suggestions?

    Thanks

    *edit* Oh, and it has to be able to compile Boost, as my project uses Boost::Thread (which mingw-w64 doesn't work with) */edit*

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    sounds like you're SOL...

    even if cygwin works you have a POSIX emulation later, which slows everything down.

    microsoft has a bunch of intrinsics as well, found here:
    http://msdn.microsoft.com/en-us/libr...ds(VS.80).aspx

    maybe u can use some typedefs?

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Visual studio Express has a 64-bit compiler release. Just get that. It is free.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by master5001
    Visual studio Express has a 64-bit compiler release.
    I recall that this is not the case, and a quick check of the Visual Studio 2008 Product Comparison seems to confirm this ("64-Bit Visual C++ Tools" is not checked under "Visual C++ 2008 Express Edition").
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Dun, dun, dunnnnnnnnn

    Sorry. I do not use express and just assumed it could do most of what my version does. But I guess you learn something new every day. I will try to google you out something useful, cyberfish.

  6. #6
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    Quote Originally Posted by laserlight View Post
    I recall that this is not the case, and a quick check of the Visual Studio 2008 Product Comparison seems to confirm this ("64-Bit Visual C++ Tools" is not checked under "Visual C++ 2008 Express Edition").
    it's not enabled in VS Express, but you can still compile 64-bit applications through the command line.

    edit: this is what u need: http://en.wikipedia.org/wiki/Microsoft_Windows_SDK
    Last edited by bling; 10-31-2008 at 12:12 PM.

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Thanks bro. I was completely caught off guard with the lack of 64-bit support that laserlight mentioned. If its available in the command line what is the problem anyway? Don't fear a command line compiler. I use them all the time.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    And just to reassure, Visual Studio compiles boost fine.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Kung Fu Kitty Angus's Avatar
    Join Date
    Oct 2008
    Location
    Montreal, Canada
    Posts
    115
    Why is it that so much stuff is not available for 64-bit? I should think porting to 64-bit from 32 would be a snap. Is it because code tends to be inline assembly heavy? Do developer presume that long int is 32-bits, and making it 64 breaks their programs?

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That I can think of:
    - Little or no speed benefit (depends on program).
    - Too few people have 64-bit operating systems to make it viable.
    - If using Visual Studio (and you know there are a huge amount of people that do that), inline assembly is forbidden.

    I am just guessing, though.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Elysia View Post
    That I can think of:
    - Little or no speed benefit (depends on program).
    - Too few people have 64-bit operating systems to make it viable.
    - If using Visual Studio (and you know there are a huge amount of people that do that), inline assembly is forbidden.

    I am just guessing, though.
    I haven't done any benchmarking myself, by I've read that moving to 64-bit (at least on Windows, I'm not sure about other 64-bit OS's) your executable size can shrink by 10-30% giving obvious benefits; and the way parameters are passed allows some of the parameters to be passed in a different way than on the stack; and it has some new 64-bit registers that programs can use.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  12. #12
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Not sure about the executable size, but it is indeed correct that 64-bit have more registers. But the benefit of those vary greatly depending on the program it is used in.
    In a heavy CPU program such as x264, developers cited about 10% speed gain from possibly using 64-bit.
    (Do not quote me on that, though.)
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #13
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by cpjust View Post
    I haven't done any benchmarking myself, by I've read that moving to 64-bit (at least on Windows, I'm not sure about other 64-bit OS's) your executable size can shrink by 10-30% giving obvious benefits; and the way parameters are passed allows some of the parameters to be passed in a different way than on the stack; and it has some new 64-bit registers that programs can use.
    All of that is true. However, other applications will grow, and possibly loose performance. Depends on what the application does.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Ah, that also reminds me that in 64-bit mode, addresses will be 64-bit, not 32. So the size of each address doubles! Not that it trouble for out modern big hard drives, but it is a disadvantage.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #15
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Many thanks for the comments!

    I posted it as a question on the mingw-w64 forum, and it appears like the SVN version can already compile Boost -
    https://sourceforge.net/forum/forum....orum_id=723797

    But I haven't tried it yet.

    Of course I don't fear command line compilers... I've been using gcc naked for a few years .

    Problem with Microsoft compiler is that I am using a lot of GCC intrinsics (some of them without wrapper interfaces... and I have learned that's not a good idea since then). Also, things like "long long" vs "__int64" or whatever the Microsoft compiler takes. I think I typedef'd my "long long"'s, but still, it would still take a bit of effort (especially since I am not familiar with the Microsoft compiler at all). I chose GCC because it exists on all platforms, and it's certainly nice to only have to support one compiler.

    As for why I need 64-bit, my program gains about 50% performance boost going from 32-bit to 64-bit (on Linux). It's a chess engine that uses what's called "bitboards" as the internal data structure (board representation). Essentially, an array of 64-bit integers is used to represent a board position, with every one of them describing one aspect. For example, one of them would describe where all white knights are (set to 1). Coincidentally, a chess board has 64 squares . The program spends most of its time manipulating those bitboards, so going to 64-bit definitely helps.

    For a "typical" program, I agree the difference will probably be much less, though (max 10% as said above).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pthreads for 64 bit m/c
    By vin_pll in forum C Programming
    Replies: 2
    Last Post: 02-22-2009, 10:25 PM
  2. 64 bit testing
    By DrSnuggles in forum C++ Programming
    Replies: 7
    Last Post: 11-20-2007, 03:20 AM
  3. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM
  4. Direct3d, Windows, and Free Software...
    By QuestionC in forum Game Programming
    Replies: 10
    Last Post: 01-20-2002, 12:02 AM
  5. How do I set up Borland's C++ Free compiler
    By Unregistered in forum C++ Programming
    Replies: 13
    Last Post: 11-03-2001, 11:18 PM