osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Build on Arch Linux

Open vklachkov opened this issue 3 years ago • 0 comments

I researched building osrm-backend on Arch Linux. Perhaps someone will be interested

Dependencies

Some dependencies were installed before the build started. If something is missing from the list, write, I will add

  • clang
  • libc++
  • cmake
  • boost
  • lua52

Clang 14 was chosen as the compiler. For some reason, GCC 12 gives a lot of errors

Build

Build old tbb

Download source code from ubuntu repository

wget http://archive.ubuntu.com/ubuntu/pool/universe/t/tbb/tbb_2017~U7.orig.tar.xz

Unpack

tar xf tbb_2017\~U7.orig.tar.xz

cd tbb-2017_U7

Build

Check parameters:

make compiler=clang info

My output:

OS: linux
arch=intel64
compiler=clang
runtime=cc12.1.0_libc2.35_kernel5.18.11
tbb_build_prefix=linux_intel64_clang_cc12.1.0_libc2.35_kernel5.18.11

And build:

CXXFLAGS="-std=c++14" make compiler=clang

Install

Copy includes:

sudo cp -r include/serial /usr/include/

sudo cp -r include/tbb /usr/include/

Copy shared libraries:

sudo cp build/linux_intel64_clang_cc12.1.0_libc2.35_kernel5.18.11_release/libtbb* /lib64/

Build osrm-backend

Setup enviroment

export CXX=clang++

export CXXFLAGS="-std=c++14"

export CC=clang

Build

git clone --recursive https://github.com/Project-OSRM/osrm-backend/

cd osrm-backend

mkdir -p build

cd build

cmake .. \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=ON \
        -DLUA_INCLUDE_DIR=/usr/include

sudo make install

vklachkov avatar Jul 15 '22 09:07 vklachkov