2019-06-03 19:01:53 +08:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
# ==============================================================================
|
|
|
|
# -- Set up environment --------------------------------------------------------
|
|
|
|
# ==============================================================================
|
|
|
|
source $(dirname "$0")/Environment.sh
|
|
|
|
|
|
|
|
# ==============================================================================
|
2020-03-24 00:20:31 +08:00
|
|
|
# -- Get and compile ad-rss -------------------------------------------
|
2019-06-03 19:01:53 +08:00
|
|
|
# ==============================================================================
|
|
|
|
|
2020-07-03 21:54:04 +08:00
|
|
|
ADRSS_BASENAME=ad-rss-4.0.0
|
2020-03-30 18:33:15 +08:00
|
|
|
ADRSS_INSTALL_DIR="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/install"
|
2019-06-03 19:01:53 +08:00
|
|
|
|
2020-03-30 18:33:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
if [[ -d "${ADRSS_INSTALL_DIR}" ]]; then
|
|
|
|
log "${ADRSS_BASENAME} already installed."
|
2019-06-03 19:01:53 +08:00
|
|
|
else
|
2020-07-03 21:54:04 +08:00
|
|
|
if [[ ! -d "${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/src" ]]; then
|
|
|
|
# ad-rss is built inside a colcon workspace, therefore we have to setup the workspace first
|
|
|
|
if [[ -d "${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/build" ]]; then
|
|
|
|
rm -rf "${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/build"
|
|
|
|
fi
|
2020-03-30 20:02:50 +08:00
|
|
|
|
2020-07-03 21:54:04 +08:00
|
|
|
mkdir -p "${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/src"
|
2019-06-03 19:01:53 +08:00
|
|
|
|
2020-07-03 21:54:04 +08:00
|
|
|
log "Retrieving ${ADRSS_BASENAME}."
|
2019-06-03 19:01:53 +08:00
|
|
|
|
2020-07-03 21:54:04 +08:00
|
|
|
pushd "${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/src" >/dev/null
|
2020-07-29 17:07:58 +08:00
|
|
|
git clone --depth=1 -b v1.7.0 https://github.com/gabime/spdlog.git
|
2020-07-03 21:54:04 +08:00
|
|
|
git clone --depth=1 -b 4.9.3 https://github.com/OSGeo/PROJ.git
|
|
|
|
git clone --depth=1 -b v2.1.0 https://github.com/carla-simulator/map.git
|
2020-07-21 21:16:22 +08:00
|
|
|
git clone --depth=1 -b v4.0.1 https://github.com/intel/ad-rss-lib.git
|
2020-07-03 21:54:04 +08:00
|
|
|
popd
|
2020-03-30 18:33:15 +08:00
|
|
|
|
2020-07-03 21:54:04 +08:00
|
|
|
cat >"${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/colcon.meta" <<EOL
|
2020-03-30 18:33:15 +08:00
|
|
|
{
|
|
|
|
"names": {
|
2020-07-03 21:54:04 +08:00
|
|
|
"PROJ4": {
|
|
|
|
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_LIBPROJ_SHARED=OFF"]
|
|
|
|
},
|
2020-03-30 18:33:15 +08:00
|
|
|
"ad_physics": {
|
2020-07-03 21:54:04 +08:00
|
|
|
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"]
|
2020-03-30 18:33:15 +08:00
|
|
|
},
|
|
|
|
"ad_map_access": {
|
2020-07-03 21:54:04 +08:00
|
|
|
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"]
|
2020-03-30 18:33:15 +08:00
|
|
|
},
|
|
|
|
"ad_map_opendrive_reader": {
|
2020-07-03 21:54:04 +08:00
|
|
|
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"],
|
|
|
|
"dependencies": ["PROJ4"]
|
2020-03-30 18:33:15 +08:00
|
|
|
},
|
|
|
|
"ad_rss": {
|
2020-07-03 21:54:04 +08:00
|
|
|
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"]
|
2020-03-30 18:33:15 +08:00
|
|
|
},
|
|
|
|
"ad_rss_map_integration": {
|
2020-07-03 21:54:04 +08:00
|
|
|
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"]
|
2020-03-30 18:33:15 +08:00
|
|
|
},
|
|
|
|
"spdlog": {
|
|
|
|
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EOL
|
2020-07-03 21:54:04 +08:00
|
|
|
fi
|
2019-06-03 19:01:53 +08:00
|
|
|
|
2020-03-30 18:33:15 +08:00
|
|
|
log "Compiling ${ADRSS_BASENAME}."
|
2019-06-03 19:01:53 +08:00
|
|
|
|
2020-03-30 18:33:15 +08:00
|
|
|
pushd "${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}" >/dev/null
|
|
|
|
|
|
|
|
if [ "${CMAKE_PREFIX_PATH}" == "" ]; then
|
|
|
|
export CMAKE_PREFIX_PATH=${CARLA_BUILD_FOLDER}/boost-1.72.0-c8-install
|
|
|
|
else
|
|
|
|
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${CARLA_BUILD_FOLDER}/boost-1.72.0-c8-install
|
|
|
|
fi
|
|
|
|
|
2020-07-03 21:54:04 +08:00
|
|
|
# enforce sequential executor to reduce the required memory for compilation
|
2020-07-06 21:34:37 +08:00
|
|
|
colcon build --executor sequential --packages-up-to ad_rss_map_integration --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE="${CARLA_BUILD_FOLDER}/LibStdCppToolChain.cmake"
|
2020-03-30 18:33:15 +08:00
|
|
|
|
2020-03-30 23:52:37 +08:00
|
|
|
COLCON_RESULT=$?
|
|
|
|
if (( COLCON_RESULT )); then
|
|
|
|
rm -rf "${ADRSS_INSTALL_DIR}"
|
|
|
|
log "Failed !"
|
|
|
|
else
|
|
|
|
log "Success!"
|
|
|
|
fi
|
|
|
|
|
2020-03-30 18:33:15 +08:00
|
|
|
# ==============================================================================
|
|
|
|
# -- ...and we are done --------------------------------------------------------
|
|
|
|
# ==============================================================================
|
|
|
|
|
|
|
|
popd >/dev/null
|
|
|
|
|
|
|
|
fi
|