[postgis-users] Windows compile instructions

Regina Obe lr at pcorp.us
Sun Nov 19 18:28:16 PST 2023


Cool and I see they had a release 5 days ago.  A quick attempt at compile I wasn’t successful even using the 

 

make USE_HEALPIX=0

 

I get error:

In file included from src/sparse.c:136:

src/sparse.h:69:5: error: 'INT' redeclared as different kind of symbol

   69 |     INT = 270,                     /* INT  */

      |     ^~~

In file included from C:/ming64/mingw64/include/minwindef.h:163,

                 from C:/ming64/mingw64/include/windef.h:9,

                 from C:/ming64/mingw64/include/windows.h:69,

                 from C:/ming64/mingw64/include/winsock2.h:23,

                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port/win32_port.h:60,

                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port.h:24,

                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/c.h:1375,

                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/postgres.h:45,

                 from src/sparse.y:4:

C:/ming64/mingw64/include/winnt.h:299:15: note: previous declaration of 'INT' with type 'INT' {aka 'int'}

  299 |   typedef int INT;

      |               ^~~

src/sparse.h:70:5: error: 'FLOAT' redeclared as different kind of symbol

   70 |     FLOAT = 271,                   /* FLOAT  */

 

 

I didn’t look too deeply to see how to fix the issue, or if it’s just something about my setup. 

 

Normally these kinds of issues need some conditional handling for mingw64 and/or windows.  PostGIS has a couple of special handlings.

 

If you have any luck let me know.  I plan to take a look at it later either way.

 

Even though it doesn’t rely on PostGIS, I’d be willing to include it as part of the PostGIS Bundle, or as a separate package under Windows Application Stack Builder -> Spatial Extensions.

 

Thanks,

Regina

 

 

 

From: Gandalf the Gray <pjduplooy.gis at gmail.com> 
Sent: Sunday, November 19, 2023 9:53 AM
To: Regina Obe <lr at pcorp.us>
Subject: Re: Windows compile instructions

 

Hi Regina

 

There is actually a newer repository:

 

https://github.com/postgrespro/pgsphere

 

On Sat, Nov 18, 2023 at 7:05 PM Regina Obe <lr at pcorp.us <mailto:lr at pcorp.us> > wrote:

Gandalf,

 

Sorry I keep on meaning to put up my compile instructions and latest PostGIS build chain up, but everytime I start, I create a mess of things and put it off, cause I’m midway upgrading my chain to a newer and haven’t swapped out my mingw setup.

 

I had written these instructions not too long ago for building pgRouting under msys/mingw, https://github.com/pgRouting/pgrouting/wiki/Building-on-windows-with-msys2-and-mingw64-(WIP)

but got stuck when trying to get pgTap Perl dependencies to finish installing (thus why it still has WIP in the name), so stuck with my old configured chain.

But the idea here, was to have something a bit simpler for people to understand than my “build everything from scratch” approach.

 

Just ignore the cmake instructions, and follow the pgSphere instructions for building.

The key thing here, is using pacman (the mingw64 package manager) to install the development tool chain.

 

I have never tried to build pgSphere (except like 15 years ago where I failed miserably for some reason).  But just a warning, at a glance it looks like pgSphere hasn’t been updated in sometime https://github.com/akorotkov/pgsphere (and looks like it might only be set to work only thru PG12).  So it’s quite possible it may need some patches to work with newer PostgreSQL versions.

 

Since it doesn’t appear to have dependencies then you can probably do it with mingw/msys just fine and using the pacman packaged PostgreSQL.

If the version offered by pacman installer doesn’t suit you, compiling PostgreSQL from source is fairly trivial as described here  https://www.cybertec-postgresql.com/en/building-postgresql-with-msys2-and-mingw-under-windows/

 

 

Regardless whatever you build should be compatible with both mingw64 and PostgreSQL 64 Windows EDB as long as you include the libgcc_s_seh-1.dll and libstdc++-6.dll that comes with the mingw64 install and any other dependencies not shipped with PostgreSQL windows EDB.

 

I should also note that the pacman packager in that ships with msys2 mingw64, has pretty much every dependency one would need.  Heck it even has postgis, geos, gdal., but I don’t use those since I tend to name (for example more than one version of PostgreSQL), and I generally need to test out in development geos.

 

Hope that helps,

Regina

 

 

 

From: Gandalf the Gray <pjduplooy.gis at gmail.com <mailto:pjduplooy.gis at gmail.com> > 
Sent: Saturday, November 18, 2023 8:10 AM
To: postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
Subject: Windows compile instructions

 

Hi guys (although I think this is for Regina)

 

Where is the latest compile instructions for Windows located at.

 

I have a PG extension that I would like to try and compile for Windows.  It is PG Sphere.

 

Thanks a whole bunch for any guidance.

 

Pieter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20231119/c260cd8d/attachment.htm>


More information about the postgis-users mailing list