For example, you can build the following command to install all MobilityDB build dependencies for Debian-based systems:
apt install build-essential cmake postgresql-server-dev-11 liblwgeom-dev libproj-dev libjson-c-dev libprotobuf-c-dev
Here is the gist:
git clone https://github.com/MobilityDB/MobilityDB
mkdir MobilityDB/build
cd MobilityDB/build
cmake ..
make
sudo make install
The above commands install the master branch. If you want to install another branch, for example, develop, you can replace the first command above as follows:
git clone --branch develop https://github.com/MobilityDB/MobilityDB
You should also set the following in the file postgresql.conf depending on the version of PostGIS you have installed (below we use PostGIS 3):
shared_preload_libraries = 'postgis-3'
max_locks_per_transaction = 128
You can replace 'postgis-2.5' above if you want to use PostGIS 2.5.
If you do not preload the PostGIS library you will not be able to load the MobilityDB library and will get an error message such as the following one:
ERROR: could not load library "/usr/local/pgsql/lib/libMobilityDB-1.0.so": undefined symbol: ST_Distance
Notice that you can find the location of the postgresql.conf file as given next
$ which postgres
/usr/local/pgsql/bin/postgres
$ ls /usr/local/pgsql/data/postgresql.conf
/usr/local/pgsql/data/postgresql.conf
As can be seen, the PostgreSQL binaries are in the bin subdirectory while the postgresql.conf file is in the data subdirectory.
Once MobilityDB is installed, it needs to be enabled in each database you want to use it in. In the example below we use a database named mobility.
createdb mobility
psql mobility -c "CREATE EXTENSION PostGIS"
psql mobility -c "CREATE EXTENSION MobilityDB"
Coming Soon
If you have docker installed in your system, follow those steps :
Download the latest most up-to-date image of MobilityDB
docker pull mobilitydb/mobilitydb
Create a volume container on the host, that we will use to persist the PostgreSQL database files outside of the MobilityDB container.
docker volume create mobilitydb_data
Executes the binary image of PostgreSQL, PostGIS, and MobilityDB with the TCP port 5432 in the container mapped to port 25432 on the Docker host (user = pw = docker, db = mobilitydb)
docker run --name "mobilitydb" -d -p 25432:5432 -v mobilitydb_data:/var/lib/postgresql mobilitydb/mobilitydb
connect to the database using psql.
psql -h localhost -p 25432 -d mobilitydb -U docker