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

Regina Obe lr at pcorp.us
Wed Sep 8 08:53:16 PDT 2021


Esteban,

 

Unfortunately I don’t build that way more about the particulars of what I work on (I have to build for many versions of PostGIS and PostgreSQL) than anything wrong with your below instructions.

So I wouldn’t be able to easily validate.  At a glance they look fine.

 

This much I can say.

 

I do build PostgreSQL using mingw/msys2 tool chain (I don’t use the  PostgreSQL VC++ standard builds for building – mostly because of the hassle of making it work the way it does on Linux – and I need autotools for building PostGIS).

I do however test against both mingw install and the PostgreSQL VC++ standard builds (using EDB zip binaries - https://www.enterprisedb.com/download-postgresql-binaries ).

For testing pgRouting/PostGIS against PostgreSQL VC++ I just start up that instance copy the mingw compiled binaries and extension files to the VC build and run the tests.

 

In your case since you are building with CMake – you could possibly work with either mode.  pgRouting for example builds fine for windows both against my mingw setup and standard VC++ setup -  https://github.com/pgRouting/pgrouting/blob/main/.github/workflows/windows.yml (uses standard VC++ setup)

 

I also use Msys cmake for building.  This might not be necessary anymore but when I started up building with CMake I had horrible experience with things just not working with the Cmake packaged with msys-mingw, so I always downloaded the windows cmake binaries from https://cmake.org/download/  (the 32-bit cause I had to build for both 64-bit and 32-bit)  and then using:

 

cmake -G "MSYS Makefiles"

 

That also allowed me to easily test the (latest or particular version of) cmake system without disrupting my msys/mingw setup.

 

 

From: Mobilitydb-dev [mailto:mobilitydb-dev-bounces at lists.osgeo.org] On Behalf Of Esteban Zimanyi
Sent: Wednesday, September 8, 2021 11:24 AM
To: mobilitydb-dev at lists.osgeo.org
Subject: [Mobilitydb-dev] Instructions for building MobilityDB on Windows with msys2

 

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/0daf36b1/attachment-0001.html>


More information about the Mobilitydb-dev mailing list