How to Install OSRM on Ubuntu 20.04 – Open Source Routing Machine
OSRM (Open Source Routing Machine) is a super fast routing engine for OpenStreetMap (OSM) road networks. In previous tutorials, we explained the process of setting up a self-hosted OpenStreetMap tile server and how to add address lookup functionality to your map with Nominatim. This tutorial is going to show you how to add navigation functionality to your OpenStreetMap with OSRM, which provides car routing, bike routing, and walk routing.
This tutorial also works on Ubuntu 18.04.
Prerequisites
To follow this tutorial, you should have an OSM tile server up and running. If not, please follow the tutorial below to set up your own OSM tile server.
You should also have access to a geocoding service like Nominatim for address lookup.
Once the requirements are met, follow the instructions below to set up OSRM server.
Step 1: Build OSRM From Source
Install dependency packages.
sudo apt update sudo apt install build-essential git cmake pkg-config doxygen libboost-all-dev libtbb-dev lua5.2 liblua5.2-dev libluabind-dev libstxxl-dev libstxxl1v5 libxml2 libxml2-dev libosmpbf-dev libbz2-dev libzip-dev libprotobuf-dev
Create the osrm
user. (No need to create a password for this user.)
sudo useradd -d /srv/osrm -s /bin/bash -m osrm
Grant permissions to your own user account.
sudo apt install acl
sudo setfacl -R -m u:username:rwx /srv/osrm/
Change to the /srv/osrm/
directory.
cd /srv/osrm/
Download the OSRM source code from its Github repository.
git clone https://github.com/Project-OSRM/osrm-backend.git
Create the build
directory.
mkdir build
Change to this directory and configure the build environment.
cd build cmake /srv/osrm/osrm-backend/
Compile the source code.
make
Install the binaries.
sudo make install
The following binaries will be installed.
- /usr/local/bin/osrm-extract:
- /usr/local/bin/osrm-partition:
- /usr/local/bin/osrm-customize:
- /usr/local/bin/osrm-contract:
- /usr/local/bin/osrm-datastore:
- /usr/local/bin/osrm-routed:
Step 2: Install GNU Screen
In the next step, we will need to extract road networks from OpenStreetMap, which can take a long time. Your computer might be disconnected from the Internet, so it’s recommended to use the GNU Screen utility to keep your session alive. Install screen on the Ubuntu 20.04 server:
sudo apt install screen
Then start screen:
screen
Upon the first launch, you will see an introduction text, simply press Enter
to end. Then you will be able to run commands as usual.
Step 3: Generate OSRM Routing Data
Now we need to download the OpenStreetMap data and make it usable for routing. Run the following command to download the map data of the whole planet (56G) in PBF (ProtoBufBinary) format.
wget -c http://planet.openstreetmap.org/pbf/planet-latest.osm.pbf -P /srv/osrm/osrm-backend
If you want a map of an individual country/state/province/city, go to http://download.geofabrik.de. For example, download the map data of Great Britain (1.2G) with the following command.
wget -c http://download.geofabrik.de/europe/great-britain-latest.osm.pbf -P /srv/osrm/osrm-backend
BBBike.org also provides extracts of more than 200 cities and regions worldwide in different formats.
Make sure you are in the /srv/osrm/osrm-backend/
directory.
cd /srv/osrm/osrm-backend/
Extract a graph out of the OpenStreetMap data.
osrm-extract britain-and-ireland-latest.osm.pbf --threads=10
By default, it will use the car.lua
profile.
Now you probably don’t need to do other things on your server. Since you are using Screen, you can press Ctrl+A, release those keys, and then press D key to detach from the current Screen session. You will see a message like below.
[detached from 32113.pts-1.focal]
This tells me that the previous Screen session ID is 32113. You can log out from the SSH session and even shut down your computer. Don’t worry, the osrm-extract
process is still running. When you need to come back and check the progress, SSH into your server and run the following command to get the previous Screen Session ID.
screen -ls
Sample output:
There is a screen on: 32113.pts-1.focal (05/19/2020 03:45:29 PM) (Detached) 1 Socket in /run/screen/S-linuxbabe.
Then you can re-attach to the previous Screen session.
screen -r 32113
This process is memory intensive. (It uses 7GB RAM on my server.) Once it’s finised, there will be a file with the same filename but with the .osrm
extension. Run the following command to partition this graph recursively into cells
osrm-partition britain-and-ireland-latest.osrm
Customize the cells by calculating routing weights for all cells.
osrm-customize britain-and-ireland-latest.osrm
Now you can start the routing engine.
osrm-routed --algorithm=MLD britain-and-ireland-latest.osrm
As you can see, it listens on TCP port 5000.
Step 4: Creating a systemd service
We can manually run the OSRM routing engine with osrm-routed --algorithm=MLD britain-and-ireland-latest.osrm
, but it’s more convenient to run osrm-routed as a systemd service in the background. Press Ctrl+C
to stop the current osrm-routed process and create a systemd service unit file for osrm-routed with the following command.
sudo nano /etc/systemd/system/osrm-routed.service
Put the following lines into the file.
[Unit]
Description=Open Source Routing Machine
Wants=network-online.target
After=network.target network-online.target
[Service]
ExecStart=/usr/local/bin/osrm-routed --algorithm=MLD /srv/osrm/osrm-backend/britain-and-ireland-latest.osrm
User=osrm
Group=osrm
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target
Save and close the file. Change the ownership of the /srv/osrm/osrm-backend/
directory.
sudo chown osrm:osrm /srv/osrm/osrm-backend/ -R
Now we can start and enable the osrm-routed
systemd service.
sudo systemctl start osrm-routed sudo systemctl enable osrm-routed
Check status.
systemctl status osrm-routed
If the osrm-routed
service isn’t active (running), you can run the following command to see what’s wrong.
sudo journalctl -eu osrm-routed
Step 5: Configure Apache web server
We can configure Apache web server as a reverse proxy for the osrm-routed
service, so we can use a domain name to access the routing service and also enable HTTPS encryption.
Install Apache web server.
sudo apt install apache2
To use Apache as a reverse proxy, we need to enable the proxy
, proxy_http
and rewrite
module.
sudo a2enmod proxy proxy_http rewrite
Then create a virtual host file for OSRM.
sudo nano /etc/apache2/sites-available/osrm.conf
Add the following texts into the file. Replace osrm.your-domain.com
with your actual domain name and don’t forget to create DNS A record for it.
<VirtualHost *:80> ServerName osrm.your-domain.com ProxyPass / http://127.0.0.1:5000/ ProxyPassReverse / http://127.0.0.1:5000/ # Only allow authorizied domains to use this service. SetEnvIf Origin "^http(s)?://(.+\.)?(example\.com|otherdomain\.tld)$" origin_is=$0 Header unset Access-Control-Allow-Origin Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is </VirtualHost>
Save and close the file. Then enable this virtual host.
sudo a2ensite osrm.conf
Reload Apache for the changes to take effect.
sudo systemctl reload apache2
Now you can remotely access OSRM by entering the domain name (osrm.your-domain.com
) in browser address bar.
Step 6: Enable HTTPS
We can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. In the OSM tile server setup tutorial, we have already install the Let’s Encrypt client (certbot) from the Snap store. So we just need to run the following command to obtain and install TLS certificate.
sudo /snap/bin/certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d osrm.your-domain.com
Where:
--apache
: Use the Apache plugin.--agree-tos
: Agree to terms of service.--redirect
: Force HTTPS by 301 redirect.--hsts
: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.--staple-ocsp
: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.
The certificate should now be obtained and automatically installed. And you will be able to access Webmin web interface over a secure HTTPS connection.
Step 7: Integrate OSRM with a Slippy Map
I assume your slippy map is displayed using the Leaflet JavaScript library, and you have added Nominatim geocoding service to your slippy map.
To integrate OSRM with a slippy map, we can use a plugin called Leaflet Routing Machine. First, include the Leaflet routing machine JavaScript and CSS file to your slippy map. Note that they should be placed after the main Leaflet JavaScript and the Leaflet Control Geocoder JavaScript.
<html> <head> .... .... <link rel="stylesheet" href="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.css" /> <script src="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.js"></script> </head> <body> .... .... </body> </html>
Next, add the following lines to the <script>...</script>
snippet in the HTML body.
L.Routing.control({ serviceUrl: 'https://osrm.your-domain.com/route/v1', geocoder: L.Control.Geocoder.nominatim({serviceUrl:'https://tile.your-domain.com/nominatim/'}), routeWhileDragging: true }).addTo(map);
Like this:
<html> <head> .... .... <link rel="stylesheet" href="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.css" /> <script src="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.js"></script> </head> <body> <div id="map"></div> <script> .... .... L.Routing.control({ serviceUrl: 'https://osrm.your-domain.com/route/v1', geocoder: L.Control.Geocoder.nominatim({serviceUrl:'https://tile.your-domain.com/nominatim/'}), routeWhileDragging: true }).addTo(map); </script> </body> </html>
Save and close the file. Then reload the map in your web browser, you should see a control panel on the upper-right corner, where you can enter the starting address and destination address.
You can drag the waypoints on the map and OSRM will automatically recalculate the route.
Wrapping Up
I hope this tutorial helped you set up OSRM server on Ubuntu 20.04. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂
Hi, thanks for the other two tutorials, they work great. I had to do a bit extra to get them working in a proxmox container with ZFS, and then working with pfsense and cloudflare.
I have been trying to get this last tutorial working, but I don’t know where to check for error information. When I try it in an empty LXC it still errors out.
The server has 256GB, the vm is allotted 128GB with a 40GB scratch an 200GB free disk space.
Any insight appreciated, but the know-how to see what killed my poor machine would be nice.
NOTE: I am for now on using your amazon link for all future purchases=)
Probably your server runs out of RAM.
disregard my post- delete….
I added more memory, restarted the lxc, and stopped it from pre-rendering tiles.
Then the process completed, but I seem to have trouble rendering tiles.
I’ll work on this for another day and see if I can see something in journalctl.
If you also followed the guide to set up nominatim, I then had to give permissions again to osm on gis. My server wouldn’t render after nominatim but after reapplying the osm privilege to gis, it started working again.
The error was in renderd journalctl saying the postgres server disconnected unexpectedly
Sorry, I missed saying you need to give permissions to osm on the gis scheme in postgres
I’d recommend adding swap if you have the space for it, as osrm-extract can be much faster if you add threads (if you have them)
[info] Parsing in progress..
[info] input file generated by osmium/1.8.0
[info] timestamp: 2019-09-14T20:15:02Z
[info] Using profile api version 4
[info] Found 3 turn restriction tags:
[info] motorcar
[info] motor_vehicle
[info] vehicle
[info] Parse relations …
[info] Parse ways and nodes …
[info] Using profile api version 4
[info] Using profile api version 4
[info] Using profile api version 4
[info] RAM: peak bytes used: 1191161856
[error] [exception] std::bad_alloc
[error] Please provide more memory or consider using a larger swapfile
How do I change the route instructions unit to miles? I tried switching line 16270 in leaflet-routing-machine.js to ‘imperial’ but it didn’t seem to change anything.
Boa tarde , fiz as configurações. Porém quando acesso no navegador esta abrindo uma pagina do apache . Poderia me ajudar?
Obrigado
Use a real domain name instead of an IP address.
Hi
I am running into fallowing issue which throws an fatal error and exits the script. I already try to find a solution via google but cant….
This is the error …
command: cmake /srv/osrm/osrm-backend/
I have this exact same error, and I would also like to know an answer! If you find out a solution please let me know. I have tried reinstalling tbb libraries, hardcoding it to path, etc. Nothing is working!
Hi i fixed my problem by
RUNNING
AND
AND THEN AGAIN
Found this solution on the github page of the osrm backend
github(.)com/Project-OSRM/osrm-backend/issues/6361
Hope that this will help you!
thank you !
Are you using Ubuntu 22.04? It currently doesn’t work.
please help me, I did everything as in the tutorial, but when accessing the server it gives an error 404. what to do?
I am receiving an error with “Linking CXX executable osrm-routed”
Scanning dependencies of target osrm-routed
[ 91%] Linking CXX executable osrm-routed
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::impl>::dispose(): error: undefined reference to ‘boost::iostreams::detail::zlib_base::reset(bool, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::impl>::dispose(): error: undefined reference to ‘boost::iostreams::detail::zlib_base::~zlib_base()’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::zlib_base()’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::do_init(boost::iostreams::zlib_params const&, bool, void* (*)(void*, unsigned int, unsigned int), void (*)(void*, void*), void*)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::zlib::best_compression’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::zlib::best_speed’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::reset(bool, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::~zlib_base()’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::reset(bool, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::basic_gzip_compressor<std::allocator >::basic_gzip_compressor(boost::iostreams::gzip_params const&, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::~zlib_base()’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::sync_impl(): error: undefined reference to ‘boost::iostreams::detail::zlib_base::before(char const*&, char const*, char*&, char*)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::sync_impl(): error: undefined reference to ‘boost::iostreams::zlib::no_flush’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::sync_impl(): error: undefined reference to ‘boost::iostreams::detail::zlib_base::xdeflate(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::sync_impl(): error: undefined reference to ‘boost::iostreams::detail::zlib_base::after(char const*&, char*&, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::sync_impl(): error: undefined reference to ‘boost::iostreams::zlib_error::check(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::sync_impl(): error: undefined reference to ‘boost::iostreams::zlib::stream_end’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::overflow(int): error: undefined reference to ‘boost::iostreams::detail::zlib_base::before(char const*&, char const*, char*&, char*)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::overflow(int): error: undefined reference to ‘boost::iostreams::zlib::no_flush’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::overflow(int): error: undefined reference to ‘boost::iostreams::detail::zlib_base::xdeflate(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::overflow(int): error: undefined reference to ‘boost::iostreams::detail::zlib_base::after(char const*&, char*&, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::overflow(int): error: undefined reference to ‘boost::iostreams::zlib_error::check(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function boost::iostreams::detail::indirect_streambuf<boost::iostreams::basic_gzip_compressor<std::allocator >, std::char_traits, std::allocator, boost::iostreams::output>::overflow(int): error: undefined reference to ‘boost::iostreams::zlib::stream_end’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::before(char const*&, char const*, char*&, char*)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::zlib::no_flush’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::xdeflate(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::after(char const*&, char*&, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::zlib_error::check(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::zlib::stream_end’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::detail::zlib_base::before(char const*&, char const*, char*&, char*)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator >, std::allocator >::read<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >(boost::iostreams::detail::linked_streambuf<char, std::char_traits >&, char*, long): error: undefined reference to ‘boost::iostreams::zlib::finish’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function void boost::iostreams::basic_gzip_compressor<std::allocator >::close<boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > > >(boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >&, std::_Ios_Openmode): error: undefined reference to ‘boost::iostreams::zlib::finish’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function void boost::iostreams::basic_gzip_compressor<std::allocator >::close<boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > > >(boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >&, std::_Ios_Openmode): error: undefined reference to ‘boost::iostreams::detail::zlib_base::xdeflate(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function void boost::iostreams::basic_gzip_compressor<std::allocator >::close<boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > > >(boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >&, std::_Ios_Openmode): error: undefined reference to ‘boost::iostreams::detail::zlib_base::after(char const*&, char*&, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function void boost::iostreams::basic_gzip_compressor<std::allocator >::close<boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > > >(boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >&, std::_Ios_Openmode): error: undefined reference to ‘boost::iostreams::zlib_error::check(int)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function void boost::iostreams::basic_gzip_compressor<std::allocator >::close<boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > > >(boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >&, std::_Ios_Openmode): error: undefined reference to ‘boost::iostreams::zlib::stream_end’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function void boost::iostreams::basic_gzip_compressor<std::allocator >::close<boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > > >(boost::iostreams::non_blocking_adapter<boost::iostreams::detail::linked_streambuf<char, std::char_traits > >&, std::_Ios_Openmode): error: undefined reference to ‘boost::iostreams::detail::zlib_base::reset(bool, bool)’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function osrm::server::Connection::compress_buffers(std::vector<char, std::allocator > const&, osrm::server::http::compression_type): error: undefined reference to ‘boost::iostreams::zlib::deflated’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function osrm::server::Connection::compress_buffers(std::vector<char, std::allocator > const&, osrm::server::http::compression_type): error: undefined reference to ‘boost::iostreams::zlib::default_strategy’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function osrm::server::Connection::compress_buffers(std::vector<char, std::allocator > const&, osrm::server::http::compression_type): error: undefined reference to ‘boost::iostreams::zlib::default_compression’
CMakeFiles/SERVER.dir/src/server/connection.cpp.o:connection.cpp:function osrm::server::Connection::compress_buffers(std::vector<char, std::allocator > const&, osrm::server::http::compression_type): error: undefined reference to ‘boost::iostreams::zlib::best_speed’
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/osrm-routed.dir/build.make:151: osrm-routed] Error 1
make[1]: *** [CMakeFiles/Makefile2:383: CMakeFiles/osrm-routed.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Please help with this, after make command (UBUNTU 20.04)
# make
Scanning dependencies of target EXTRACTOR
[ 4%] Building …….
and: