Skip to content

Building on windows with msys2 and mingw64 (WIP)

Regina Obe edited this page Mar 1, 2023 · 5 revisions
  1. Download msys2 from https://www.msys2.org/ and run the exe installer
  2. After installing, launch the mingw64.exe
  3. Run the following commands
pacman -Syu
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman --needed -S git mingw-w64-x86_64-cmake mingw-w64-x86_64-postgresql mingw-w64-x86_64-postgis
  1. Launch PostgreSQL
#now initialize postgresql cluster
initdb -D C:/temp/pgsql

# start the cluster
pg_ctl -D C:/temp/pgsql -l logfile start
  1. Connect to PostgreSQL and create test db
psql -d postgres #connect to postgres database
# in psql shell
SELECT version(); -- outputs the version 

CREATE DATABASE gisdb;
\c gisdb
CREATE EXTENSION postgis;
SELECT postgis_full_version();
exit
  1. Download and try to build pgrouting
# back in shell
mkdir C:/projects
cd C:/projects 
git clone https://github.com/pgRouting/pgRouting.git
cd pgRouting
cmake --version #returns cmake version 3.25.2

mkdir build
cd build
cmake -G"Unix Makefiles" ..
cmake --build .  #currently fails here with errors
make install
Clone this wiki locally