Makefile for MinGW? |
Message boards : Number crunching : Makefile for MinGW?
Author | Message |
---|---|
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
That's good to know, I'll give it a shot. Mike D |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
It works for me, for example, here are my settings for Athlon Thunderbird: M4 Project homepage M4 Project wiki |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
mdoerner Volunteer developer Volunteer tester Send message Joined: 30 Jul 08 Posts: 202 Credit: 6,998,388 RAC: 0 |
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 |
TJM Project administrator Project developer Project scientist Send message Joined: 25 Aug 07 Posts: 843 Credit: 267,994,998 RAC: 0 |
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 |
Message boards :
Number crunching :
Makefile for MinGW?