Project

General

Profile

Build Quassel on Windows Mingw » History » Version 45

TheOneRing, 04/09/2014 10:53 PM

1 1 TheOneRing
h1. Build Quassel on Windows Mingw
2 1 TheOneRing
3 14 TheOneRing
h2. Build Quassel with QT only
4 13 TheOneRing
5 1 TheOneRing
h2. Software Requirements
6 2 seezer
7 1 TheOneRing
* "QT SDK":http://qt.nokia.com/downloads
8 19 TheOneRing
* "DBGHELP Mingw":http://dl.dropbox.com/u/6292727/dbghelp/dbghelp.zip
9 15 TheOneRing
* "CMake":http://www.cmake.org/cmake/resources/software.html
10 1 TheOneRing
11 1 TheOneRing
h2. Installation
12 1 TheOneRing
13 15 TheOneRing
h3. Step 1: Install QT SDK
14 1 TheOneRing
15 2 seezer
Download and install the QT SDK and select mingw to install with QT.
16 1 TheOneRing
17 19 TheOneRing
h3. Step 2: Install DBGHELP Mingw
18 1 TheOneRing
19 19 TheOneRing
If you are using  mingw w64 skip this step 
20 15 TheOneRing
21 34 avih
Download "DBGHELP Mingw":http://bugs.quassel-irc.org/attachments/download/412/dbghelp-mingw.zip and extract it over the mingw folder (make sure dbghelp.h ends up in mingw\include and similarly for the mingw\lib). (this file was compiled from "libdbghelp.7z":http://download.gna.org/warzone/development/libdbghelp.7z and "dbghelp.h":http://sourceforge.net/tracker/index.php?func=detail&aid=1660497&group_id=2435&atid=352435 , the latter no longer available).
22 1 TheOneRing
23 19 TheOneRing
h3. Step 3: Install CMake
24 1 TheOneRing
25 3 TheOneRing
26 20 TheOneRing
h2. Checkout Quassel
27 4 TheOneRing
28 3 TheOneRing
* "git clone git://gitorious.org/quassel/quassel.git"
29 1 TheOneRing
30 1 TheOneRing
h2. Compile Quassel
31 1 TheOneRing
32 1 TheOneRing
* open a command line
33 1 TheOneRing
* add mingw to your path  (set PATH=%PATH%;'mingwdir')
34 1 TheOneRing
* add cmake to your path (analog to mingw)
35 15 TheOneRing
* add QT to yo your path, 'qt\version'\qt\bin
36 1 TheOneRing
* switch to the directory where you checked out Quassel
37 1 TheOneRing
* type "mkdir build"
38 1 TheOneRing
* type "cd build"
39 1 TheOneRing
* type "cmake -G "MinGW Makefiles" .."
40 13 TheOneRing
* type "mingw32-make"
41 13 TheOneRing
42 13 TheOneRing
43 13 TheOneRing
h2. Build Quassel with Windows KDE
44 15 TheOneRing
45 13 TheOneRing
# got to the "Emerge Tutorial":http://techbase.kde.org/Getting_Started/Build/KDE4/Windows/emerge
46 13 TheOneRing
# check out emerge and set up the kdesettings.bat acording to the kde tutorial
47 22 TheOneRing
# install quassel "emerge quassel-qt"  or "emerge quassel" to build quassel with kdesupport, emerge will install all dependency's for you
48 13 TheOneRing
# when emerge has finished all jobs, start quassel
49 13 TheOneRing
50 1 TheOneRing
The steps above would also be possible with msvc2008
51 23 avih
52 26 avih
h3. Notes after following this guide with mingw which comes with QTSDK (1.2.1)
53 23 avih
54 35 avih
# When installing QtSDK, and especially if you have Visual Studio installed but you want to compile with mingw, make sure to use the custom installer, and check *Qt SDK > Development Tools > Desktop Qt > Qt 4.8.1 (Desktop) > Desktop Qt 4.8.1 - MinGW*
55 23 avih
# Cmake can be downloaded "here":http://www.cmake.org/cmake/resources/software.html . I got the windows binary zip file, extracted it, and added the path of the 'bin' dir within it.
56 27 avih
# The mingw bin dir is @<QTSDK-dir>\mingw\bin@, the QT path is @<QTSDK-dir>\Desktop\Qt\4.81\mingw\bin@ .
57 1 TheOneRing
# The official 0.8 tarball failed to build after 80% with the following error (which I couldn't fix):
58 27 avih
<pre>
59 27 avih
mingw32-make[2]: *** No rule to make target `po/qt_cs.qm', needed by `po/CMakeFiles/po'.  Stop.
60 27 avih
mingw32-make[1]: *** [po/CMakeFiles/po.dir/all] Error 2
61 27 avih
mingw32-make: *** [all] Error 2
62 27 avih
</pre>
63 31 avih
# After successfully compiling the cloned git master from command line, I needed the following DLLs at the same dir as the exe: *QtCore4.dll QtGui4.dll QtNetwork4.dll QtWebKit4.dll libgcc_s_dw2-1.dll mingwm10.dll phonon4.dll*. These files can be copied from the mingw and the QT dirs, or from the win32 official quassel distribution package "here":http://quassel-irc.org/downloads (7-zip can extract the windows installer, these files are in there).
64 39 avih
# *Multi threaded compilation*: On windows, make doesn't support -jN for concurrent N compile threads, however, it does support -j (without N), which tries to use as many threads as possible (I _think_ upto 64 threads), so if you have enough RAM (I didn't see system memory usage go beyond ~5G when I tried it), you may use -j either when building from command line, or with QtCreator: add -j at: Projects > Build Steps > Make > additional arguments. It will speed up clean rebuild significantly.
65 31 avih
# *QTCreator project* (not mandatory, but nice as IDE and for debugging):
66 30 avih
* Run QTCreator and click File -> Open File or Project
67 30 avih
* Choose the main CMakeList.txt file at the root of the source tree (the same dir with the INSTALL and README files).
68 30 avih
* Point to your cmake.exe file (which you download earlier).
69 40 avih
* Add the following arguments (make sure your qtsdk path matches): -DQT_QMAKE_EXECUTABLE=C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\qmake.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo . Note that generally -DCMAKE_BUILD_TYPE=Debug should be better for breakpoints, but it crashed for me, and RelWithDebInfo didn't. Also worked for me for good single stepping: DebugFull. YMMV.
70 30 avih
* Click run cmake. It should finish without errors, click Finish.
71 37 avih
* Once the project is open, click "Projects" at the left side, expand Details at the "Build Environment" section, click the line of the variable PATH, and add the QT path (e.g. c:/QtSDK/Desktop/Qt/4.8.1/mingw/bin). Do the same for "Run Environment".
72 38 avih
* Now you can edit the code, follow symbols, and should be able to build, breakpoint and single-step quassel.\
73 41 TheOneRing
74 41 TheOneRing
75 41 TheOneRing
76 41 TheOneRing
h1. Build Quassel on Windows Mingw
77 41 TheOneRing
78 41 TheOneRing
h2. Build Quassel with QT only
79 41 TheOneRing
80 41 TheOneRing
h2. Software Requirements
81 41 TheOneRing
82 44 TheOneRing
* "python 3":https://www.python.org/
83 44 TheOneRing
* "Git":http://msysgit.github.io/
84 41 TheOneRing
* "QT 4.8.5":http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-mingw.exe
85 41 TheOneRing
86 41 TheOneRing
87 41 TheOneRing
h2. Installation
88 1 TheOneRing
89 41 TheOneRing
h3. Install Python
90 44 TheOneRing
91 41 TheOneRing
If you already have installed python you can skip this step.
92 1 TheOneRing
93 41 TheOneRing
h3. Install Git
94 44 TheOneRing
95 41 TheOneRing
If you already have installed python you can skip this step.
96 41 TheOneRing
97 41 TheOneRing
h3. Setup your installation directory
98 41 TheOneRing
Create the directory you will use as your ROOT directory for your quassel build.
99 1 TheOneRing
100 41 TheOneRing
h3. Install and setup emerge
101 44 TheOneRing
102 41 TheOneRing
First of all you need to checkout emerge using git.
103 41 TheOneRing
Open a powershell or instance, switch to your ROOT directory and clone emerge "git clone git://anongit.kde.org/emerge".
104 41 TheOneRing
Check out the latest stable branch which is currently "kde-4.12"("cd emerge" "git checkout kde-4.12").
105 41 TheOneRing
Create a "etc" folder in your ROOT directory.
106 42 TheOneRing
Save the following ini file to "ROOT/etc/kdesettings.ini" 
107 41 TheOneRing
108 41 TheOneRing
<pre>
109 41 TheOneRing
[General]
110 41 TheOneRing
#a fast make tool for cmake projects
111 41 TheOneRing
EMERGE_USE_NINJA = True
112 41 TheOneRing
KDECOMPILER = mingw4
113 41 TheOneRing
EMERGE_ARCHITECTURE = x86
114 41 TheOneRing
EMERGE_VERBOSE = 1
115 41 TheOneRing
EMERGE_NOCOPY = True
116 41 TheOneRing
#use jom, jom is a fast make tool
117 41 TheOneRing
EMERGE_MAKE_PROGRAM = jom
118 41 TheOneRing
#use gcc 4.4.7
119 41 TheOneRing
EMERGE_OPTIONS = features.legacyGCC=True
120 41 TheOneRing
121 41 TheOneRing
[Paths]
122 41 TheOneRing
DOWNLOADDIR = ${KDEROOT}\download
123 41 TheOneRing
KDEROOT = D:\quassel-noqt
124 41 TheOneRing
PYTHONPATH = C:\python34
125 41 TheOneRing
KDESVNDIR = ${DOWNLOADDIR}\svn
126 41 TheOneRing
KDEGITDIR = ${DOWNLOADDIR}\git
127 41 TheOneRing
128 41 TheOneRing
[ShortPath]
129 41 TheOneRing
EMERGE_USE_SHORT_PATH = False
130 41 TheOneRing
EMERGE_ROOT_DRIVE = u:
131 41 TheOneRing
EMERGE_SVN_DRIVE = s:
132 41 TheOneRing
EMERGE_GIT_DRIVE = q:
133 41 TheOneRing
EMERGE_DOWNLOAD_DRIVE = t:
134 41 TheOneRing
135 41 TheOneRing
[Version]
136 41 TheOneRing
EMERGE_SETTINGS_VERSION = 1
137 41 TheOneRing
138 41 TheOneRing
[Portage]
139 43 TheOneRing
PACKAGE_IGNORES =  win32libs/openssl;libs/qt;kde/kdelibs;kde/kde-runtime;kdesupport/phonon;kdesupport/phonon-ds9;binary/mysql-pkg;win32libs/dbus;dev-util/git;dev-util/subversion
140 41 TheOneRing
141 41 TheOneRing
</pre>
142 41 TheOneRing
Set KDEROOT to your ROOT directory for building quassel.
143 41 TheOneRing
Set PYTHONPATH to the location of your python installation.
144 41 TheOneRing
145 41 TheOneRing
Important is the value of PACKAGE_IGNORES here we disable all packages emerge wants to install by default.
146 41 TheOneRing
147 41 TheOneRing
In your powersehll instance go to ROOT/emerge and call ". kdeenv.ps1" the "." is important to load the script.
148 41 TheOneRing
149 41 TheOneRing
Lets start with emerging the compiler, "emerge mingw-w32".
150 41 TheOneRing
Now lets see what emerge wants to install, call "emerge -p quassel", if you see a package in the list of dependencies you don't want to install add it to PACKAGE_IGNORES.
151 41 TheOneRing
152 41 TheOneRing
153 1 TheOneRing
154 41 TheOneRing
h3. Install Qt 4.8.5
155 44 TheOneRing
156 41 TheOneRing
Install to your ROOT directory.
157 41 TheOneRing
When you get asked for the location of your mingw location set it to "ROOT/mingw" and ignore the warning.
158 41 TheOneRing
159 41 TheOneRing
h3. Build quassel
160 41 TheOneRing
Go to your powershell window, and enter "emerge quassel" now quassel and all dependencies for quassel should be automatically be build.