Project

General

Profile

Preparing a Windows machine for Bilder » History » Version 165

John Cary, 12/29/2023 06:28 AM

1 1 Redmine Admin
# Preparing a Windows machine for Bilder (64-bit only)
2
3 39 Ted Sume
For building on Windows 10 in Ubuntu, follow the Linux Bilder setup instructions. 
4
5 112 David Alexander
_Warning:_ In following the directions below, pre-defined env variables like CL, PETSC_DIR, PETSC_ARCH, and others will cause problems.  For example, one user had CL=/nologo which prevented the version and other info from being printed and caused bilder to fail.
6 1 Redmine Admin
7
# Basic Windows Configuration
8
9 112 David Alexander
## UAC
10 1 Redmine Admin
11 112 David Alexander
Windows 7/2008: For 64-bit systems, 64-bit applications are stored in C:\Program Files and 32-bit applications are stored in C:\Program Files (x86). UserAccountControlSettings can be fine-tuned (see Control-Panel, System and Security, Action Center). Set Control Setting to the lowest setting (never notify) to avoid unwanted dialog boxes. This requires a reboot to take effect! The UAC Settings must be adjusted to "never notify" (this action is needed to make symbolic links during bilder runs and building Atlas). \
12 1 Redmine Admin
13 152 John Cary
## File Name too long
14
15
This can be a problem when cloning Trilinos.  To fix, see https://www.techinpost.com/the-file-name-too-long/.  In essence, use regedit to go to
16
```
17
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
18
```
19
where you can set LongPathsEnabled to 1, then reboot.
20
21 112 David Alexander
## Editing your system path on Windows
22
23 1 Redmine Admin
From the Start menu, right click on My Computer and choose Properties. Choose the Advanced Tab, and click the Environment Variables button towards the bottom of the dialog. In System Variables, highlight Path and click Edit. This is where you make changes to your system path.
24
25 112 David Alexander
## If your machine is on a Windows Domain (as compared to a WORKGROUP), then ensure that Windows knows its domainname
26 1 Redmine Admin
27 96 David Alexander
If your machine is on a Windows Domain, then Bilder can set a common variable that makes sense in that Domain. If you are not on a Windows Domain, then Bilder will still work fine (except for maybe emailing). To ensure Windows knows its domainname to the following.
28 89 David Alexander
29 1 Redmine Admin
* From a command prompt, type the command: 
30
31
~~~~~~
32
ipconfig /all
33
~~~~~~
34
35 96 David Alexander
Look for the value of the "Primary Dns Suffix" field, which should be your domain name (i.e. txcorp.com).
36 1 Redmine Admin
37
* If cygwin is already installed,
38
39
~~~~~~
40
ipconfig /all | grep -i "Primary Dns Suffix" | sed -e 's/^.*: //'
41
~~~~~~
42
43 89 David Alexander
should return the domainname. 
44 1 Redmine Admin
45
* For Windows 7/Windows 2008 machines that are not a member of the Windows Domain, Active Directory, do the following:
46
    1. Right click on My Computer, select properties
47
    2. Click on Advanced system settings
48
    3. Select the computer name tab
49
    4. Click the change button
50
    5. Click the more button
51
    6. Enter the Primary DNS suffix. i.e. txcorp.com 
52
53 112 David Alexander
## Create initial directories
54 1 Redmine Admin
55
* Create the folder C:\\bin (if not already present).
56
* Add or move C:\\bin to the front of your system path.
57
58 113 David Alexander
# Software "Required" for Bilder
59 1 Redmine Admin
60 74 David Alexander
What is absolutely required for Bilder depends on what you are trying to build. For example, if you are **only building user documentation**, then you only need
61 37 John Cary
62 74 David Alexander
* Blat (for emailing yourself)
63 36 John Cary
* Cygwin (for bash shell)
64 1 Redmine Admin
* CMake from an installer
65 157 John Cary
* NASM from an installer
66 38 John Cary
* Python from an installer
67
* Latex (MikTek below)
68 1 Redmine Admin
* Visual Studio Express (for nmake)
69 36 John Cary
70 162 Tech-X Corporation
If you have installed a package, you will need to open a new Cygwin window to update PATH in order for your Cygwin bash shell to find the package.  To check whether a package is in PATH, from a Cygwin shell, enter
71
72
{{{
73
echo $PATH
74
}}}
75
76
After installing the requirements, you can add the arguments,  -W python,cmake, and your installed Python and CMake will be used if your path is correct.
77 1 Redmine Admin
78 144 David Alexander
Since bilder uses the C++17 conformance flags, we require:
79 82 John Cary
80 144 David Alexander
* Visual Studio 2017 version 15.7 or higher (As of Oct 2019 the latest upgrade version is 15.9.17, which is fine)
81 83 John Cary
* Windows 10 or Windows 10 SDK
82
83 74 David Alexander
Below is a list of the Tools and Libraries that are most often needed.
84
85
# Tools (Required for most common builds within Bilder)
86
87 1 Redmine Admin
## Blat
88
89 74 David Alexander
*Blat is a sendmail client for Windows needed to send emails.*
90 1 Redmine Admin
91 149 David Alexander
* Download Blat from [The Blat SourceForge](http://sourceforge.net/projects/blat) Site and extract all files. The latest version should be fine.
92 150 David Alexander
* Extract the zip file (e.g. blat3222_32.full.zip) into C:\\bin.
93
* Copy the contents of the "full" directory up two diretories into "C:\bin" (i.e. C:\bin\blat3222\full\blat.{exe,dll} to C:\bin\blat.{exe,dll}).
94
* Execute the following command in a cygwin terminal to check that it works
95 1 Redmine Admin
96
~~~~~~
97
    blat -install mail.txcorp.com <username>@txcorp.com
98
~~~~~~
99
100
## CMake
101
102 74 David Alexander
*CMake is a cross-platform build system needed to configure many of necessary packages.*
103 1 Redmine Admin
104
* Install [CMake (a 32-bit application)](http://www.cmake.org/files/).
105 164 David Alexander
  * Version 3.17 is what we use as of July 2023. However, picking a later version is better because it will allow bilder to build future versions of cmake.
106 26 John Cary
  * Add the CMake path to the front of the system path! (Needed to build newer 64 bit versions through Bilder)
107 1 Redmine Admin
  * When this step is complete, make sure the newest CMake is the only one in your system path.
108
109 10 Redmine Admin
## CYGWIN
110 1 Redmine Admin
111 74 David Alexander
*Cygwin is a Unix shell program for Windows and is needed to run the bash code of Bilder.*
112
113 1 Redmine Admin
### Gotchas (in advance)
114
115 163 Ted Sume
* Need at least version 7.59 of curl
116 1 Redmine Admin
* Do not install Cygwin's MinGW. Those are installed in a separate area to reduce conflicts.
117
* Do not install Cygwin's rc, or you may get a weird error (/focmTryCompileExec.exe.embed.manifest.res: No such file or directory) about cl being invalid.  This can be seen by the output of 'which rc'.
118
* Do not install Cygwin's mt.  If 'which mt' returns /bin/mt or /usr/bin/mt, then move this aside too.
119 11 Redmine Admin
* If 'which link' returns /usr/bin/link, then move this aside (mv /usr/bin/link.exe /usr/bin/linkoff.exe) so that it is not picked up to replace the Visual Studio link.  (This is where we could define BILDER_LINK.)
120 1 Redmine Admin
* Make sure that 'which find' returns the cygwin version (/usr/bin/find), not the Windows version.
121
* Make sure 'which cmd' returns the Windows version. If not, check that your bash_profile has not made an error in setting your path.
122
* If you get an error like "ValueError: Symbol table not found" when building numpy, you are somehow using a 32-bit version of objdump.  Disable the 32-bit version.
123
124
### Updating Cygwin
125
126
* Be sure to select the version of subversion that is compatible with any other sister machines being run through jenkins.  They must all use the same version of svn, which must be the same version chosen in Jenkins.
127
* If you have moved aside any of the interfering commands (e.g. link, mt, rc) in the past and have recently updated cygwin or Windows, then do the 'which' checks again.
128
* Recreate the /etc/passwd and /etc/group file again using the mkpasswd and mkgroup commands described in the Configuring Cygwin section.
129
* Install Cygwin from [here](http://cygwin.com/install.html). There are now separate installers for 64 bit (setup-x86_64.exe ) and 32 bit (setup-x86.exe).
130
* Upon running setup-*.exe, select the packages:
131 3 Redmine Admin
  * Base -> util-linux
132
  * Devel -> bison
133
  * Devel -> flex
134 4 Redmine Admin
  * Devel -> gcc-g++ and gcc-fortran (4.9.3 does not compile sqlite, so choose 4.9.2)
135 3 Redmine Admin
  * Devel -> git
136
  * Devel -> make
137
  * Devel -> mercurial
138 1 Redmine Admin
  * Devel -> patch
139 27 John Cary
  * Devel -> subversion (If this machine will be a Jenkins slave, the version of subversion that is consistent with the Jenkins master's svnkit should be chosen. The latest version supported by svnkit is 1.8.14 at the time, Dec. 31, 2016, of this writing.)
140 3 Redmine Admin
  * Editors -> vim and emacs (and alternate editors of choice)
141
  * Math -> bc
142
  * Net -> openssh
143 25 Matt Copper
  * Net -> curl
144 3 Redmine Admin
  * Python -> python (see note below)
145
  * Shells -> mintty
146
  * Utils -> diffutils
147
  * Utils -> dos2unix
148
  * Web -> wget
149 1 Redmine Admin
150
* Do NOT install any of the mingw packages.  If used, they must be installed separately to overcome path issues.  (NumPy will not accept the different, distinguishing name for mingw's gcc).
151
152
* Note: PATH should be set such that the Windows python is found before the cygwin python. We need the cygwin python to build PETSc. Once PETSc is cmaked, this requirement will go away.
153
* Note: mkshortcut.exe in cygutils 1.4.10-2 is broken, but as of (July 18, 2013 with cygutils version 1.4.12 this is fixed).  If the version of mkshortcut.exe that is installed when you run setup.exe doesn't work (i.e. mkshortcut -h segfaults), then go bach to cygwin setup and update your cygutils.
154
155
### Setting Cygwin Disk Mounts
156
157
* Create the directory winsame at the top level of both the Cygwin and Windows file systems. You must always work in this directory.  This is critical for getting the ATLAS linear algebra libraries to build. Do this via:
158
159
~~~~~~
160
mkdir /cygdrive/c/winsame
161
mkdir /winsame
162
mount C:/winsame /winsame
163
~~~~~~
164
165
To make this permanent, put
166
167
~~~~~~
168
C:/winsame /winsame ntfs binary 0 0
169
~~~~~~
170
171
as one line in /etc/fstab.
172
173
On Windows-64, additionally put
174
175
~~~~~~
176
C:/Program\040Files\040(x86) /ProgramFilesX86 ntfs binary 0 0
177
~~~~~~
178
179
as one line in /etc/fstab.  This allows one to construct a valid path with no parentheses as needed for ATLAS.
180
181
### Configuring Cygwin
182
183 6 Redmine Admin
* Use a "Cygwin64 Terminal" from basic cygwin installation above to perform all subsequent bash tasks
184 1 Redmine Admin
185
* If bilderizing a domain machine, create an /etc/passwd file with the following command
186
187
~~~~~~
188
mkpasswd -l -d -p /winsame > /etc/passwd
189
~~~~~~
190
191 71 Tech-X Corporation
* Add a single domain user to an already created /etc/password:
192
193
~~~~~~
194
mkpasswd -l -d -u {username} -p /winsame >> /etc/passwd
195
~~~~~~
196
197 1 Redmine Admin
* If bilderizing a non-domain machine, create an /etc/passwd file with the following command
198
199
~~~~~~
200
mkpasswd -l -p /winsame > /etc/passwd
201
~~~~~~
202
203
* If bilderizing a domain machine, create an /etc/group file with the following command
204
205
~~~~~~
206
mkgroup -l -d > /etc/group
207
~~~~~~
208
209
* If bilderizing a non-domain machine, create an /etc/group file with the following command
210
211
~~~~~~
212
mkgroup -l > /etc/group
213
~~~~~~
214
215
* Close the terminal and open a new one. You should see that the 'pwd' command shows that you are in a new home area directory: /winsame/<username>. Copy bash profile files from /home to /winsame and delete the previous home area for each user with the commands:
216
217
~~~~~~
218
cp /home/<username>/.* /winsame/<username>/
219
rm -rf /home/<username>
220
~~~~~~
221 52 John Cary
222 146 David Alexander
## Dependencies Tool
223 52 John Cary
224 146 David Alexander
*Dependencies* is a tool that shows the DLL's that an executable depends on and is needed to find and copy-in DLLs to a final distribution.
225 5 Redmine Admin
226 151 John Cary
Download [Dependencies](https://lucasg.github.io/Dependencies/) and copy Dependencies*, ClrPhlib.{dll,pdb} into C:\\bin.
227
(NDesk.Option.dll not needed.)
228 1 Redmine Admin
229
## JOM
230
231 74 David Alexander
*JOM is an nmake wrapper needed to give  the -j flag capability of Unix make for faster compilation.*
232 1 Redmine Admin
233
* Create the folder C:\bin (if not already present).
234
* Add C:\bin to your system path (if not already there).
235
* Download jom.zip from [the Qt Project](https://wiki.qt.io/Jom).
236
* Extract the contents of jom.zip
237
* Move/copy jom.exe to C:\bin (you then can delete the remainder of the contents or keep for historical reasons).
238
239
## LaTeX
240
241 74 David Alexander
*LaTeX is a typesetting tool needed for building PDF files for user documentation.*
242 1 Redmine Admin
243 123 Benjamin Cowan
* Install [Doxygen](http://www.doxygen.nl/).  Choose "Letter" for paper size and "Yes" for "Install missing packages on-the-fly".
244 92 John Cary
* Install Basic MikTeX from [MikTeX](http://miktex.org/). Use the MikTeX Package Manager to install the packages noted at
245
[[LaTeX packages needed by Bilder]]
246 124 Benjamin Cowan
* Install [ghostscript](https://www.ghostscript.com/download/gsdnld.html).
247 1 Redmine Admin
248
249
## MPI
250
251 74 David Alexander
*MPI is a message passing interface for parallel code that is needed for some computation engines.*
252
253 98 Ted Sume
Download Microsoft MPI v8.1.1 from:
254 1 Redmine Admin
255 98 Ted Sume
https://www.microsoft.com/en-us/download/details.aspx?id=55991
256 1 Redmine Admin
257 93 John Cary
The binaries (e.g., mpiexec) are obtained by installing msmpisetup.exe.
258 1 Redmine Admin
259 94 John Cary
The libraries (msmpi.lib) are obtained by installing msmpisdk.msi.
260 1 Redmine Admin
261 93 John Cary
The installers will put mpiexec in your path and define the environment variables,
262
263
MSMPI_INC
264
MSMPI_BIN
265
MSMPI_LIB32
266
MSMPI_LIB64
267
268
which are used by CMake, e.g., to find the needed components of MSMPI.
269 157 John Cary
270
## NASM (required to build OpenSSL, therefore CMake)
271
272
* Download and install from https://nasm.us/
273 158 John Cary
* Make sure this appropriate modifications to your path are made
274 1 Redmine Admin
275 85 John Cary
## Perl (required to build OpenSSL, therefore CMake)
276 1 Redmine Admin
277 74 David Alexander
*Perl is a programming language needed by some packages such as Qt*
278 1 Redmine Admin
279
* Download and install [ActiveState Perl](http://www.activestate.com/activeperl/downloads).
280
281
## Python
282
283 74 David Alexander
*Python is a programming language needed by many packages. Namely, any Python module needs Python to be installed.*
284
285 14 Redmine Admin
* As of VS12, bilder builds Python from a checkout of a git repo and no longer needs to be installed by hand. No PATH changes are needed either.
286 1 Redmine Admin
287 107 John Cary
## RCEDIT
288
289
* RCEDIT is a program that allows one to change the icon of an executable after its creation.  It can be obtained from https://github.com/electron/rcedit/releases, and it should be installed in C:\bin.
290
291 85 John Cary
## Ruby (required to build Qt5)
292
293
* Ruby, http://rubyinstaller.org/, must be installed first.
294
295 1 Redmine Admin
## Subversion
296
297 74 David Alexander
* Subversion is a revision control tool needed by bilder, for example, to know when packages are out of date.*
298 1 Redmine Admin
299 108 Benjamin Cowan
* Install [TortoiseSVN](https://tortoisesvn.net/downloads.html) with its command line tools.
300 1 Redmine Admin
301 89 David Alexander
* With this, you will have two versions of svn on your machine. One is in `/usr/bin` under cygwin, and it is used for direct invocation at the bash command-line. The other is in `\Program Files`, and it is needed for getting repo versions when Bilder is invoked through Jenkins.  As of this writing, 1.9 is recommended (1.8 will also work, but lower versions will not).
302 33 Tech-X Corporation
303 1 Redmine Admin
~~~~~~
304
$ where svn
305 84 John Cary
C:\cygwin64\bin\svn.exe
306
C:\PROGRAM FILES\TORTOISESVN\bin\svn.exe
307
$ /usr/bin/svn --version | head -1
308
svn, version 1.9.7 (r1800392)
309
$ /cygdrive/c/Program\ Files/TortoiseSVN/bin/svn --version | head -n 1
310
svn, version 1.9.7 (r1800392)
311 15 Redmine Admin
~~~~~~
312 1 Redmine Admin
313
## Visual Studio
314 15 Redmine Admin
315 74 David Alexander
*Visual Studio contains the Microsoft command-line compiler (cl) used by packages with C/C++ code.* 
316
317 165 John Cary
* The current version working with Bilder ix VS2019
318 1 Redmine Admin
319
* Ensure that Visual Studio is not in the system path. (Bilder adds this as needed.)
320 7 Redmine Admin
321 26 John Cary
### Compatibility with Python
322 7 Redmine Admin
323 1 Redmine Admin
* Python is built by Bilder.
324
325
### Compatibility with CUDA 9.1 
326 78 Ted Sume
* CUDA version 9.1 requires the use of Microsoft Visual Studio 2017 v15.4.5. See [VS2017 Prior Release Download Site](https://www.visualstudio.com/en-us/productinfo/installing-an-earlier-release-of-vs2017) for instructions on downloading a specific Release.
327
328 165 John Cary
## LLVM (Clang)
329 141 David Alexander
330 145 John Cary
### Installing LLVM-Clang from a binary installer (easiest way)
331 141 David Alexander
332 165 John Cary
Download the Windows (64-bit) installer from http://releases.llvm.org/download.html, and proceed with the installation.
333 141 David Alexander
334 165 John Cary
When installing namespace the installation directory with the major version.  Eg, change LLVM to LLVM17 when asked.
335 141 David Alexander
336 153 Ted Sume
# WSL on Windows 10 1909 or newer 
337
338
* From within an Administrator enable Powershell window, run the following
339
340
```
341
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
342
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
343
```
344
* Reboot the computer after running the above two commands from within Powershell
345
* Update Kernel for WSL2 by downloading and installing https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
346
* Run the following command from within an Administrator enabled Powershell window to set the default WSL version to 2.
347
348
```
349
wsl --set-default-version 2
350
```
351
* Go to Microsoft store, search for preferred Linux distro, download and install per on screen instructions.
352
353
354 1 Redmine Admin
# Libraries (Required for most builds with Bilder)
355
356
## OpenSSL
357
358 85 John Cary
*OpenSSL is a security library needed by Python to build the SSL module, by cmake, libssh, and by Qt.*
359
*We no longer install OpenSSL on Windows, as Bilder builds it to be consistent with the compiler in use."
360 1 Redmine Admin
361 85 John Cary
### Legacy instructions.
362
363 1 Redmine Admin
* Download from http://slproweb.com/products/Win32OpenSSL.html
364 75 John Cary
* Choose the Win64 OpenSSL v1.0.2n  (not Light) on 64bit or the Win32 OpenSSL v1.0.2n on 32bit windows.
365 76 John Cary
* **The 1.1 series DOES NOT WORK with either libssh or Qt.**
366 1 Redmine Admin
* You may have to install Visual C++ Redistributables if the installer complains.
367
* During the installation, select "Copy OpenSSL DLLs to: The OpenSSL binaries (/bin) directory"
368
* After the installation on 64bit windows, goto C:\Windows\System32 and prepend libssl32.dll, libeay32.dll, and ssleay32.dll with an "OFF", if these files exist.  This and the next step are required so that dependency walker finds the SSL libs from the OpenSSL distro instead of the ones in C:\Windows\System32.
369
* Add C:\OpenSSL-Win64 (in some cases, we have seen that C:\OpenSSL-Win64\bin should be added instead) or the directory where you installed OpenSSL to the beginning of the system path. In particular, it needs to be in front of the CollabNet path and the Intel client path, because both contain libeay32.dll. A which for the libeay32.dll should give this installed version. For example:
370
371 30 John Cary
~~~~~~
372
which libeay32.dll
373 1 Redmine Admin
/cygdrive/c/OpenSSL-Win64/bin/libeay32.dll
374 73 Tech-X Corporation
~~~~~~
375 30 John Cary
376 1 Redmine Admin
* If built software has unexplained crashes, recheck the above command results.
377
378 109 Tech-X Corporation
379
# Composer-related Libraries (only needed for building ComposerToolkit, can be skipped for documentation builds)
380
381 125 Nathan Neri
## Git LFS
382
383
*Git LFS is a git extension for repos with large files - needed to use git for VisIt repos*
384
385
Download and run the installer: https://git-lfs.github.com/
386
387 130 Nathan Neri
You can adjust the configuration by running (from Cygwin) `git lfs install --force --skip-smudge` with new configuration options.
388 125 Nathan Neri
389 127 Nathan Neri
To ensure that git will find git lfs, add a symbolic link from git's exec path to the location of the git-lfs executable.
390
391
~~~~~~
392
LINK_TO_PATH=`which git-lfs.exe`
393
LINK_FROM_PATH=`git --exec-path`
394
cd $LINK_FROM_PATH
395
ln -s "$LINK_TO_PATH" git-lfs.exe
396
~~~~~~
397
398 74 David Alexander
## Qt
399 1 Redmine Admin
400 74 David Alexander
*Qt is a cross-platform GUI library needed to build packages that have Qt-based user interfaces.*
401
402 142 David Alexander
Qt5 is the recommended version (the previous version, Qt4, instructions are also here too until Qt5 is solid).
403 1 Redmine Admin
404 142 David Alexander
### Installing Qt5
405
406 159 David Alexander
These instructions are how to install the pre-built version of Qt 5 (version 5.14.2).  You can skip creating the Qt account.
407 142 David Alexander
408 159 David Alexander
* Get Qt-5.14.2 from https://download.qt.io/archive/qt/5.14/5.14.2/qt-opensource-windows-x86-5.14.2.exe
409
* Run this program, selecting `<DRIVE>\winsame\winqt\5.14.2` as your installation directory, where DRIVE is the drive you have winsame on (e.g. D: or C:). (Bilder will find Qt5 if it is here)
410 160 David Alexander
* Expand the Qt 5.14.2 section and select the following components:
411 1 Redmine Admin
  * MSVC 2017 64-bit
412 160 David Alexander
  * UWP x64 (MSVC 2017)
413 1 Redmine Admin
  * Sources
414 142 David Alexander
  * Qt WebEngine
415 160 David Alexander
* Optionally, under Developer and Designer Tools, select:
416
  * Qt Creator 4.11.1 CDB Debugger Support
417
  * Qt Creator 4.11.1 is selected by default
418 142 David Alexander
* Accept all remaining defaults unless otherwise preferred
419
420 143 David Alexander
### Building and Installing Qt4
421 74 David Alexander
422 41 John Cary
* Make sure no other Qt is in your system path.
423 114 Nathan Neri
* Get the Qt Libraries from http://download.qt.io/archive/qt/4.8/4.8.7/. Download qt-opensource-windows-x86-vs2010-4.8.7.exe. (The vs2010 in the name is irrelevant as we will build Qt using the source code in this download.)
424 118 Nathan Neri
* Run this program, selecting C:\winsame\builds-XX\winqt\4.8.7 as your installation directory, where XX is the machines file suffix you use (e.g. vs2017).
425 41 John Cary
* If 4.8.7, patch Qt by opening a Cygwin window:
426 1 Redmine Admin
427
~~~~~~
428
cd /winsame/builds-vs12/winqt/4.8.7
429 100 John Cary
~~~~~~
430
431 106 John Cary
To build with VS2017, you may need to patch.  For this you will need python with the patch module installed, which you can obtain by running composerall, e.g., with target, python.  Then do
432 100 John Cary
433
~~~~~~
434 119 Nathan Neri
/path/to/bilder/installed/python -m patch /path/to/bilder/patches/02-fix_build_with_msvc2015-45e8f4ee.diff
435 1 Redmine Admin
~~~~~~
436
437 74 David Alexander
#### Compiling Qt4
438 1 Redmine Admin
439
* The copy/paste-able commands below assume VS12.
440
441
In a Visual Studio x64 DOS window:
442
443
~~~~~~
444 116 Nathan Neri
set VER=2017
445
REM could be 12
446 120 Nathan Neri
set DRIVE=C:
447
REM or D:, if you're building there
448 1 Redmine Admin
set SFX=vs%VER%
449
REM or whatever machine suffix you will be building for, if using a combined compiler build
450
set QTVER=4.8.7
451 120 Nathan Neri
set INSTALL_DIR=%DRIVE%\winsame\builds-%SFX%\winqt\%QTVER%\%QTVER%\msvc%VER%_64
452 1 Redmine Admin
~~~~~~
453
454 103 John Cary
Modify the last line as needed, e.g., different drive or subdir.
455 1 Redmine Admin
456 106 John Cary
Set the platform args according to your compiler.
457 1 Redmine Admin
458 106 John Cary
For VS2013 (VS12).
459
460 101 John Cary
~~~~~~
461 106 John Cary
set PLATFORM_ARGS=-platform win32-msvc2013
462 101 John Cary
~~~~~~
463
464 106 John Cary
For VS2015 or VS2017:
465 101 John Cary
466
~~~~~~
467 106 John Cary
set PLATFORM_ARGS=-platform win32-msvc2015
468 101 John Cary
~~~~~~
469 1 Redmine Admin
470
Then
471
472
~~~~~~
473 120 Nathan Neri
%DRIVE%
474
cd %DRIVE%\winsame\builds-%SFX%\winqt\%QTVER%
475 116 Nathan Neri
configure.exe -prefix %INSTALL_DIR% -debug-and-release -opensource -confirm-license -fast -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-tds -no-libtiff -webkit -declarative %PLATFORM_ARGS%
476 1 Redmine Admin
~~~~~~
477
478
In a bash window launched from the previous DOS window (try `C:\cygwin64\bin\mintty -`, note that the dash is important!), execute the following (changing vsver to your version)
479
480 106 John Cary
~~~~~~
481 99 John Cary
export VER=12 # or 2017
482
export SFX=vs${VER}
483 44 John Cary
cd /winsame/builds-${SFX}/winqt/4.8.7
484 115 John Cary
export INSTALL_DIR=/winsame/builds-${SFX}/winqt/4.8.7/4.8.7/msvc${VER}_64
485
mkdir -p ${INSTALL_DIR}
486 139 David Alexander
cp -R mkspecs ${INSTALL_DIR}
487 128 Nathan Neri
~~~~~~
488
489 137 David Alexander
Back in the Visual Studio x64 DOS window
490 128 Nathan Neri
491
~~~~~~
492
%DRIVE%
493
cd %DRIVE%\winsame\builds-%SFX%\winqt\4.8.7 
494 1 Redmine Admin
set PATH=%PATH%;%DRIVE%\winsame\builds-%SFX%\winqt\4.8.7\bin
495
nmake
496 128 Nathan Neri
REM Took 3.5 hours on a 2.3 GHz Core2 Duo with Solid State Drive
497
nmake install
498
REM Took 10 minutes on a 2.3 GHZ Core2 Duo with Solid State Drive
499
~~~~~~
500
501 1 Redmine Admin
* For CMake to find Qt, add INSTALL_DIR to your supra search path when configuring.
502
503 142 David Alexander
* If you want to use this qt outside of Bilder, add ${INSTALL_DIR}/bin to the system path variable.  This may not work if you have more than one Bilder run.
504
505 140 David Alexander
506
# Additional Useful Tools
507
508
## Notepad++
509
510
* (Optional) Notepad++ is a free source code editor that is a great tool for Windows.
511
* Download from http://notepad-plus-plus.org/
512
* Install and pin to your taskbar.
513 1 Redmine Admin
514 110 David Alexander
## Java
515
516
Java is needed for setting up the machine to be a Jenkins Slave.
517
518
* Download from https://www.java.com/en/download/  (Version 8 Update 181 has a Release date of July 17, 2018) 
519
* May get a message about the Java Plugin and Chrome. This does not affect the Jenkins slave service.
520 111 David Alexander
* Download the JNLP page from the Jenkins server site (link button with label "Launch agent from browser").
521
* Start a command prompt running as Administrator, then change to the Download directory and type "javaws slave-agent.jnlp" 
522 110 David Alexander
* Choose File -> "Install as a service" and follow the dialog messages.
523
524 1 Redmine Admin
# Experimental Tools and Libraries
525
526
These tools have not been fully vetted or built, so you need not do these.
527
528
## MinGW
529
530
See [[Installing MinGW]].
531
532
## ATLAS
533
534
See [[Installing ATLAS on Windows]].
535 8 Redmine Admin
536 131 John Cary
## OpenBLAS
537
538
See [[Installing OpenBlas on Windows]]
539
540 1 Redmine Admin
# Cygwin and Paths
541 8 Redmine Admin
542 1 Redmine Admin
(This section assumes the user is familiar with the relations between Cygwin and Windows paths.)
543
544
The path is critical for when there are conflicting executables.  This is the case for Subversion and OpenSSL.
545
546
The cygwin and Windows versions of svn are incompatible due to line endings, so care must be taken as to which is used at what time.
547
548
The path to cygwin's version of svn will be ahead of the Windows Subversion so as to allow users to checkout a project using /usr/bin/svn and never worry about the Windows version of svn.
549
550
The path to the installed OpenSSL needs to be in front of the path to Subversion because during the copying in of OpenSSL libraries depends needs to find the ones in the OpenSSL installation not the Subversion installation.
551
552
## Usage under Jenkins
553
554
Jenkins uses `svnkit`, which is compatible with the Windows version of Subversion of the same version number.  So for jenkins usage, one must have the same version of `svn` installed across all slaves, and when `Bilder` runs under Jenkins, it must be sure to use the Windows version of `svn`.  There are two methods for doing this.  First, `bilder/jenkins/jenkinsbild` defines the environment variables, `BILDER_SVN`, `BILDER_SVNDIR`, and `BLDR_SVNVERSION`, which hold the correct executables to be used by `Bilder`.  However, in the configuration of some packages, notably VisIT in `visit.sh`, the path is used to find `svn`, and this gives the wrong executable.  For these cases, the path is modified just before configuration.
555
556
557
## Summary
558
559
* Bilder moves `/usr/bin` to just after the Python path and therefore to before
560
  `/cygdrive/c/Windows/system32`.
561
* Put the Windows Subversion path behind the Python path (and so behind `/usr/bin`).
562
    - `/usr/bin` must be removed from the path when configuring some packages in order to get the correct subversion when building under Jenkins.
563
564
# Bilder machine files for cygwin
565
566
The Bilder machine file for cygwin and Visual Studio 2013 (VS12) is bilder/machines/cygwin.vs12. It is sourced by bilder using the -m option. It augments PATH and sets the values of the INCLUDE, LIB, and LIBPATH variables.
567
568
In case of problems, one should check that the values of these were set correctly. This is done by starting up the **Visual Studio Command Prompt**, then starting rxvt as noted above. The values for or additions to these variables should agree with how they are being set or modified by the cygwin machine files.
569
570
# Setup for making Installers
571
572
## Visual Studios Redistributables
573
574
Download vcredist_x64.exe (Visual C++ Redistributable Packages for Visual Studio 2013)
575
576
http://www.microsoft.com/en-gb/download/details.aspx?id=40784
577
578 161 David Alexander
Choose only vcredist_x64.exe executable from list. This should put vcomp120.dll in C:\Windows\System32\
579 1 Redmine Admin
580
## Sign Tools
581
582
* The Microsoft Signtool comes with Visual Studio, however, one must install a code-signing certificate. This process is site-specific so please see your system administrator.
583
* Contrary to what signtool says, the capicom dll must be copied from C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin to C:\Windows\System32 and must be registered by typing the following at a Command Prompt run as Administrator: 
584
585
~~~~~~
586 74 David Alexander
cd C:\Windows\System32
587
REGSVR32 capicom.dll
588
~~~~~~
589
590
## NSIS
591
592
NSIS is a scriptable installer maker.
593 1 Redmine Admin
594
* Install NSIS from [NSIS Download Site](http://nsis.sourceforge.net/Download).
595 131 John Cary
  * For building CMake 64bit and if you are building the composers, you will need a generator for installer executables, which is NSIS (Nullsoft Scriptable Install System) a professional open source system to create Windows installers.
596
  * Version 2.46 is available as of Aug 21, 2011.
597 88 John Cary
* Add `C:\Program Files (x86)\NSIS\Bin` to your system path.
598 74 David Alexander
599
* Install NSIS Access Control Plugin from [Access Control Plugin Site](http://nsis.sourceforge.net/AccessControl_plug-in).
600
601
Copies directories and files into the NSIS installation as follows:
602
603
~~~~~~
604
AccessControl.zip\Contrib\AccessControl --> NSIS\Contrib\AccessControl
605
AccessControl.zip\Docs\AccessControl --> NSIS\Docs\AccessControl
606 1 Redmine Admin
AccessControl.zip\Plugins\AccessControl.dll --> NSIS\Plugins\x86-ansi\AccessControl.dll
607
AccessControl.zip\Unicode\Plugins\AccessControl.dll --> NSIS\Plugins\x86-unicode\AccessControl.dll
608
~~~~~~
609
610 155 David Alexander
611
# Path
612
613
The resulting Windows PATH should look like this...
614
615 156 David Alexander
![](windowsPath.png)
616 155 David Alexander
617 1 Redmine Admin
# Notes For Development
618
619
[[Notes on debugging Windows executables]]
620
[[Notes on deleting directories and files owned by other users]]
621 154 Ted Sume
[[Notes on enabling and disabling the Windows Firewall from the command line]]