]> git.lyx.org Git - lyx.git/blob - INSTALL.Win32
INSTALL.Win32: add missing info
[lyx.git] / INSTALL.Win32
1 Compiling LyX 2.4 for Win32 and creating Windows installer
2 ==========================================================
3
4 It's recommended to compile LyX using Microsoft Visual C++ 2017 and CMake.
5
6
7 Compiling with Microsoft Visual C++ (MSVC)
8 ===================================
9
10         The easiest way to install LyX with MSVC is to follow this Wiki page:
11         
12         http://wiki.lyx.org/Windows/Compilation
13         
14         If you find there any errors please write a mail to the lyx-devel mailing list.
15         
16 ----------------------------------------------------------------------------
17         
18         The following instructions assume the LyX source code is in C:\LyX\lyx-24
19         You can also use another directory if you prefer.
20
21 1       Install MSVC 2017
22
23         If you don't have Visual C++ 2017 installed, get the free Community edition
24         from https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15
25
26 2       Install Qt
27
28         Download the latest Qt for Open Source C++ development on Windows (VS2017)
29         from https://qt.io/download-open-source/
30         Qt 5.12.x is recommended, but 5.9.x or later versions should work as well.
31         If you want to build LyX as 32bit application, you need Qt x86.
32         If you want to build LyX as 64bit application, you need Qt x64.
33         Make sure that the bin subfolder of the Qt installation (e.g.
34
35 3       Install Python
36
37         Install the latest Python 3.x version from
38         https://www.python.org/downloads/
39         Assure that you use the installer option "Add Python 3.x to PATH"
40
41 4       Install CMake
42
43         Install the latest CMake from http://www.cmake.org
44
45 5       Download dependencies
46
47         Download the LyX for Windows build dependencies from
48         ftp.lyx.de/LyXWinInstaller/lyx-windows-deps-msvc2017.zip
49         and extract it e.g. to 
50         C:\LyX\lyx-24\lyx-windows-deps-msvc2017
51
52 6       Configure
53
54         - Open the CMake GUI
55         
56         - Set the source code path to C:\LyX\lyx-24
57           Set the build path to C:\LyX\lyx-24-build
58           Click Configure and set the generator to "Visual Studio 15 2017" to
59           build a 32bit LyX or add the x64 option to build a 64bit LyX.
60
61         - Set LYX_USE_QT to QT5 and click Configure.
62         
63         - You will now get an error about missing GNUWIN32 directory.
64
65         - Set GNUWIN32_DIR to the folder that contains the dependencies.
66           (This alternative does currently not work:
67            Enable LYX_DEPENDENCIES_DOWNLOAD and click Configure.
68            Pre-compiled dependencies will automatically be downloaded.)
69         
70         - set CMAKE_PREFIX_PATH to the path of Qt
71           e.g. to C:/Qt/Qt5.12.5/5.12.5/msvc2017
72
73         - Enable the LYX_INSTALL option and click Configure.
74
75         - Click Generate.
76
77 7       Compile
78
79         A Microsoft Visual C++ solution should has been generated at
80         C:\LyX\lyx-23-build\lyx.sln
81         - Open the lyx.sln by double-clicking on it
82         - Use the menu BUILD -> Build Solution
83
84 8       Copy dependencies
85
86         - Copy these folders:
87         C:\LyX\lyx-24\lyx-windows-deps-msvc2017\bin
88         C:\LyX\lyx-24\lyx-windows-deps-msvc2017\imagemagick
89         C:\LyX\lyx-24\lyx-windows-deps-msvc2017\Python
90         C:\LyX\lyx-24\lyx-windows-deps-msvc2017\ghostscript
91         C:\LyX\lyx-24\lyx-windows-deps-msvc2017\Resources
92         to C:\LyX\lyx-24-build\LYX_INSTALLED
93         (allow the request to overwrite)
94
95         - Copy from the Qt bin directory (see section 2 "Install Qt" above) these files:
96         Qt5Core.dll
97         Qt5Gui.dll
98         Qt5Svg.dll
99         Qt5Widgets.dll
100         Qt5WinExtras.dll
101         Qt5Cored.dll (if compiling Debug version)
102         Qt5Guid.dll (if compiling Debug version)
103         Qt5Svgd.dll (if compiling Debug version)
104         Qt5Widgetsd.dll (if compiling Debug version)
105         Qt5WinExtrasd.dll (if compiling Debug version)
106         to C:\LyX\lyx-24-build\LYX_INSTALLED\bin
107         
108         - Copy from this Qt directory
109         C:\Qt\Qt5.12.5\5.12.5\msvc2017\plugins
110         these subdirectories: 
111         iconengines
112         imageformats
113         platforms
114         styles
115         to C:\LyX\lyx-24-build\LYX_INSTALLED\bin
116
117 9       Start LyX
118
119         C:\LyX\lyx-24-build\LYX_INSTALLED\bin\lyx.exe
120
121 10      Define path prefix
122
123         In LyX use the menu Tools->Preferences
124         There input the the following the the field "Path prefix":
125
126         "$LyXDir\bin;$LyXDir\Python;$LyXDir\imagemagick;$LyXDir\ghostscript"
127
128         You may also add the location of your LaTeX installation if it's not on the
129         system PATH, and the location of JabRef.
130
131
132 Creating the Installer
133 ======================
134
135         - Get NSIS from http://nsis.sourceforge.net
136         - In the LyX source directory, go to development\Win32\packaging\installer
137         - Follow the steps in the file Readme.txt
138
139
140 Compiling with GCC with MinGW64 + MSYS2 Environment using autotools
141 ===================================================================
142 1       Install MSYS2, MINGW64, Qt5+
143         https://wiki.qt.io/MSYS2
144 2       Install bc (Bench calculater), which autotools uses for some reason to compile LyX
145         pacman -S bc
146 3       Run the standard autotools install (Adapt paths and arguments accordingly)
147         ./autogen.sh
148          ./configure --without-x --enable-qt5 --disable-debug --enable-optimization --prefix=/mingw64
149         make
150         make install
151
152
153 Cross-Compiling on unix with MXE using autotools
154 =================================================
155 1       Install MXE: http://mxe.cc
156         You can either install from sources, the generic .tar binaries or debian .deb packages.
157         Installing the following .deb packages will drag in all needed dependencies:
158                 mxe-x86-64-w64-mingw32.shared-file
159                 mxe-x86-64-w64-mingw32.shared-gcc
160                 mxe-x86-64-w64-mingw32.shared-libiconv
161                 mxe-x86-64-w64-mingw32.shared-qtimageformats
162                 mxe-x86-64-w64-mingw32.shared-qtsvg
163                 mxe-x86-64-w64-mingw32.shared-qtwinextras
164         Of course you can also use the static and/or 32bit versions.
165 2       Run the standard autotools install (Adapt paths and arguments accordingly)
166         ./autogen.sh
167         mkdir builddir-mingw
168         cd builddir-mingw
169         PATH="/usr/lib/mxe/usr/bin:$PATH" ../configure --host=x86-64-w64-mingw32.shared --with-qt-dir=/usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5 --enable-qt5 --with-included-boost --with-included-hunspell --with-included-mythes --disable-debug --enable-optimization --prefix=/mingw64
170         PATH="/usr/lib/mxe/usr/bin:$PATH" make
171         PATH="/usr/lib/mxe/usr/bin:$PATH" DESTDIR=/tmp/lyxinstall make install
172         This uses the paths from the 64bit shared MXE version installed from .deb packages.
173 3       If you want to run the resulting lyx.exe from the build directory using wine,
174         create symlinks for all needed .dlls:
175         cd builddir-mingw/src
176         ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/bin/*.dll .
177         ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/bin/*.dll .
178         wine64 lyx.exe
179