Fix the build

This commit is contained in:
nsubiron 2018-07-30 12:11:31 +02:00
parent f40c90942f
commit 3b3bb1868a
4 changed files with 28 additions and 16 deletions

View File

@ -7,9 +7,9 @@ Install the build tools and dependencies
```
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get install build-essential clang-5.0 lld-5.0 g++-7 ninja-build python python-pip python3 python3-pip libboost-python-dev python-dev tzdata sed curl wget unzip autoconf libtool
pip2 install --user setuptools nose2
pip3 install --user setuptools nose2
sudo apt-get update
sudo apt-get install build-essential clang-5.0 lld-5.0 g++-7 ninja-build python python-pip python-dev tzdata sed curl wget unzip autoconf libtool
pip install --user setuptools nose2
```
To avoid compatibility issues between Unreal Engine and the CARLA dependencies,

View File

@ -25,7 +25,8 @@ foreach(target carla_client_debug carla_client)
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}")
install(TARGETS ${target} DESTINATION lib)
# @todo This was disabled because now everything is built in the setup.py.
# install(TARGETS ${target} DESTINATION lib)
endforeach(target)
# Specific options for debug.

View File

@ -7,21 +7,31 @@
from setuptools import setup, Extension
import fnmatch
import glob
import os
import platform
import sys
def get_libcarla_extensions():
libraries = ['carla_client', 'rpc']
include_dirs = ['dependencies/include']
library_dirs = ['dependencies/lib']
libraries = []
if os.name == "posix":
if platform.dist()[0] == "Ubuntu":
libraries += ["boost_python-py%d%d" % (sys.version_info.major,
sys.version_info.minor)]
else:
libraries += ["boost_python"]
pwd = os.path.dirname(os.path.realpath(__file__))
pylib = "libboost_python%d%d.a" % (sys.version_info.major,
sys.version_info.minor)
extra_link_args = [
os.path.join(pwd, 'dependencies/lib/librpc.a'),
os.path.join(pwd, 'dependencies/lib', pylib)]
extra_compile_args = [
'-fPIC', '-std=c++14', '-DBOOST_ERROR_CODE_HEADER_ONLY', '-Wno-missing-braces'
]
# @todo Why would we need this?
include_dirs += ['/usr/lib/gcc/x86_64-linux-gnu/7/include']
library_dirs += ['/usr/lib/gcc/x86_64-linux-gnu/7']
extra_link_args += ['/usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.a']
else:
raise NotImplementedError
@ -37,13 +47,11 @@ def get_libcarla_extensions():
return Extension(
name,
sources=sources,
include_dirs=[
'dependencies/include'],
library_dirs=[
'dependencies/lib'],
runtime_library_dirs=['dependencies/lib'],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
extra_compile_args=['-fPIC', '-std=c++14', '-DBOOST_ERROR_CODE_HEADER_ONLY', '-Wno-missing-braces'],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
language='c++14',
depends=depends)

View File

@ -115,5 +115,8 @@ public class Carla : ModuleRules
string LibCarlaIncludePath = Path.Combine(LibCarlaInstallPath, "include");
PublicIncludePaths.Add(LibCarlaIncludePath);
PrivateIncludePaths.Add(LibCarlaIncludePath);
/// @todo This is necessary because rpclib uses exceptions to notify errors.
bEnableExceptions = true;
}
}