Loading...
  OR  Zero-K Name:    Password:   

Post edit history

Compile SpringRTS Engine on Windows for better performance

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
9/7/2012 5:59:52 AMMYrankAdminHistidine before revert after revert
7/30/2012 2:04:37 PMBRrankFortaleza before revert after revert
7/30/2012 2:03:24 PMBRrankFortaleza before revert after revert
7/26/2012 3:33:51 PMBRrankFortaleza before revert after revert
7/26/2012 3:07:05 PMBRrankFortaleza before revert after revert
7/26/2012 2:58:29 PMBRrankFortaleza before revert after revert
7/26/2012 2:58:09 PMBRrankFortaleza before revert after revert
7/26/2012 2:57:18 PMBRrankFortaleza before revert after revert
7/26/2012 2:56:46 PMBRrankFortaleza before revert after revert
7/26/2012 2:55:56 PMBRrankFortaleza before revert after revert
7/26/2012 2:55:03 PMBRrankFortaleza before revert after revert
7/26/2012 2:54:02 PMBRrankFortaleza before revert after revert
7/26/2012 4:07:03 AMBRrankFortaleza before revert after revert
7/25/2012 8:50:22 PMBRrankFortaleza before revert after revert
7/25/2012 8:31:29 PMBRrankFortaleza before revert after revert
7/25/2012 8:29:17 PMBRrankFortaleza before revert after revert
Before After
1 Licho asked me to do a tutorial on how i did compile a optimized version of the engine for my Laptop, so if you use windows and want a optimized version for you CPU, you can do the same was i did: 1 Licho asked me to do a tutorial on how i did compile a optimized version of the engine for my Laptop, so if you use windows and want a optimized version for you CPU, you can do the same was i did:
2 \n 2 \n
3 [img]http://kommein.com/wp-content/uploads/2011/03/For-Dummies.gif[/img] 3 [img]http://kommein.com/wp-content/uploads/2011/03/For-Dummies.gif[/img]
4 \n 4 \n
5 Lets start on how its work, CPU have instruction set that make programs, code run faster, by default (in CMake) the engine is using i686 that "Pentium Pro" instruction set, is over 17 year old CPU that only support MMX, so to use the full power of your modern CPU (that have SSE, SSE2, SSE3, etc) you need to compile it your self. 5 Lets start on how its work, CPU have instruction set that make programs, code run faster, by default (in CMake) the engine is using i686 that "Pentium Pro" instruction set, is over 17 year old CPU that only support MMX, so to use the full power of your modern CPU (that have SSE, SSE2, SSE3, etc) you need to compile it your self.
6 \n 6 \n
7 It will use OMP (it will multithreaded a little, like ROAM terrain rendering, and does not desycn) to. (Optional) 7 It will use OMP (it will multithreaded a little, like ROAM terrain rendering, and does not desycn) to. (Optional)
8 \n 8 \n
9 First the thing you will need to download: 9 First the thing you will need to download:
10 7z program: 10 7z program:
11 http://www.7-zip.org/ 11 http://www.7-zip.org/
12 http://portableapps.com/apps/utilities/7-zip_portable/ (i used this portable version) 12 http://portableapps.com/apps/utilities/7-zip_portable/ (i used this portable version)
13 \n 13 \n
14 The Tarballs: 14 The Tarballs:
15 http://springrts. com/dl/spring_88. 0_src. tar. gz 15 http://sourceforge. net/projects/springrts/files/springrts/spring-91. 0/spring_91. 0_src. tar. gz/download
16 https://github.com/spring/mingwlibs/downloads (click in "Download as tar.gz") 16 https://github.com/spring/mingwlibs/downloads (click in "Download as tar.gz")
17 https://github.com/spring/mingwlibs/tarball/master (direct link to above file) 17 https://github.com/spring/mingwlibs/tarball/master (direct link to above file)
18 So you will need to download the 2 files spring_88. 0_src. tar. gz and spring-mingwlibs. tar. gz 18 So you will need to download the 2 files spring_91. 0_src. tar. gz and spring-mingwlibs. tar. gz
19 \n 19 \n
20 CMake: 20 CMake:
21 http://www.cmake.org/cmake/resources/software.html 21 http://www.cmake.org/cmake/resources/software.html
22 http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.exe (i used this one) 22 http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.exe (i used this one)
23 http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.zip (this one look like a 23 http://www.cmake.org/files/v2.8/cmake-2.8.8-win32-x86.zip (this one look like a
24 portable version, but i did not use it, so use it at your own risk) 24 portable version, but i did not use it, so use it at your own risk)
25 \n 25 \n
26 MinGW: 26 MinGW:
27 http://tdm-gcc.tdragon.net/download (you need the On-Demand Installer) 27 http://tdm-gcc.tdragon.net/download (you need the On-Demand Installer)
28 http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-webdl.exe/download (direct link to above file) 28 http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-webdl.exe/download (direct link to above file)
29 \n 29 \n
30 \n 30 \n
31 !Start 31 !Start
32 \n 32 \n
33 Use the 7z to "unzip/uncompress" the spring_88. 0_src. tar. gz and spring-mingwlibs( some random numbers and letters) . tar. gz ( in 7z select the file and press "Extract") files. You will end with a spring_88. 0_src. tar and spring-mingwlibs( some random numbers and letters) . tar files, uncompress them to. 33 Use the 7z to "unzip/uncompress" the spring_91. 0_src. tar. gz and spring-mingwlibs( some random numbers and letters) . tar. gz ( in 7z select the file and press "Extract") files. You will end with a spring_91. 0_src. tar and spring-mingwlibs( some random numbers and letters) . tar files, uncompress them to.
34 \n 34 \n
35 Now you have a "spring_88. 0" folder, inside that folder, create a folder named mingwlibs and paste inside it the files of mingwlibs. So you will have spring_88. 0\mingwlibs\bin; spring_88. 0\mingwlibs\dll; etc. . . 35 Now you have a "spring_91. 0" folder, inside that folder, create a folder named mingwlibs and paste inside it the files of mingwlibs. So you will have spring_91. 0\mingwlibs\bin; spring_91. 0\mingwlibs\dll; etc. . .
36 \n 36 \n
37 \n 37 \n
38 Install MinGW, select the 32bits version, 64bits is not supported (something to do with not all librarys[ddl i think] not begin 64bits and no one wanting to compile them in 64bits; in future when someone compile them in 64bits, Auswaschbar [AF from SpringRTS i think] expect 5-10% performance boost). 38 Install MinGW, select the 32bits version, 64bits is not supported (something to do with not all librarys[ddl i think] not begin 64bits and no one wanting to compile them in 64bits; in future when someone compile them in 64bits, Auswaschbar [AF from SpringRTS i think] expect 5-10% performance boost).
39 \n 39 \n
40 Select (make sure it is marked) at least the following components: 40 Select (make sure it is marked) at least the following components:
41 gcc (version: MinGW Stable!) 41 gcc (version: MinGW Stable!)
42 core 42 core
43 g++ 43 g++
44 openmp (optional) 44 openmp (optional)
45 binutils 45 binutils
46 mingw-runtime 46 mingw-runtime
47 w32api 47 w32api
48 mingw32-make (if you have no Make installed yet) 48 mingw32-make (if you have no Make installed yet)
49 gdb (recommended for debugging) 49 gdb (recommended for debugging)
50 [img]http://springrts.com/mediawiki/images/7/78/400px-Mingwscreenshot.jpg[/img] 50 [img]http://springrts.com/mediawiki/images/7/78/400px-Mingwscreenshot.jpg[/img]
51 \n 51 \n
52 DO NOT USE SPACES IN DIRECTORY(s) BELOW OR YOU WILL GET ERROR. 52 DO NOT USE SPACES IN DIRECTORY(s) BELOW OR YOU WILL GET ERROR.
53 \n 53 \n
54 Now install/use CMake and use cmake gui. exe, select the "source ( spring_88. 0 folder) " and a "build directory", press Generate, make sure that "MinGW Makefiles" and "Use default native compilers" are selected, wait it finish. 54 Now install/use CMake and use cmake gui. exe, select the "source ( spring_91. 0 folder) " and a "build directory", press Generate, make sure that "MinGW Makefiles" and "Use default native compilers" are selected, wait it finish.
55 \n 55 \n
56 Unmark: 56 Unmark:
57 BUILD_spring-dedicated 57 BUILD_spring-dedicated
58 BUILD_spring-headless 58 BUILD_spring-headless
59 BUILD_spring-multithreaded 59 BUILD_spring-multithreaded
60 \n 60 \n
61 Change: 61 Change:
62 \n 62 \n
63 CMAKE_BUILD_TYPE = RELWITHDEBINFO to CMAKE_BUILD_TYPE = RELEASE 63 CMAKE_BUILD_TYPE = RELWITHDEBINFO to CMAKE_BUILD_TYPE = RELEASE
64 \n 64 \n
65 MARCH_FLAG = i686 to MARCH_FLAG = native (look at http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html for more info or google "gcc march", that thing is your CPU optimization) 65 MARCH_FLAG = i686 to MARCH_FLAG = native (look at http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html for more info or google "gcc march", that thing is your CPU optimization)
66 \n 66 \n
67 CMAKE_INSTALL_PREFIX = C:/Program Files (x86)/Spring to CMAKE_INSTALL_PREFIX = directory were you compile spring engine will be placed (hope no one literally place this text >.>, and do not use the same directory that was used in "build directory" above). 67 CMAKE_INSTALL_PREFIX = C:/Program Files (x86)/Spring to CMAKE_INSTALL_PREFIX = directory were you compile spring engine will be placed (hope no one literally place this text >.>, and do not use the same directory that was used in "build directory" above).
68 \n 68 \n
69 If you do not want OMP unmark OPENMP, it is marked by default and i let it marked cause it give performance boost too. 69 If you do not want OMP unmark OPENMP, it is marked by default and i let it marked cause it give performance boost too.
70 \n 70 \n
71 Press Configure and wait it finish, then press Generate and wait it finish. 71 Press Configure and wait it finish, then press Generate and wait it finish.
72 \n 72 \n
73 Close CMake, if you did all correct you get no warning, if you did something wrong you will get a warning. 73 Close CMake, if you did all correct you get no warning, if you did something wrong you will get a warning.
74 \n 74 \n
75 \n 75 \n
76 \n 76 \n
77 Now you will need [size=3][b]admin right[/b][/size] for compiling: 77 Now you will need [size=3][b]admin right[/b][/size] for compiling:
78 \n 78 \n
79 Run cmd.exe ( http://en.wikipedia.org/wiki/Command_Prompt ), using cd "folder name" and press enter to go inside the folder and "cd .." and press enter to go a folder "up" ( http://coweb.cc.gatech.edu/ice-gt/339 for more info). 79 Run cmd.exe ( http://en.wikipedia.org/wiki/Command_Prompt ), using cd "folder name" and press enter to go inside the folder and "cd .." and press enter to go a folder "up" ( http://coweb.cc.gatech.edu/ice-gt/339 for more info).
80 \n 80 \n
81 Go to the "build directory" you chose in Cmake and digit "mingw32-make install-spring" and press enter, WAIT A LONG TIME, when it end you will have you optimized version in the CMAKE_INSTALL_PREFIX location you did choice. 81 Go to the "build directory" you chose in Cmake and digit "mingw32-make install-spring" and press enter, WAIT A LONG TIME, when it end you will have you optimized version in the CMAKE_INSTALL_PREFIX location you did choice.
82 \n 82 \n
83 jK told me you can use "mingw32-make install-spring -jx" too, were the x = to the numbers of your CPU cores +1, so dual core = "mingw32-make install-spring -j3" , so the compile time is faster, but i did not use it, so use it at your own risk. 83 jK told me you can use "mingw32-make install-spring -jx" too, were the x = to the numbers of your CPU cores +1, so dual core = "mingw32-make install-spring -j3" , so the compile time is faster, but i did not use it, so use it at your own risk.
84 \n 84 \n
85 \n 85 \n
86 \n 86 \n
87 Now if you use Zero-K Lobby you just need to go to Documents\My Games\Spring\engine change the 88. 0 folder name to "88. 0 backup", and paste you folder with the optimized version in Documents\My Games\Spring\engine with the name "88. 0" 87 Now if you use Zero-K Lobby you just need to go to Documents\My Games\Spring\engine change the 91. 0 folder name to "91. 0 backup", and paste you folder with the optimized version in Documents\My Games\Spring\engine with the name "91. 0"
88 \n 88 \n
89 You may need to copy all dll from \mingwlibs\dll to your 88. 0 folder, do not really remember if it was necessary, if you get no error, do not do it. 89 You may need to copy all dll from \mingwlibs\dll to your 91. 0 folder, do not really remember if it was necessary, if you get no error, do not do it.
90 \n 90 \n
91 Done it!!!!!!!!!!! 91 Done it!!!!!!!!!!!
92 \n 92 \n
93 \n 93 \n
94 \n 94 \n
95 If you build give a error or desycn to NOT ask me how, i have no idea, first time i did try i got error to, i think it was cause i compiled 2 times in same folder (do not do this). Do not use space(s) in directory/path/folder(s) or you will get a error of files not found. 95 If you build give a error or desycn to NOT ask me how, i have no idea, first time i did try i got error to, i think it was cause i compiled 2 times in same folder (do not do this). Do not use space(s) in directory/path/folder(s) or you will get a error of files not found.
96 Only thing i know is that it worked for me and [DDM]loveu2 and we do not desycn, and it is faster, how much faster i have no idea cause we do not have a deterministic benchmark system for springrts. My CPU is a AMD Turion II P560 2.5 GHz. 96 Only thing i know is that it worked for me and [DDM]loveu2 and we do not desycn, and it is faster, how much faster i have no idea cause we do not have a deterministic benchmark system for springrts. My CPU is a AMD Turion II P560 2.5 GHz.
97 \n 97 \n
98 SSE5 and AVX are causing descyn for some ppl, if your CPU use it, better to use another march flag from the link above that do not use these sets, in v89 and future you can use native cause SSE5 and AVX will be blocked in code, so native is safe. 98 SSE5 and AVX are causing descyn for some ppl, if your CPU use it, better to use another march flag from the link above that do not use these sets, in v89 and future you can use native cause SSE5 and AVX will be blocked in code, so native is safe.
99 \n 99 \n
100 I wanted to post more pics to make it easier, but do not want to use 100 I wanted to post more pics to make it easier, but do not want to use
101 http://imageshack.us/ , cause i fear that all pics will end up was a frog in a ice cube thing.... 101 http://imageshack.us/ , cause i fear that all pics will end up was a frog in a ice cube thing....
102 \n 102 \n
103 For more help and the oficial tutorial see: 103 For more help and the oficial tutorial see:
104 http://springrts.com/wiki/Building_Spring_on_Windows 104 http://springrts.com/wiki/Building_Spring_on_Windows
105 \n 105 \n
106 Someone with a Youtube Acc, could make a video tutorail about it to, so its even easer. 106 Someone with a Youtube Acc, could make a video tutorail about it to, so its even easer.
107 \n 107 \n
108 Hope you like it Licho. 108 Hope you like it Licho.
109 \n 109 \n
110 Dev can edit my post so it make more sense and/or look better, more structured. 110 Dev can edit my post so it make more sense and/or look better, more structured.
111 \n
112 [i]updated for 91.0 - KingRaptor[/i]