|
1 | | -# Media Transport Library compilation and build Guide on Windows OS (MSYS2) |
| 1 | +# Build guide for Windows |
2 | 2 |
|
3 | | -**Note:** Support for Windows has been discontinued. If you want to run MTL on Windows, it may be possible, but no guaranties. |
| 3 | +## Requirements |
4 | 4 |
|
5 | | -## 1. Introduction |
| 5 | +- Windows Server 2025 |
6 | 6 |
|
7 | | -This document contains instructions for installing and configuring the Media Transport Library for Windows Operation System in MSYS2 environment. |
| 7 | +## Prepare build environment |
8 | 8 |
|
9 | | -## 2. Prerequisites |
| 9 | +1. Install MSYS2 |
10 | 10 |
|
11 | | -* Windows 10 / Windows Server 2019 64-bit or higher |
| 11 | + Download the latest installer from https://www.msys2.org/ |
12 | 12 |
|
13 | | -## 3. Install MSYS2 environment |
| 13 | +1. Install npcap |
14 | 14 |
|
15 | | -* Download and install MSYS2 from <https://www.msys2.org/>. |
16 | | -* Open an MSYS2 MINGW64/UCRT64 shell, all commands in this doc will be run in this shell. |
17 | | -* Update packages: |
| 15 | + Download the latest installer from https://npcap.com/#download |
18 | 16 |
|
19 | | -```bash |
20 | | -pacman -Syuu |
21 | | -``` |
| 17 | +1. Run MSYS2 UCRT64 |
22 | 18 |
|
23 | | -## 4. Install dependencies |
| 19 | + > **Note:** All the following commands should be executed in the UCRT64 environment. |
24 | 20 |
|
25 | | -* Install build tools and dependencies: |
| 21 | +1. Install tools |
26 | 22 |
|
27 | | -```bash |
28 | | -pacman -S git base-devel unzip pactoys |
29 | | -pacboy -S gcc:p meson:p pkgconf:p openssl:p json-c:p libpcap:p dlfcn:p SDL2:p SDL2_ttf:p gtest:p |
30 | | -``` |
| 23 | + ``` |
| 24 | + pacman -S git pactoys unzip |
| 25 | + ``` |
31 | 26 |
|
32 | | -## 4. Install tools |
| 27 | + ``` |
| 28 | + pacboy -S dlfcn:p gcc:p gtest:p json-c:p libpcap:p meson:p mman-win32:p |
| 29 | + ``` |
33 | 30 |
|
34 | | -* Download and install npcap from <https://npcap.com/dist/npcap-1.60.exe>. |
| 31 | +1. Install npcap SDK |
35 | 32 |
|
36 | | -* Install npcap SDK: |
| 33 | + ``` |
| 34 | + wget https://npcap.com/dist/npcap-sdk-1.16.zip |
| 35 | + ``` |
37 | 36 |
|
38 | | -```bash |
39 | | -wget https://nmap.org/npcap/dist/npcap-sdk-1.12.zip |
40 | | -unzip -d npcap-sdk npcap-sdk-1.12.zip |
41 | | -cp npcap-sdk/Lib/x64/* $MSYSTEM_PREFIX/lib/ |
42 | | -``` |
| 37 | + ``` |
| 38 | + unzip -d npcap-sdk-1.16 ./npcap-sdk-1.16.zip |
| 39 | + ``` |
43 | 40 |
|
44 | | -* Install mman (mmap for Windows): |
| 41 | + ``` |
| 42 | + cp -r ./npcap-sdk-1.16/lib/x64/. "${MSYSTEM_PREFIX}/lib" |
| 43 | + ``` |
45 | 44 |
|
46 | | -```bash |
47 | | -git clone https://github.com/alitrack/mman-win32 |
48 | | -cd mman-win32 |
49 | | -./configure --prefix=$MSYSTEM_PREFIX |
50 | | -make && make install |
51 | | -``` |
| 45 | +## Build DPDK |
52 | 46 |
|
53 | | -## 5. Build DPDK |
| 47 | +1. Clone the MTL repository |
54 | 48 |
|
55 | | -**Note:** DPDK 23.11 was the last version to which DPDK patches were ported. |
| 49 | + ``` |
| 50 | + git clone https://github.com/OpenVisualCloud/Media-Transport-Library.git |
| 51 | + ``` |
56 | 52 |
|
57 | | -* Clone the MTL repository if not: |
| 53 | + ``` |
| 54 | + cd ./Media-Transport-Library |
| 55 | + ``` |
58 | 56 |
|
59 | | -```bash |
60 | | -git clone https://github.com/OpenVisualCloud/Media-Transport-Library.git |
61 | | -export mtl_source_code=${PWD}/Media-Transport-Library |
62 | | -``` |
| 57 | + ``` |
| 58 | + MTL_PATH="$PWD" |
| 59 | + ``` |
63 | 60 |
|
64 | | -* Convert symlink patch files to real file: |
| 61 | +1. Clone the DPDK repository |
65 | 62 |
|
66 | | -```bash |
67 | | -cd $mtl_source_code/patches/dpdk/23.11 |
68 | | -ls *.patch | xargs -I{} bash -c 'if [[ $(sed -n '1p' "{}") =~ ^../.*\.patch$ ]]; then cp "$(cat "{}")" "{}"; fi' |
69 | | -cd windows |
70 | | -ls *.patch | xargs -I{} bash -c 'if [[ $(sed -n '1p' "{}") =~ ^../.*\.patch$ ]]; then cp "$(cat "{}")" "{}"; fi' |
71 | | -``` |
| 63 | + > **Note:** The DPDK repository should be located directly in the MTL repository. |
72 | 64 |
|
73 | | -* Clone the DPDK repository and apply patches: |
| 65 | + ``` |
| 66 | + git clone -b v25.11 https://github.com/DPDK/dpdk.git |
| 67 | + ``` |
74 | 68 |
|
75 | | -```bash |
76 | | -cd $mtl_source_code |
77 | | -git clone https://github.com/DPDK/dpdk.git |
78 | | -cd dpdk |
79 | | -git checkout v23.11 |
80 | | -git switch -c v23.11 |
| 69 | +1. Apply the MTL patches for DPDK |
81 | 70 |
|
82 | | -git config user.name "Your Name" # config if not |
83 | | -git config user.email "you@example.com" # config if not |
84 | | -git am $mtl_source_code/patches/dpdk/23.11/*.patch |
85 | | -git am $mtl_source_code/patches/dpdk/23.11/windows/*.patch |
86 | | -``` |
| 71 | + ``` |
| 72 | + cd "${MTL_PATH}/dpdk" |
| 73 | + ``` |
87 | 74 |
|
88 | | -* Build and install DPDK: |
| 75 | + ``` |
| 76 | + git am "$MTL_PATH"/patches/dpdk/25.11/*.patch |
| 77 | + ``` |
89 | 78 |
|
90 | | -```bash |
91 | | -meson setup build |
92 | | -meson install -C build |
93 | | -``` |
| 79 | + ``` |
| 80 | + git apply "$MTL_PATH"/patches/dpdk/25.11/windows/*.patch |
| 81 | + ``` |
94 | 82 |
|
95 | | -## 6. Build Media Transport Library and app |
| 83 | +1. Build DPDK |
96 | 84 |
|
97 | | -```bash |
98 | | -cd $mtl_source_code |
99 | | -./build.sh |
100 | | -``` |
| 85 | + ``` |
| 86 | + meson setup -Dmax_lcores=256 build |
| 87 | + ``` |
101 | 88 |
|
102 | | -## 7. Add MSYS2 binary PATH to system environment variables (Optional) |
| 89 | + ``` |
| 90 | + meson compile -C build |
| 91 | + ``` |
103 | 92 |
|
104 | | -The MSYS2 path is not in Windows system environment variables by default, if you want to run MTL apps in PowerShell/CMD, you need to add the paths first. For example, MSYS2 is installed in `C:\msys64`. |
| 93 | + Create a copy of the `sched.h` file |
105 | 94 |
|
106 | | -* (optional)Add MSYS2 common toolchain path: `C:\msys64\usr\bin` |
| 95 | + > **Note:** DPDK installation overwrites the `sched.h` file and cause MTL build problems |
107 | 96 |
|
108 | | -* If the environment is MinGW64, add: `C:\msys64\mingw64\bin` |
| 97 | + ``` |
| 98 | + cp "${MSYSTEM_PREFIX}/include/sched.h" "${MTL_PATH}/sched.h.bak" |
| 99 | + ``` |
109 | 100 |
|
110 | | -* If the environment is UCRT64, add: `C:\msys64\ucrt64\bin` |
| 101 | + ``` |
| 102 | + meson install -C build |
| 103 | + ``` |
| 104 | +
|
| 105 | + Restore the copy |
| 106 | +
|
| 107 | + ``` |
| 108 | + cp "${MTL_PATH}/sched.h.bak" "${MSYSTEM_PREFIX}/include/sched.h" |
| 109 | + ``` |
| 110 | +
|
| 111 | +## Build MTL |
| 112 | +
|
| 113 | +1. Run the build script |
| 114 | +
|
| 115 | + ``` |
| 116 | + cd "$MTL_PATH" |
| 117 | + ``` |
| 118 | +
|
| 119 | + ``` |
| 120 | + ./build.sh debugonly |
| 121 | + ``` |
0 commit comments