Skip to content

Commit 2bfd31e

Browse files
committed
Add Windows-specific build notes to installation guide
Adds 'Windows-Specific Build Notes' section after Step 5 in from_source.rst covering: 1. File encoding (UTF-8 without BOM) 2. Path conventions (forward vs backslashes) 3. CUDA configuration on Windows 4. CMake and compiler setup 5. Common Windows build issues 6. Development environment tips (Git, VS Code) 7. WSL2 alternative Based on contributor experience with Windows development environment.
1 parent 4b2b639 commit 2bfd31e

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

docs/install/from_source.rst

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. Licensed to the Apache Software Foundation (ASF) under one
1+
.. Licensed to the Apache Software Foundation (ASF) under one
22
or more contributor license agreements. See the NOTICE file
33
distributed with this work for additional information
44
regarding copyright ownership. The ASF licenses this file
@@ -232,6 +232,71 @@ The following commands can be used to install the extra Python dependencies:
232232
pip3 install tornado psutil 'xgboost>=1.1.0' cloudpickle
233233
234234
235+
.. _windows-build-notes:
236+
237+
Windows-Specific Build Notes
238+
----------------------------
239+
240+
If you're building TVM on Windows, note these platform-specific considerations:
241+
242+
File Encoding
243+
.............
244+
- Ensure Python files are saved as **UTF-8 without BOM** (Byte Order Mark)
245+
- BOM characters cause ``SyntaxError: invalid non-printable character U+FEFF``
246+
- In VS Code: Bottom-right encoding → "Save with Encoding" → "UTF-8"
247+
248+
Path Conventions
249+
................
250+
- Use forward slashes (``/``) in Python/CMake paths, not Windows backslashes
251+
- Example: ``python cmake/config.cmake`` not ``python cmake\\config.cmake``
252+
253+
Common Windows Build Issues
254+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
255+
256+
CUDA Configuration
257+
..................
258+
For CUDA support:
259+
260+
.. code-block:: batch
261+
262+
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8
263+
set PATH=%CUDA_PATH%\bin;%PATH%
264+
cmake .. -DUSE_CUDA=ON
265+
266+
CMake & Compiler Setup
267+
......................
268+
- Use CMake GUI or specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..``
269+
- Ensure Python is in PATH or specify: ``-DPython_EXECUTABLE=C:\Python39\python.exe``
270+
271+
Development Environment Tips
272+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273+
274+
Git Configuration
275+
.................
276+
.. code-block:: bash
277+
278+
git config --global core.autocrlf input
279+
280+
VS Code Settings
281+
................
282+
Add to ``settings.json``:
283+
284+
.. code-block:: json
285+
286+
{
287+
"files.encoding": "utf8",
288+
"files.autoGuessEncoding": false,
289+
"[python]": { "files.encoding": "utf8" }
290+
}
291+
292+
WSL2 Alternative
293+
~~~~~~~~~~~~~~~~
294+
For Linux-like environment: Install WSL2 (Ubuntu recommended) and follow Linux instructions.
295+
296+
For more help, report Windows-specific issues on GitHub with your Windows version,
297+
Visual Studio version, and complete error logs.
298+
299+
235300
Advanced Build Configuration
236301
----------------------------
237302

0 commit comments

Comments
 (0)