Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions doc/CARLAdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,18 @@

Please visit [Visual Studio Installer Download](https://visualstudio.microsoft.com/downloads/) to download the Visual Studio Installer

To build the CARLA 0.9.15 under Visual Studio 2022, a practical guide is shown below:
To build the CARLA 0.9.15 under Visual Studio 2019, a practical guide is shown below (For detailed build steps, please refer to [CARLA Windows Build Guide](./Carla_Windows_building.md).):

The MSVC toolset version changed to 14.4 (i.e., the “14.4x” series) after Visual Studio 2022 version 17.10. Since the official installation script supports up to MSVC 14.3x, we use Visual Studio 2022 17.8 for simplicity. The `--channelURI` parameter can be used to specify the version.
The MSVC toolset version changed to v142 after Visual Studio 2019. Since the official installation script supports MSVC 142, we use Visual Studio 2019 for simplicity.

```shell
visualstudiosetup.exe --channelURI https://aka.ms/vs/17/release.LTSC.17.8/channel
```

The documentation for building CARLA on windows can be found [Carla Windows Build](https://carla.readthedocs.io/en/0.9.15/build_windows/). Please note that, we need to specify `GENERATOR="Visual Studio 17 2022" TOOLSET="msvc-14.3"` for compilation.
The documentation for building CARLA on windows can be found [Carla Windows Build](https://carla.readthedocs.io/en/0.9.15/build_windows/). Please note that, we need to use "X64 Native Tools Command Prompt for VS 2019" for compilation.

Remember to follow every steps in the CARLA Windows build documentation.

If you don't need to use the source version CARLA as the server. You dont need to compile the Carla Server follwing the documentation. You can just run:

```shell
make LibCarla GENERATOR="Visual Studio 17 2022" TOOLSET="msvc-14.3"
make LibCarla GENERATOR="Visual Studio 2019" TOOLSET="msvc-14.2"
```

which will provide the necessary dependencies for the FIXS-CARLA
Expand Down
182 changes: 182 additions & 0 deletions doc/Carla_Windows_building.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
## CARLA 0.9.15 Windows Build Guide

This document provides a practical guide for building CARLA 0.9.15 on Windows.

For the official and complete build procedure, please refer to the
[CARLA 0.9.15 Windows Build Documentation](https://carla.readthedocs.io/en/0.9.15/build_windows/).

This document follows the structure of Part One: Prerequisites and Part Two: Build CARLA from the official documentation, and focuses on:
- Highlighting common issues encountered during the build process
- Providing practical solutions and workarounds

---

## Part One: Prerequisites

Please strictly follow the **System requirements** and **Software requirements** specified in the official documentation. In particular:

- Ensure that the required version of **Make (3.81)** is used. This version may need to be installed manually (e.g., via Gnuwin), or obtained through other reliable sources.

- For **Visual Studio 2019**, make sure the correct **MSVC toolset** is selected. Note that the **Windows 8.1 SDK** may no longer be available and can be replaced with the **Windows 10 SDK**.

![Select MSVC toolset](./img/VS2019_MSVC_toolset.png)

- The installation and configuration of **Unreal Engine 4.26** can be completed by following the official CARLA documentation:
[CARLA Windows Build Documentation](https://carla.readthedocs.io/en/0.9.15/build_windows/#unreal-engine)

Please ensure all dependencies are correctly installed before proceeding to the build stage. Users can verify dependencies using:

```
- `python --version`
- `pip3 -V`
- `cmake --version`
- `make --version`
- `git --version`
```

Visual Studio toolset and Windows SDK can be checked via **Visual Studio Installer**.

---

## Part Two: Build CARLA

This section describes how to build CARLA on Windows. The detailed procedure follows the official documentation, while this section primarily highlights common issues encountered during the build process and provides corresponding solutions.

### Clone the CARLA Repository
- Clone the CARLA repository from GitHub
- **Ensure that the correct version/tag (0.9.15) is checked out.**

### Get assets
- Run Update.bat scripts
- Download required assets

The assets will be automatically downloaded and extracted if the process completes successfully.

However, in practice, the download via Update.bat may fail due to network issues or version mismatches.

Common Issue: Assets Download Failure

If Update.bat fails to download the assets, a manual workaround is required.

Solution: Manual Download and Extraction

Identify the correct asset version for CARLA 0.9.15:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to know which one is the correct asset?

20231108_c5101a5

The correct asset version can be identified from:

`Util/ContentVersions.txt` in the CARLA source directory, which maps each CARLA version to its corresponding asset package.

Manually download the corresponding asset package.
Extract the downloaded archive to:
Unreal/CarlaUE4/Content/Carla

Note: If the target directory does not exist, create it manually.

This manual approach ensures that the correct assets are used when the automated script does not work properly

Locate the file:
Util/ContentVersions.txt

This file contains the mapping between CARLA versions and their corresponding asset packages.

### Build CARLA

This section covers the build process of CARLA on Windows.
The overall procedure follows the official documentation, while this section focuses on issues encountered during the `make PythonAPI` step and their corresponding solutions.

---

#### Compile the Python API client

Run the following command in the CARLA root directory:

```bash
make PythonAPI
```

During this step, several issues may arise. The most common ones and their solutions are listed below:

1. Missing dependencies during build (zlib / xerces-c)

Problem:
Some dependencies cannot be downloaded automatically during the build process (e.g., zlib, boost, xerces-c).

Solution:

Manually download the required packages:
zlib [v1.2.13](https://github.com/madler/zlib/tags)
[xerces-c-3.2.3] (https://archive.apache.org/dist/xerces/c/3/sources/)
Extract them into the corresponding Build directory
Ensure the folder names match exactly (e.g., xerces-c-3.2.3-source)

2. Boost download failure in install_boost.bat
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in previous "1. Missing dependencies during build (zlib / boost / xerces-c)" you already mentioned boost. do you want to remove that and keep Boost as a separate documentation


Problem:
install_boost.bat fails to download Boost automatically.

Solution:

- Manually download Boost (e.g., version 1.80.0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after manually download these libraries, where do you put them? how to ensure Carla can find them properly?

Extract them into the corresponding Build directory
Ensure the folder names match exactly (e.g., boost-1.80.0-source)
or
- Modify install_boost.bat (around line 74) to use a valid download source
```
set BOOST_REPO=https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/source/%BOOST_TEMP_FILE%
```
to
```
set BOOST_REPO=https://archives.boost.io/release/%BOOST_VERSION%/source/%BOOST_TEMP_FILE%
```
3. CMake policy/version error during build

Problem:
CMake configuration fails due to policy/version issues.

Solution:

1). Modify the .bat scripts under:
Util/InstallerWin

2). Add the following flag to the CMake command:
```
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
```
3). Ensure variables such as %XYZ_SRC_DIR% are correctly set if required
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not following this part, are you indicating that we need to add a puncturation mark "."?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it needs a puncturation mark "." here to solve the path problem.

```
%XYZ_SRC_DIR%
```
to
```
%XYZ_SRC_DIR%.
```

4. CMake issues in OSM build tools

Problem:
CMake errors occur when running scripts in:

Util/BuildTools

Solution:

Modify BuildOSM2ODR.bat
1). Add the following flag to the CMake command:
```
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
```
2). Modify the line:
```
%OSM2ODR_SOURCE_PATH%
```
to
```
%OSM2ODR_SOURCE_PATH%.
```

5. NumPy version incompatibility

- Ensure that the NumPy version is **< 2.0.0** to avoid build issues

---
Binary file added doc/img/VS2019_MSVC_toolset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.