Jose Fonseca | 2ea5a0d | 2016-03-22 10:42:55 +0000 | [diff] [blame] | 1 | [](https://travis-ci.org/apitrace/apitrace) |
| 2 | [](https://ci.appveyor.com/project/jrfonseca/apitrace/branch/master) |
| 3 | |
| 4 | |
José Fonseca | aa8d256 | 2014-06-17 19:25:20 +0100 | [diff] [blame] | 5 | # Requirements # |
José Fonseca | 8d6f8f3 | 2011-09-27 08:54:45 +0100 | [diff] [blame] | 6 | |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 7 | Requirements common for all platforms: |
| 8 | |
anatoly techtonik | fbceb85 | 2016-01-17 14:24:10 +0300 | [diff] [blame] | 9 | * C++ compiler |
| 10 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 11 | * Python version 3.6 or newer |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 12 | |
José Fonseca | 0e3c21c | 2011-12-11 10:58:14 +0000 | [diff] [blame] | 13 | * Python Image Library |
| 14 | |
José Fonseca | e924260 | 2015-03-09 11:04:53 +0000 | [diff] [blame] | 15 | * CMake version 2.8.11 or higher (tested with version 2.8.12.2) |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 16 | |
anatoly techtonik | fbceb85 | 2016-01-17 14:24:10 +0300 | [diff] [blame] | 17 | Optional dependencies: |
Jose Fonseca | 63e5f39 | 2015-03-15 10:33:32 +0000 | [diff] [blame] | 18 | |
Jose Fonseca | 33d5be1 | 2015-03-15 19:09:13 +0000 | [diff] [blame] | 19 | * zlib 1.2.6 or higher |
Jose Fonseca | 63e5f39 | 2015-03-15 10:33:32 +0000 | [diff] [blame] | 20 | |
| 21 | * libpng |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 22 | |
José Fonseca | 8d6f8f3 | 2011-09-27 08:54:45 +0100 | [diff] [blame] | 23 | The GUI also dependends on: |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 24 | |
José Fonseca | f757adb | 2015-01-15 18:40:49 +0000 | [diff] [blame] | 25 | * Qt version 5.2.1 or higher (tested with version 5.4.0 and 5.3.0; use the |
José Fonseca | 0024095 | 2015-01-15 19:14:41 +0000 | [diff] [blame] | 26 | [6.1 release](https://github.com/apitrace/apitrace/releases/tag/6.1), if you |
José Fonseca | f757adb | 2015-01-15 18:40:49 +0000 | [diff] [blame] | 27 | must build with Qt4) |
José Fonseca | 8d6f8f3 | 2011-09-27 08:54:45 +0100 | [diff] [blame] | 28 | |
José Fonseca | 3f4cd30 | 2015-01-14 12:02:06 +0000 | [diff] [blame] | 29 | Qt will be required if `-DENABLE_GUI=TRUE` is passed to CMake, and never used |
| 30 | if `-DENABLE_GUI=FALSE` is passed instead. The implicit default is |
| 31 | `-DENABLE_GUI=AUTO`, which will build the GUI if Qt is available. |
José Fonseca | 8d6f8f3 | 2011-09-27 08:54:45 +0100 | [diff] [blame] | 32 | |
Jose Fonseca | ccbd749 | 2016-02-26 13:34:16 +0000 | [diff] [blame] | 33 | If you have Qt in a non-standard directory, you'll need to set |
| 34 | [`-DCMAKE_PREFIX_PATH`](http://doc.qt.io/qt-5/cmake-manual.html). |
| 35 | |
José Fonseca | 8d6f8f3 | 2011-09-27 08:54:45 +0100 | [diff] [blame] | 36 | |
Jose Fonseca | 63e5f39 | 2015-03-15 10:33:32 +0000 | [diff] [blame] | 37 | The code also depends on snappy libraries, but the bundled sources are always |
| 38 | used regardless of system availability, to make the wrapper shared-objects/DLL |
| 39 | self contained, and to prevent symbol collisions when tracing. |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 40 | |
| 41 | |
José Fonseca | 3f4cd30 | 2015-01-14 12:02:06 +0000 | [diff] [blame] | 42 | # Linux # |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 43 | |
anatoly techtonik | fbceb85 | 2016-01-17 14:24:10 +0300 | [diff] [blame] | 44 | Optional dependencies: |
| 45 | |
| 46 | * Xlib headers |
José Fonseca | b0d2717 | 2013-06-01 10:28:07 +0100 | [diff] [blame] | 47 | |
| 48 | * libprocps (procps development libraries) |
| 49 | |
| 50 | * libdwarf |
| 51 | |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 52 | Build as: |
| 53 | |
José Fonseca | ebfd69b | 2013-06-11 14:15:35 +0100 | [diff] [blame] | 54 | cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 55 | make -C build |
| 56 | |
José Fonseca | ebfd69b | 2013-06-11 14:15:35 +0100 | [diff] [blame] | 57 | Other possible values for `CMAKE_BUILD_TYPE` `Debug`, `Release`, |
| 58 | `RelWithDebInfo`, and `MinSizeRel`. |
José Fonseca | 12d1fc1 | 2012-10-17 12:19:36 +0100 | [diff] [blame] | 59 | |
| 60 | You can also build the 32-bits GL wrapper on a 64-bits distribution, provided |
| 61 | you have a multilib gcc and 32-bits X11 libraries, by doing: |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 62 | |
José Fonseca | 2defc1f | 2012-08-13 13:50:15 +0100 | [diff] [blame] | 63 | cmake \ |
José Fonseca | eb76c2a | 2015-01-20 11:11:37 +0000 | [diff] [blame] | 64 | -H. -Bbuild32 \ |
José Fonseca | 2defc1f | 2012-08-13 13:50:15 +0100 | [diff] [blame] | 65 | -DCMAKE_C_FLAGS=-m32 \ |
| 66 | -DCMAKE_CXX_FLAGS=-m32 \ |
José Fonseca | 31278e9 | 2012-09-26 16:14:22 +0100 | [diff] [blame] | 67 | -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib32 \ |
José Fonseca | eb76c2a | 2015-01-20 11:11:37 +0000 | [diff] [blame] | 68 | -DENABLE_GUI=FALSE |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 69 | make -C build32 glxtrace |
| 70 | |
José Fonseca | 12d1fc1 | 2012-10-17 12:19:36 +0100 | [diff] [blame] | 71 | The `/usr/lib32` refers to the path where the 32-bits shared objects are may |
| 72 | differ depending on the actual Linux distribution. |
| 73 | |
| 74 | |
José Fonseca | 3f4cd30 | 2015-01-14 12:02:06 +0000 | [diff] [blame] | 75 | # Mac OS X # |
| 76 | |
Jose Fonseca | 92803d7 | 2018-01-03 11:11:20 +0000 | [diff] [blame] | 77 | First install Qt through [Homebrew](https://brew.sh/) like |
José Fonseca | 3f4cd30 | 2015-01-14 12:02:06 +0000 | [diff] [blame] | 78 | |
Jose Fonseca | 92803d7 | 2018-01-03 11:11:20 +0000 | [diff] [blame] | 79 | brew install qt5 |
| 80 | |
| 81 | Then do: |
| 82 | |
| 83 | cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=$(brew --prefix qt5) |
José Fonseca | 3f4cd30 | 2015-01-14 12:02:06 +0000 | [diff] [blame] | 84 | make -C build |
| 85 | |
| 86 | |
José Fonseca | aa8d256 | 2014-06-17 19:25:20 +0100 | [diff] [blame] | 87 | # Android # |
George Wright | a4a643e | 2012-02-23 14:54:49 -0500 | [diff] [blame] | 88 | |
Jose Fonseca | 2264546 | 2017-06-03 21:59:09 +0100 | [diff] [blame] | 89 | Android is no longer supported. See https://git.io/vH2gW for more information. |
BogDan Vatra | 919a3d7 | 2015-01-29 16:36:52 +0200 | [diff] [blame] | 90 | |
José Fonseca | d01f837 | 2013-02-05 11:44:26 +0000 | [diff] [blame] | 91 | |
José Fonseca | aa8d256 | 2014-06-17 19:25:20 +0100 | [diff] [blame] | 92 | # Windows # |
| 93 | |
| 94 | ## Microsoft Visual Studio ## |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 95 | |
| 96 | Additional requirements: |
| 97 | |
Jose Fonseca | 67f0581 | 2017-10-05 15:09:30 +0100 | [diff] [blame] | 98 | * CMake 3.7 or later |
Jose Fonseca | d335cfb | 2016-04-08 17:37:30 +0100 | [diff] [blame] | 99 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 100 | * Microsoft Visual Studio 2017 or later (tested with 2019) |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 101 | |
Jose Fonseca | 4713c3b | 2015-08-12 11:06:34 +0100 | [diff] [blame] | 102 | * [Windows 10 SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk) |
| 103 | for D3D11.3 headers. |
José Fonseca | 072d09b | 2014-11-27 18:13:04 +0000 | [diff] [blame] | 104 | |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 105 | ### CMake GUI ### |
| 106 | |
Jose Fonseca | 2bb8136 | 2016-04-23 23:59:11 +0100 | [diff] [blame] | 107 | To build with Visual Studio first open a Command Prompt window (*not* Visual |
| 108 | Studio Command Prompt window), change into the Apitrace source, and invoke |
| 109 | CMake GUI as: |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 110 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 111 | cmake-gui -H. -Bbuild -DCMAKE_PREFIX_PATH=C:\Qt\QtX.Y.Z\X.Y\msvc2017 |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 112 | |
| 113 | and press the _Configure_ button. |
| 114 | |
| 115 | It will try to detect most required/optional dependencies automatically. When |
| 116 | not found automatically, you can manually specify the location of the |
José Fonseca | 8d6f8f3 | 2011-09-27 08:54:45 +0100 | [diff] [blame] | 117 | dependencies from the CMake GUI. |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 118 | |
Jose Fonseca | 8c42541 | 2015-06-11 21:45:41 +0100 | [diff] [blame] | 119 | If the source/build/compiler/tools are spread across multiple drives, you might |
| 120 | need to [use absolute paths](https://github.com/apitrace/apitrace/issues/352). |
| 121 | |
José Fonseca | 1d6bed0 | 2011-10-23 11:07:38 +0100 | [diff] [blame] | 122 | After you've successfully configured, you can start the build by opening the |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 123 | generated `build\apitrace.sln` solution file |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 124 | |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 125 | ### CMake CLI ### |
| 126 | |
| 127 | Another option is to use the commandline to configure the project. First of all find out which |
| 128 | generators are available on your system: |
| 129 | |
| 130 | cmake --help |
| 131 | |
| 132 | At the end of the output, choose a generator and start configuring the project: |
| 133 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 134 | cmake -H. -Bbuild -G "Visual Studio 16 2019" -A Win32 -DCMAKE_PREFIX_PATH=C:\Qt\QtX.Y.Z\X.Y\msvc2017 |
Jose Fonseca | 67f0581 | 2017-10-05 15:09:30 +0100 | [diff] [blame] | 135 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 136 | Note as off Qt version 5.9.1 there's no `msvc2019` directory, only `msvc2017` |
| 137 | and `msvc2017_64`, but `msvc2017` should work as MSVC 2019 is binary backwards |
| 138 | compatible with MSVC 2017. |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 139 | |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 140 | After you've successfully configured, you can start the build by invoking CMake as: |
| 141 | |
Jose Fonseca | d335cfb | 2016-04-08 17:37:30 +0100 | [diff] [blame] | 142 | cmake --build build --config RelWithDebInfo |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 143 | |
| 144 | ### Deployment ### |
| 145 | |
Jose Fonseca | 67f0581 | 2017-10-05 15:09:30 +0100 | [diff] [blame] | 146 | To run qapitrace, either ensure that `C:\Qt\QtX.Y.Z\X.Y\msvc????\bin` is in the system path, or use |
EoD | 06e20a6 | 2016-01-17 19:58:54 +0100 | [diff] [blame] | 147 | [Qt's Windows deployment tool](http://doc.qt.io/qt-5/windows-deployment.html#the-windows-deployment-tool) |
| 148 | to copy all necessary DLLs, like: |
Jose Fonseca | 53517af | 2015-05-21 16:30:46 +0100 | [diff] [blame] | 149 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 150 | set Path=C:\Qt\QtX.Y.Z\X.Y\msvc2017\bin;%Path% |
Jose Fonseca | 53517af | 2015-05-21 16:30:46 +0100 | [diff] [blame] | 151 | windeployqt build\qapitrace.exe |
| 152 | |
Jose Fonseca | 9eb1475 | 2016-01-17 22:24:04 +0000 | [diff] [blame] | 153 | ### 64-bits ### |
| 154 | |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 155 | The steps to build 64-bits version are similar, but choosing `-A x64` instead |
| 156 | of `-A Win32`, and using `C:\Qt\QtX.Y.Z\X.Y\msvc2017_64` for Qt path. |
Jose Fonseca | 9eb1475 | 2016-01-17 22:24:04 +0000 | [diff] [blame] | 157 | |
| 158 | ### Windows XP ### |
| 159 | |
Jose Fonseca | 16b76a2 | 2017-03-20 12:50:52 +0000 | [diff] [blame] | 160 | Windows XP is no longer supported. If you need Windows XP support, your best |
Jose Fonseca | 7c3f391 | 2020-05-08 15:26:27 +0100 | [diff] [blame] | 161 | bet is to user an [older version of the code](https://github.com/apitrace/apitrace/tree/windows-xp). |
Jose Fonseca | 9eb1475 | 2016-01-17 22:24:04 +0000 | [diff] [blame] | 162 | |
José Fonseca | aa8d256 | 2014-06-17 19:25:20 +0100 | [diff] [blame] | 163 | ## MinGW ## |
| 164 | |
| 165 | Additional requirements: |
| 166 | |
Jose Fonseca | 9eb1475 | 2016-01-17 22:24:04 +0000 | [diff] [blame] | 167 | * [MinGW-w64](http://mingw-w64.sourceforge.net/) (tested with mingw-w64's gcc version 4.9) |
José Fonseca | aa8d256 | 2014-06-17 19:25:20 +0100 | [diff] [blame] | 168 | |
EoD | 111f2f6 | 2016-01-17 13:03:16 +0100 | [diff] [blame] | 169 | * [DirectX headers](https://github.com/apitrace/dxsdk) |
José Fonseca | aa8d256 | 2014-06-17 19:25:20 +0100 | [diff] [blame] | 170 | |
José Fonseca | 27dbbe5 | 2015-01-20 11:11:56 +0000 | [diff] [blame] | 171 | It's also possible to cross-compile Windows binaries from Linux with |
José Fonseca | 6d61700 | 2011-09-06 01:17:48 +0100 | [diff] [blame] | 172 | [MinGW cross compilers](http://www.cmake.org/Wiki/CmakeMingw). |
| 173 | |