]> www.ginac.de Git - cln.git/blob - INSTALL.windows
Update the installation instructions for Windows.
[cln.git] / INSTALL.windows
1 Installation on Microsoft Windows:
2
3 There are three ways to create binaries of this package for Microsoft Windows:
4 1) Native binaries, built using the mingw tool chain.
5 2) Native binaries, built using the MS Visual C/C++ tool chain.
6 3) Binaries for the Cygwin environment.
7
8 ===============================================================================
9 1) Native binaries, built using the mingw tool chain.
10
11    I recommend to use the Cygwin environment as the development environment (*)
12    and mingw only as the target (runtime, deployment) environment.
13    For this, you need to install
14      * Cygwin (from https://cygwin.com/),
15      * some packages available from the Cygwin package installer:
16          make
17      * the mingw cross-compilation tools and runtime package, available from
18        the Cygwin package installer (setup-x86_64.exe):
19        - for creating 32-bit binaries: packages
20            mingw64-i686-gcc-core,
21            mingw64-i686-gcc-g++,
22            mingw64-i686-headers,
23            mingw64-i686-runtime
24        - for creating 64-bit binaries: packages
25            mingw64-x86_64-gcc-core,
26            mingw64-x86_64-gcc-g++,
27            mingw64-x86_64-headers,
28            mingw64-x86_64-runtime
29
30    Building 32-bit binaries for mingw is achieved through the following
31    preparation, configure, and build commands:
32
33       PATH=/usr/local/mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
34       export PATH
35       ./configure --host=i686-w64-mingw32 --prefix=/usr/local/mingw32 \
36             CC=i686-w64-mingw32-gcc \
37             CXX=i686-w64-mingw32-g++ \
38             CPPFLAGS="-I/usr/local/mingw32/include -Wall" \
39             LDFLAGS="-L/usr/local/mingw32/lib"
40       make
41       make check
42
43    Building 64-bit binaries for mingw is achieved through the following
44    preparation, configure, and build commands:
45
46       PATH=/usr/local/mingw64/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
47       export PATH
48       ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/mingw64 \
49             CC=x86_64-w64-mingw32-gcc \
50             CXX=x86_64-w64-mingw32-g++ \
51             CPPFLAGS="-I/usr/local/mingw64/include -Wall" \
52             LDFLAGS="-L/usr/local/mingw64/lib"
53       make
54       make check
55
56    Installation:
57
58       make install
59
60    (*) Note: The MSYS2 environment as a development environment is *not*
61        supported.  This environment contains an ignoble and ignominious hack:
62        In a program invocation, the program *by default* receives different
63        arguments than the ones that the caller has passed.  See
64        <https://www.msys2.org/wiki/Porting/#filesystem-namespaces>.
65        All program invocations in this environment are therefore unreliable.
66
67 ===============================================================================
68 2) Native binaries, built using the MS Visual C/C++ tool chain.
69
70    Note that binaries created with MSVC have a distribution constraint: They
71    depend on a closed-source library ('msvcr90.dll' for MSVC 9.0,
72    'vcruntime140.dll' for MSVC 14.0, and so on) which is not normally part of
73    a Windows installation.
74    You cannot distribute 'vcruntime*.dll' with the binaries - this would be a
75    violation of the GPL and of the Microsoft EULA.
76    You can distribute the binaries without including 'vcruntime*.dll'. Users
77    who don't have this library on their system will require to pull some files
78    (api-ms-win*.dll) through the Windows Update mechanism, see
79    https://support.microsoft.com/en-us/kb/2999226 .
80
81    This recipe requires MS Visual C/C++ 9.0 or newer.
82    You don't need the Visual Studio IDE, just the C/C++ tool chain.
83    As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from
84    https://landinghub.visualstudio.com/visual-cpp-build-tools (it's the file
85    visualcppbuildtools_full.exe).
86
87    This recipe requires also a Cygwin environment (with 'bash', the common POSIX
88    commands, and 'make') as a build environment. Building with 'nmake' is not
89    supported.
90    For this, you need to install
91      * Cygwin (from https://cygwin.com/),
92      * some packages available from the Cygwin package installer:
93          make
94
95    You also need the scripts 'ar-lib' and 'compile' from
96      https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD
97      https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD
98    respectively.
99    They may also be included in this package, in directory 'build-aux/'.
100    Save them; the instructions below assume that you stored them in $HOME/msvc/.
101    Make them executable:
102       chmod a+x ar-lib compile
103
104    Start a bash (from Cygwin).
105
106    Make sure that the MSVC tools ("cl" etc.) are found in PATH and the
107    environment variables INCLUDE and LIB are set appropriately.
108    In a typical MSVC 9.0 installation, it can be achieved by running
109      C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
110    In a typical MSVC 14.0 installation on Windows 10, it can be achieved
111    - for creating 32-bit binaries: through the following bash commands:
112
113       # Set environment variables for using MSVC 14,
114       # for creating native 32-bit Windows executables.
115
116       # Windows C library headers and libraries.
117       WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
118       WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
119       INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
120       LIB="${WindowsCrtLibDir}x86;$LIB"
121
122       # Windows API headers and libraries.
123       WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
124       WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
125       INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
126       LIB="${WindowsSdkLibDir}x86;$LIB"
127
128       # Visual C++ tools, headers and libraries.
129       VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
130       VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
131       PATH=`cygpath -u "${VCINSTALLDIR}"`/bin:"$PATH"
132       INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
133       LIB="${VCINSTALLDIR}"'\lib;'"${LIB}"
134
135       export INCLUDE LIB
136
137    - for creating 64-bit binaries: through the following bash commands:
138
139      # Set environment variables for using MSVC 14,
140      # for creating native 64-bit Windows executables.
141
142      # Windows C library headers and libraries.
143      WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
144      WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
145      INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
146      LIB="${WindowsCrtLibDir}x64;$LIB"
147
148      # Windows API headers and libraries.
149      WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
150      WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
151      INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
152      LIB="${WindowsSdkLibDir}x64;$LIB"
153
154      # Visual C++ tools, headers and libraries.
155      VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
156      VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
157      PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH"
158      INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
159      LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}"
160
161      export INCLUDE LIB
162
163    Building 32-bit binaries with MSVC is achieved through the following
164    preparation, configure, and build commands:
165
166       PATH=/usr/local/msvc32/bin:$PATH
167       export PATH
168
169       win32_target=_WIN32_WINNT_WINXP   # for MSVC 9.0
170       win32_target=_WIN32_WINNT_VISTA   # possibly for MSVC >= 10.0
171       win32_target=_WIN32_WINNT_WIN7    # possibly for MSVC >= 10.0
172       win32_target=_WIN32_WINNT_WIN8    # possibly for MSVC >= 10.0
173
174       ./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \
175             CC="$HOME/msvc/compile cl -nologo" \
176             CFLAGS="-MD" \
177             CXX="$HOME/msvc/compile cl -nologo" \
178             CXXFLAGS="-MD" \
179             CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc32/include" \
180             LDFLAGS="-L/usr/local/msvc32/lib" \
181             LD="link" \
182             NM="dumpbin -symbols" \
183             STRIP=":" \
184             AR="$HOME/msvc/ar-lib lib" \
185             RANLIB=":"
186       make
187       make check
188
189    Building 64-bit binaries with MSVC is achieved through the following
190    preparation, configure, and build commands:
191
192       PATH=/usr/local/msvc64/bin:$PATH
193       export PATH
194
195       win32_target=_WIN32_WINNT_WINXP   # for MSVC 9.0
196       win32_target=_WIN32_WINNT_VISTA   # possibly for MSVC >= 10.0
197       win32_target=_WIN32_WINNT_WIN7    # possibly for MSVC >= 10.0
198       win32_target=_WIN32_WINNT_WIN8    # possibly for MSVC >= 10.0
199
200       ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \
201             CC="$HOME/msvc/compile cl -nologo" \
202             CFLAGS="-MD" \
203             CXX="$HOME/msvc/compile cl -nologo" \
204             CXXFLAGS="-MD" \
205             CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \
206             LDFLAGS="-L/usr/local/msvc64/lib" \
207             LD="link" \
208             NM="dumpbin -symbols" \
209             STRIP=":" \
210             AR="$HOME/msvc/ar-lib lib" \
211             RANLIB=":"
212       make
213       make check
214
215    Installation:
216
217       make install
218
219 ===============================================================================
220 3) Binaries for the Cygwin environment.
221
222    The generic instructions in the INSTALL file apply. But here are more
223    specific ones.
224
225    You need to install
226      * Cygwin (from https://cygwin.com/),
227      * some packages available from the Cygwin package installer:
228          make
229      * the Cygwin [cross-]compilation tools package, available from
230        the Cygwin package installer (setup-x86_64.exe):
231        - for creating 32-bit binaries: packages
232            cygwin32-gcc-core,
233            cygwin32-gcc-g++,
234            cygwin32
235        - for creating 64-bit binaries: packages
236            gcc-core,
237            gcc-g++
238
239    Building 32-bit binaries for Cygwin must be done in a directory *outside*
240    the Cygwin /home and /usr hierarchies. It is achieved through the following
241    preparation, configure, and build commands:
242
243       PATH=/usr/local/cygwin32/bin:/usr/i686-pc-cygwin/sys-root/usr/bin:$PATH
244       export PATH
245       ./configure --host=i686-pc-cygwin --prefix=/usr/local/cygwin32 \
246             CC=i686-pc-cygwin-gcc \
247             CXX=i686-pc-cygwin-g++ \
248             CPPFLAGS="-I/usr/local/cygwin32/include -Wall" \
249             LDFLAGS="-L/usr/local/cygwin32/lib"
250       make
251       make check
252
253    Building 64-bit binaries for Cygwin is achieved through the following
254    preparation, configure, and build commands:
255
256       PATH=/usr/local/cygwin64/bin:$PATH
257       export PATH
258       ./configure --host=x86_64-pc-cygwin --prefix=/usr/local/cygwin64 \
259             CC=x86_64-pc-cygwin-gcc \
260             CXX=x86_64-pc-cygwin-g++ \
261             CPPFLAGS="-I/usr/local/cygwin64/include -Wall" \
262             LDFLAGS="-L/usr/local/cygwin64/lib"
263       make
264       make check
265
266    Installation:
267
268       make install
269
270 ===============================================================================
271 Dependencies:
272
273 This package depends on GNU libiconv. (See the file DEPENDENCIES.) Before
274 building this package, you need to build GNU libiconv, in the same development
275 environment, with the same configure options, and install it ("make install").
276 ===============================================================================