Skip to content

Commit 96e6c39

Browse files
committed
Docs: Update Windows guides
1 parent 2e85239 commit 96e6c39

File tree

2 files changed

+118
-242
lines changed

2 files changed

+118
-242
lines changed

doc/build_WIN.md

Lines changed: 86 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,121 @@
1-
# Media Transport Library compilation and build Guide on Windows OS (MSYS2)
1+
# Build guide for Windows
22

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
44

5-
## 1. Introduction
5+
- Windows Server 2025
66

7-
This document contains instructions for installing and configuring the Media Transport Library for Windows Operation System in MSYS2 environment.
7+
## Prepare build environment
88

9-
## 2. Prerequisites
9+
1. Install MSYS2
1010

11-
* Windows 10 / Windows Server 2019 64-bit or higher
11+
Download the latest installer from https://www.msys2.org/
1212

13-
## 3. Install MSYS2 environment
13+
1. Install npcap
1414

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
1816

19-
```bash
20-
pacman -Syuu
21-
```
17+
1. Run MSYS2 UCRT64
2218

23-
## 4. Install dependencies
19+
> **Note:** All the following commands should be executed in the UCRT64 environment.
2420
25-
* Install build tools and dependencies:
21+
1. Install tools
2622

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+
```
3126
32-
## 4. Install tools
27+
```
28+
pacboy -S dlfcn:p gcc:p json-c:p libpcap:p meson:p mman-win32:p
29+
```
3330
34-
* Download and install npcap from <https://npcap.com/dist/npcap-1.60.exe>.
31+
1. Install npcap SDK
3532
36-
* Install npcap SDK:
33+
```
34+
wget https://npcap.com/dist/npcap-sdk-1.16.zip
35+
```
3736
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+
```
4340
44-
* Install mman (mmap for Windows):
41+
```
42+
cp -r ./npcap-sdk-1.16/lib/. "${MSYSTEM_PREFIX}/lib"
43+
```
4544
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
5246
53-
## 5. Build DPDK
47+
1. Clone the MTL repository
5448
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+
```
5652
57-
* Clone the MTL repository if not:
53+
```
54+
cd ./Media-Transport-Library
55+
```
5856
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+
```
6360
64-
* Convert symlink patch files to real file:
61+
1. Clone the DPDK repository
6562
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.
7264
73-
* Clone the DPDK repository and apply patches:
65+
```
66+
git clone -b v25.11 https://github.com/DPDK/dpdk.git
67+
```
7468
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
8170
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+
```
8774
88-
* Build and install DPDK:
75+
```
76+
git am "$MTL_PATH"/patches/dpdk/25.11/*.patch
77+
```
8978
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+
```
9482
95-
## 6. Build Media Transport Library and app
83+
1. Build DPDK
9684
97-
```bash
98-
cd $mtl_source_code
99-
./build.sh
100-
```
85+
```
86+
meson setup -Dmax_lcores=256 build
87+
```
10188
102-
## 7. Add MSYS2 binary PATH to system environment variables (Optional)
89+
```
90+
meson compile -C build
91+
```
10392
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
10594
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
10796
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+
```
109100
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

Comments
 (0)