Makefile for MinGW?

Message boards : Number crunching : Makefile for MinGW?

To post messages, you must log in.

AuthorMessage
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1099 - Posted: 4 Jul 2009, 15:15:08 UTC
Last modified: 4 Jul 2009, 15:19:28 UTC

Hi TJM,

I haven't ditched you guys completely, just watching my electric bill....

Anyhoo, I have MinGW 5.1.4 loaded onto my WinXP partition, but I'm having problems compiling using mingw32-make.exe. I changed conf-cc and conf-ld switches (from "-" to "/") so gcc will compile in the windows environment. Is there a more compatible/modified Makefile for windows? Or do I have to grab the windows version of the unix commands (zcat, for example) to get make to work in Windows?

PS I took your optimized apps for WinXP and ran them using the timeit.exe command from Windows Server Kit 2003. Here's the times I got from the benchmark....My Phenom is running at 3.1GHz still. (The times of my 64-bit Linux app were at 3.05GHz FWIW)

Athlon - 2m57.671s
Athlon_TB - 2m53.281s - Winner on my 9950 Phenom
P3 - 3m10.640s (so much for it being the fastest)
Pentium4 - 3m3.515s
Core - 3m3.906s

So generally speaking A.) Windows 32-bit code seems faster than Linux 32-bit code (not surprising), B.) Linux Open64 64-bit code is faster than Windows 32-bit code, but gcc 64-bit Linux code is as fast as MinGW generated 32-bit Windows code (sucks!). ;-) And... C.) Windows 64-bit code lies....where???...in all of this?

I don't know if MinGW supports the -march=barcelona flag but I'm curious if it's faster than the Athlon_TB time. FWIW.

Mike Doerner
ID: 1099 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1118 - Posted: 8 Jul 2009, 15:35:51 UTC - in response to Message 1099.  

I used dev-cpp to build Windows executables, it comes with old version of MinGW preinstalled, but it's easy to replace it with fresh one - just replace the files one by one.
Building the app with dev-cpp is easy: just create an empty project and add all the files, if I remember correctly no file editing is required to compile.
Also, dev-cpp has a nice feature - it's possible to set compiler/linker profiles for different processors, so later you can switch between them with just few mouse clicks - it makes building/testing new apps a bit faster. If you want to take a look, I'll upload my set of compiler prefs somewhere.

M4 Project homepage
M4 Project wiki
ID: 1118 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1121 - Posted: 9 Jul 2009, 9:49:05 UTC - in response to Message 1118.  

That's good to know, I'll give it a shot.

Mike D
ID: 1121 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1122 - Posted: 9 Jul 2009, 21:05:55 UTC - in response to Message 1121.  
Last modified: 9 Jul 2009, 21:06:35 UTC

I might need some help wit this.....I'm not used to a GUI for compiling....;-)

I've got MinGW 5.1.4 and Dev-C++ 4.9.9.2 installed, along with PyWin build 214 for Python 3.1 installed. I can open enigma.c but all the header files fail (just like having no makefile) and running mingw32-make from the command line still fails because I don't have CAT command installed on my windows box. What piece of the puzzle am I missing?

Mike D
ID: 1122 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1123 - Posted: 9 Jul 2009, 21:53:56 UTC

Do not open the enigma.c, you have to create a fresh project in dev-cpp, then there's a menu option Project -> Add to project, just add all the source files and headers (you can do it at once with multiselect) and it should work.

M4 Project homepage
M4 Project wiki
ID: 1123 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1124 - Posted: 9 Jul 2009, 22:04:37 UTC - in response to Message 1123.  

OK, when I do that, I get an error "Multiple Definitions of 'main'" and Error 1 at the end. What next?

BTW, I do have gcc 4.4.0 on my WinXP partition now. After I get this to work, I just may try that version to see how those executibles run.....

Mike D
ID: 1124 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1125 - Posted: 9 Jul 2009, 22:24:00 UTC

I think that you have to remove the default 'main.c' from the project file list on the left before adding sources.

M4 Project homepage
M4 Project wiki
ID: 1125 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1126 - Posted: 9 Jul 2009, 22:50:04 UTC - in response to Message 1125.  

Yup, that got it.....For the newest gcc 4.4.0 WinXP app the benchmark completion time is.....(drum roll please)

9m56s (Bahahaha!)....Yes, the next step is to turn on the optimizations....;-)

PS Go to bed TJM! It's what? 3am your time?

Mike D
ID: 1126 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1128 - Posted: 9 Jul 2009, 22:55:56 UTC - in response to Message 1126.  
Last modified: 9 Jul 2009, 22:57:17 UTC

2:54... ooops, 55 already %-)
At first I thought that the 9 minutes is a runtime for hceyz72/0 workunit, but it's the benchmark time, right ?
EDIT: now I see that your post clearly says 'benchmark', I'm sleepy already so I missed that.
M4 Project homepage
M4 Project wiki
ID: 1128 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1129 - Posted: 10 Jul 2009, 13:32:58 UTC - in response to Message 1128.  
Last modified: 10 Jul 2009, 13:33:31 UTC

Well, it looks like there no gcc optimization going on, regardless of the version of gcc or MinGW or dev-c++ I use. I've tried the "command line option" thing inside "Compiler Options" and I've also used the GUI flags as well. Still stuck at around 10 minutes, which tells me the flags aren't being passed on to the compiler. Any ideas?

Mike D
ID: 1129 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1130 - Posted: 10 Jul 2009, 14:05:10 UTC

It works for me, for example, here are my settings for Athlon Thunderbird:




M4 Project homepage
M4 Project wiki
ID: 1130 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1131 - Posted: 10 Jul 2009, 20:07:13 UTC - in response to Message 1130.  
Last modified: 10 Jul 2009, 20:43:36 UTC

Lemmie try the flags you've listed and see if that changes my code size (or performance for that matter)

PS OK, we're down to 3m14s with -O3 passed to the compiler (finally). I deleted and re-installed MinGW 5.1.4 (which is gcc 3.4.5?). I'll try gcc 4.4.0 here shortly.

Mike D
ID: 1131 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1132 - Posted: 10 Jul 2009, 21:11:14 UTC

looks like my problem was in -O3 was in the compile, but not the linking stage.....methinks....;-) Lemmie see if I can beat the time for you Athlon_TB app.

Mike D
ID: 1132 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile mdoerner
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 30 Jul 08
Posts: 202
Credit: 6,998,388
RAC: 0
Message 1134 - Posted: 11 Jul 2009, 11:02:13 UTC

OK, I can't seem to get past the 3m13s barrier with either gcc 3.4.5 or 4.4.0 on my Windows partition. Too bad Open64 isn't going to be ported to Windows :-(

I downloaded and TRIED to compile on the Watcom C compiler.....that was a disaster, not sure if I set it up correctly anyways. I'm gonna try Microsoft's Visual C++ here shortly, but this experiment may not get me the results that Open64 did on 64-bit Linux.

Mike D
ID: 1134 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile TJM
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 25 Aug 07
Posts: 843
Credit: 267,994,998
RAC: 0
Message 1135 - Posted: 11 Jul 2009, 20:57:25 UTC

I've tested MS VC++ already, results were not bad but still MinGW executables were faster.
Btw, the source won't compile under MS VC++ without changes, you'll have to add workaround for missing getopt().
I also tried to use Intel compiler for Windows, I think it has support for MS VC++ 6 and MS Visual Studio 2005 and newer; but I couldn't get it to work properly. Standalone didn't work at all and when I configured it to work with MS VS I got executable slower than plain one build without any optimizations and compiler changes, so I guess I did something wrong.

M4 Project homepage
M4 Project wiki
ID: 1135 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote

Message boards : Number crunching : Makefile for MinGW?




Copyright © 2024 TJM