Skip to content

Commit 0b90c44

Browse files
committed
Replace Linux build system
1 parent 3cf91c5 commit 0b90c44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4066
-769
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,38 @@
1+
Build
12
Dist
23
Doxygen
34
PythonClient/dist
45
Util/Build
6+
Install
57

68
*.VC.db
79
*.VC.opendb
10+
*.a
811
*.egg-info
912
*.kdev4
1013
*.log
1114
*.pb.cc
1215
*.pb.h
16+
*.o
1317
*.pid
1418
*.pri
1519
*.pro
1620
*.py[cod]
1721
*.sln
22+
*.so
1823
*.stackdump
1924
*.sublime-workspace
2025
*.workspace
2126
*CodeCompletionFolders.txt
2227
*CodeLitePreProcessor.txt
2328
.codelite
29+
.gdb_history
2430
.tags*
2531
.vs
2632
__pycache__
2733
_benchmarks_results
2834
_images*
29-
_out
35+
_out*
3036
_site
3137
core
38+
profiler.csv

.travis.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ script:
1717
matrix:
1818
include:
1919

20-
- env: TEST="CppCheck"
21-
install: true
22-
addons:
23-
apt:
24-
packages:
25-
- cppcheck
26-
script:
27-
- cppcheck . -iBuild -i.pb.cc --error-exitcode=1 --enable=warning --inline-suppr --quiet
20+
# CppCheck does not support C++17.
21+
# - env: TEST="CppCheck"
22+
# install: true
23+
# addons:
24+
# apt:
25+
# packages:
26+
# - cppcheck
27+
# script:
28+
# - cppcheck . -iBuild -i.pb.cc --error-exitcode=1 --enable=warning --inline-suppr --quiet
2829

2930
- env: TEST="MkDocs"
3031
install:

CARLA.sublime-project

-149
This file was deleted.

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cmake_minimum_required(VERSION 3.9.0)
2+
project(CARLA)
3+
4+
include("Build/CMakeLists.txt.in")
5+
6+
add_subdirectory("LibCarla/cmake")

Docs/build_system.md

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<h1>Build system</h1>
2+
3+
> _This document is a work in progress, only the Linux build system is taken into account here._
4+
5+
The most challenging part of the setup is to compile all the dependencies and
6+
modules to be compatible with a) Unreal Engine in the server-side, and b) Python
7+
in the client-side.
8+
9+
The goal is to be able to call Unreal Engine's functions from a separate Python
10+
process.
11+
12+
![modules](img/modules.png)
13+
14+
In Linux, we compile CARLA and all the dependencies with clang-5.0 and C++17
15+
standard. We however link against different runtime C++ libraries depending on
16+
where the code going to be used, since all the code that is going to be linked
17+
with Unreal Engine needs to be compiled using `libc++`.
18+
19+
#### Setup
20+
21+
Command
22+
23+
```sh
24+
make setup
25+
```
26+
27+
Get and compile dependencies
28+
29+
* llvm-5.0 (libc++ and libc++abi)
30+
* rpclib-2.2.1 (twice, with libstdc++ and libc++)
31+
* boost-1.67 (headers only)
32+
* googletest-1.8.0 (with libc++)
33+
34+
#### LibCarla
35+
36+
Compiled with CMake (minimum version required CMake 3.9).
37+
38+
Command
39+
40+
```sh
41+
make LibCarla
42+
```
43+
44+
Two configurations:
45+
46+
| | Server | Client |
47+
|-----------------|--------------|-----------|
48+
| **Unit tests** | yes | no |
49+
| **Requires** | rpclib, gtest, boost | rpclib, boost
50+
| **std runtime** | LLVM's `libc++` | Default `libstdc++` |
51+
| **Output** | headers and test exes | `libcarla_client.a` |
52+
| **Required by** | Carla plugin | PythonAPI |
53+
54+
#### CarlaUE4 and Carla plugin
55+
56+
Both compiled at the same step with Unreal Engine 4.19 build tool. They require
57+
the `UE4_ROOT` environment variable set.
58+
59+
Command
60+
61+
```sh
62+
make CarlaUE4Editor
63+
```
64+
65+
To launch Unreal Engine's Editor run
66+
67+
```sh
68+
make launch
69+
```
70+
71+
#### PythonAPI
72+
73+
Compiled using Python's `setuptools` ("setup.py"). Currently requires the
74+
following to be installed in the machine: Python, libpython-dev, and
75+
libboost-python-dev; both for Python 2.7 and 3.5.
76+
77+
Command
78+
79+
```sh
80+
make PythonAPI
81+
```
82+
83+
It creates two "egg" packages
84+
85+
* `PythonAPI/dist/carla-0.9.0-py2.7-linux-x86_64.egg`
86+
* `PythonAPI/dist/carla-0.9.0-py3.5-linux-x86_64.egg`
87+
88+
This package can be directly imported into a Python script by adding it to the
89+
system path
90+
91+
```python
92+
#!/usr/bin/env python
93+
94+
import sys
95+
96+
sys.path.append(
97+
'PythonAPI/dist/carla-0.9.0-py%d.%d-linux-x86_64.egg' % (sys.version_info.major,
98+
sys.version_info.minor))
99+
100+
import carla
101+
102+
# ...
103+
```
104+
105+
or installed with `easy_install`
106+
107+
```sh
108+
easy_install2 --user --no-deps PythonAPI/dist/carla-0.9.0-py2.7-linux-x86_64.egg
109+
easy_install3 --user --no-deps PythonAPI/dist/carla-0.9.0-py3.5-linux-x86_64.egg
110+
```

0 commit comments

Comments
 (0)