[Mobilitydb-dev] Instructions for building MobilityDB on Windows with msys2

Esteban Zimanyi esteban.zimanyi at ulb.be
Wed Sep 8 08:24:00 PDT 2021


Dear Regina & Vicky

We have tested the instructions below for building MobilityDB on Windows
with msys2 and they work on arbitrary machines.

However, while I have already PostgreSQL and PostGIS installed on my
Windows computer, the instructions below reinstall PostgreSQL and PostGIS
on msys2 and build with those versions instead of the already installed
ones.

Can you tell us whether this is the right way to do the build or how we can
improve it ?

Many thanks for your help

--------------------------------------------------------------------------
Download the msys2 installer from https://www.msys2.org/ and follow the
instructions. In the following we assume that you install msys2 on drive D:

On the MSYS2 MSYS shell run the following commands to install the required
dependencies

pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-postgresql
mingw-w64-x86_64-postgis
pacman -S mingw-w64-x86_64-gsl mingw-w64-i686-xz git

Run "MSYS MinGW 64-bit" from Start menu and run the following commands

git clone https://github.com/estebanzimanyi/MobilityDB.git
cd MobilityDB
mkdir build
cd build
git checkout msys2-build
cmake -DCMAKE_BUILD_TYPE=Release -G"MinGW Makefiles" ..
cmake --build .
cmake --install .

You need to define where the databases will reside on your hard disk. In
the following we assume the location D:/msys64/usr/local/pgsql/data. Run
the following commands

export PGDATA="D:/msys64/usr/local/pgsql/data"
rm -rf $PGDATA # DANGER ! This remove all existing databases in that
directory
initdb

To start the database you need to define the port used by PostgreSQL to
listen for connections from client applications. This is typically 5432
unless you have other PostgreSQL versions installed. On msys2 you can use
the following command to see the ports already in use

netstat -a -o | grep LISTENING

In the following we assume that we use the port 5433. Then issue the
following command

export PGPORT=5433
pg_ctl start
createdb mydb
psql mydb

Now on psql issue the following commands

CREATE EXTENSION mobilitydb CASCADE;
SELECT mobilitydb_version();

You should see something like the following

                 mobilitydb_full_version
---------------------------------------------------------
 MobilityDB 1.0.0 Beta 3, PostgreSQL 13.3, PostGIS 2.5.5
(1 row)

You are now ready to use MobilityDB !
--------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mobilitydb-dev/attachments/20210908/295213c8/attachment.html>


More information about the Mobilitydb-dev mailing list