WindowsBuild30 » History » Version 32
Chris Cannam, 2018-07-12 02:59 PM
1 | 27 | Chris Cannam | h1. Building SV v3.1 on Windows |
---|---|---|---|
2 | 1 | Chris Cannam | |
3 | 27 | Chris Cannam | Versions 3.0+ of Sonic Visualiser are primarily 64-bit for Windows, although the 32-bit version is still supported. |
4 | 1 | Chris Cannam | |
5 | 29 | Chris Cannam | * Both builds can be run from Qt Creator, or from a command prompt using batch build scripts provided. The release packages are built using the batch scripts. |
6 | 1 | Chris Cannam | |
7 | 27 | Chris Cannam | * The *64-bit version* is built using the *Microsoft Visual C++ compiler*. Install 64-bit Microsoft Visual Studio 2017 Community Edition and then Qt 5.11 (or latest 5.x). |
8 | 1 | Chris Cannam | |
9 | 27 | Chris Cannam | * The *32-bit version* is built using the *MinGW compiler*. Install Qt 5.11 (or latest 5.x) with Qt Creator and ensure that the 32-bit MinGW option is available. |
10 | 27 | Chris Cannam | |
11 | 24 | Chris Cannam | * The official 64-bit installer also includes some helper binaries from the 32-bit build, enabling it to use 32-bit Vamp plugins as well as 64-bit ones. So to make our official 64-bit installer, we actually have to complete both builds. |
12 | 2 | Chris Cannam | |
13 | 27 | Chris Cannam | * The installers are built using "WiX":http://wixtoolset.org/, so you must have that installed. The path to WiX is hardcoded in our script and at the time of writing it assumes WiX v3.11. |
14 | 1 | Chris Cannam | |
15 | 27 | Chris Cannam | * We use the "Repoint":https://github.com/cannam/repoint source dependency manager. Ensure the required SML runtime for this is available (either "SML/NJ":http://smlnj.org/ or "Poly/ML":http://www.polyml.org/), and then run @.\repoint install@ in a command prompt or Powershell window before opening a build project or starting a build. |
16 | 1 | Chris Cannam | |
17 | 32 | Chris Cannam | * We carry out automatic CI builds with "AppVeyor":https://ci.appveyor.com/project/cannam/sonic-visualiser, and you can refer to the @.appveyor.yml@ file in the SV repository root to see how these builds are run. |
18 | 32 | Chris Cannam | |
19 | 27 | Chris Cannam | In both cases (32 and 64 bit) the dependent libraries we use are found in the @sv-dependency-builds@ subrepo. Prior to the switch to using the Repoint dependency manager, this subrepo was checked out by Mercurial as a matter of course with the SV repo; after the switch to Repoint, it is one of the library modules that is installed by running @.\repoint install@. There should be no other external dependencies besides Qt and the runtime libraries it needs. |
20 | 23 | Chris Cannam | |
21 | 1 | Chris Cannam | h2. Which SV branch to use |
22 | 3 | Chris Cannam | |
23 | 23 | Chris Cannam | Use the @default@ branch of the SV Mercurial repo unless you have a particular reason to know otherwise. |
24 | 3 | Chris Cannam | |
25 | 31 | Chris Cannam | h2. 32-bit build |
26 | 2 | Chris Cannam | |
27 | 30 | Chris Cannam | h4. Build with Qt Creator |
28 | 1 | Chris Cannam | |
29 | 1 | Chris Cannam | This process is similar to that introduced in v2.1 (see [[here|WindowsBuild21]]), except that we now *do* use a shadow build. |
30 | 4 | Chris Cannam | |
31 | 23 | Chris Cannam | * Check out the correct branch (probably @default@ as described above) |
32 | 30 | Chris Cannam | * Run @.\repoint install@ to get the code dependencies |
33 | 4 | Chris Cannam | * Open the main @sonic-visualiser.pro@ project in Qt Creator |
34 | 30 | Chris Cannam | * Set up a *release build* using *Desktop Qt 5.11.0 MinGW 32-bit* as a *shadow build* |
35 | 8 | Chris Cannam | * "Run qmake" and "Rebuild All" |
36 | 4 | Chris Cannam | |
37 | 10 | Chris Cannam | There is still one unresolved manual step before you can run Sonic Visualiser: |
38 | 10 | Chris Cannam | |
39 | 30 | Chris Cannam | * Go to the build directory (e.g. @build-sonic-visualiser-Desktop_Qt_5_11_0_MinGW_32bit-Release@) and copy the file @checker\release\vamp-plugin-load-checker.exe@ to the top-level @release@ directory |
40 | 1 | Chris Cannam | |
41 | 1 | Chris Cannam | If the build was successful, you should now be able to run Sonic Visualiser from within the IDE. (You can't yet run the binary from the Windows Explorer, as Qt and other dependencies won't be found.) |
42 | 1 | Chris Cannam | |
43 | 10 | Chris Cannam | You can also run individual unit test suites by selecting them as target executable in Qt Creator. |
44 | 30 | Chris Cannam | |
45 | 30 | Chris Cannam | h4. Build using batch script |
46 | 1 | Chris Cannam | |
47 | 31 | Chris Cannam | * Check out the correct branch (probably @default@ as described above) |
48 | 31 | Chris Cannam | * Open a command prompt and cd to the main @sonic-visualiser@ directory |
49 | 31 | Chris Cannam | * Run @deploy\win64\build-32.bat@ (yes, it is in the @win64@ directory) |
50 | 1 | Chris Cannam | |
51 | 31 | Chris Cannam | The built executables will be left in @build-win32\release@. |
52 | 1 | Chris Cannam | |
53 | 31 | Chris Cannam | Note that the build script also copies in the necessary Qt and C++ runtime libraries for the executables, so it should be possible to run the resulting application just by opening @build-win32\release\Sonic Visualiser.exe@ from Windows Explorer. |
54 | 1 | Chris Cannam | |
55 | 31 | Chris Cannam | h2. 64-bit build |
56 | 1 | Chris Cannam | |
57 | 31 | Chris Cannam | h4. Build with Qt Creator |
58 | 1 | Chris Cannam | |
59 | 4 | Chris Cannam | * Check out the correct branch (probably @default@ as described above) |
60 | 31 | Chris Cannam | * Run @.\repoint install@ to get the code dependencies |
61 | 4 | Chris Cannam | * Open the main @sonic-visualiser.pro@ project in Qt Creator |
62 | 31 | Chris Cannam | * Set up a *release build* using *Desktop Qt 5.11.0 MSVC 64-bit* as a *shadow build* |
63 | 23 | Chris Cannam | * "Run qmake" and "Rebuild All" |
64 | 23 | Chris Cannam | |
65 | 4 | Chris Cannam | If the code is already checked out for a 32-bit build, then it should be possible to add or select the 64-bit MSVC "kit" as a target in Qt Creator and then build that from the same directory as a separate shadow build, rather than having to check out the code again. |
66 | 1 | Chris Cannam | |
67 | 19 | Chris Cannam | And we have the same unresolved manual step as for the 32-bit build: |
68 | 20 | Chris Cannam | |
69 | 31 | Chris Cannam | * Go to the build directory (e.g. @build-sonic-visualiser-Desktop_Qt_5_11_0_MSVC2015_64bit-Release@) and copy the file @checker\release\vamp-plugin-load-checker.exe@ to the top-level @release@ directory |
70 | 4 | Chris Cannam | |
71 | 21 | Chris Cannam | If the build was successful, you should now be able to run Sonic Visualiser from within the IDE. (You can't yet run the binary from the Windows Explorer, as Qt and other dependencies won't be found.) |
72 | 21 | Chris Cannam | |
73 | 21 | Chris Cannam | You can also run individual unit test suites by selecting them as target executable in Qt Creator. |
74 | 21 | Chris Cannam | |
75 | 31 | Chris Cannam | h4. Build using batch script |
76 | 21 | Chris Cannam | |
77 | 31 | Chris Cannam | * Check out the correct branch (probably @default@ as described above) |
78 | 31 | Chris Cannam | * Open a command prompt and cd to the main @sonic-visualiser@ directory |
79 | 31 | Chris Cannam | * Run @deploy\win64\build-64.bat@ |
80 | 21 | Chris Cannam | |
81 | 31 | Chris Cannam | The built executables will be left in @build-win64\release@. |
82 | 21 | Chris Cannam | |
83 | 31 | Chris Cannam | Note that the build script also copies in the necessary Qt and C++ runtime libraries for the executables, so it should be possible to run the resulting application just by opening @build-win32\release\Sonic Visualiser.exe@ from Windows Explorer. |
84 | 21 | Chris Cannam | |
85 | 31 | Chris Cannam | h2. Installers |
86 | 21 | Chris Cannam | |
87 | 31 | Chris Cannam | We create both 32-bit and 64-bit installers at the same time using the script @deploy\win64\build-and-package.bat@. This does a complete rebuild from clean every time it is run. |
88 | 21 | Chris Cannam | |
89 | 31 | Chris Cannam | The 64-bit installer needs files from both the 64- and 32-bit builds. |
90 | 31 | Chris Cannam | |
91 | 31 | Chris Cannam | The general principle is that the script runs both the @build-32@ and @build-64@ batch scripts, then runs WiX twice using two separate installer definition files. The 32-bit installer is defined by @deploy\win32\sonic-visualiser.wxs@ and the 64-bit one by @deploy\win64\sonic-visualiser.wxs@. Both files have the SV version and C++-runtime-related paths hardcoded, so they will need inspecting and updating for each new release. |