[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Windows compile instructions
From:       Regina Obe via postgis-users <postgis-users () lists ! osgeo ! org>
Date:       2023-11-20 2:28:16
Message-ID: 000101da1b59$385fe960$a91fbc20$ () pcorp ! us
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.


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@gmail.com> 
Sent: Sunday, November 19, 2023 9:53 AM
To: Regina Obe <lr@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@pcorp.us <mailto:lr@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@gmail.com <mailto:pjduplooy.gis@gmail.com> > 
Sent: Saturday, November 18, 2023 8:10 AM
To: postgis-devel@lists.osgeo.org <mailto:postgis-devel@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


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:x="urn:schemas-microsoft-com:office:excel" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple \
style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Cool and I \
see they had a release 5 days ago.   A quick attempt at compile I wasn't successful \
even using the <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal>make USE_HEALPIX=0<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I get error:<o:p></o:p></p><p \
class=MsoNormal>In file included from src/sparse.c:136:<o:p></o:p></p><p \
class=MsoNormal>src/sparse.h:69:5: error: 'INT' redeclared as different kind of \
symbol<o:p></o:p></p><p class=MsoNormal>     69 |         INT = 270,                  \
/* INT   */<o:p></o:p></p><p class=MsoNormal>           |         \
^~~<o:p></o:p></p><p class=MsoNormal>In file included from \
C:/ming64/mingw64/include/minwindef.h:163,<o:p></o:p></p><p class=MsoNormal>          \
from C:/ming64/mingw64/include/windef.h:9,<o:p></o:p></p><p class=MsoNormal>          \
from C:/ming64/mingw64/include/windows.h:69,<o:p></o:p></p><p class=MsoNormal>        \
from C:/ming64/mingw64/include/winsock2.h:23,<o:p></o:p></p><p class=MsoNormal>       \
from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port/win32_port.h:60,<o:p></o:p></p><p \
class=MsoNormal>                                 from \
C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port.h:24,<o:p></o:p></p><p \
class=MsoNormal>                                 from \
C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/c.h:1375,<o:p></o:p></p><p \
class=MsoNormal>                                 from \
C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/postgres.h:45,<o:p></o:p></p><p \
class=MsoNormal>                                 from \
src/sparse.y:4:<o:p></o:p></p><p \
class=MsoNormal>C:/ming64/mingw64/include/winnt.h:299:15: note: previous declaration \
of 'INT' with type 'INT' {aka 'int'}<o:p></o:p></p><p class=MsoNormal>   299 |     \
typedef int INT;<o:p></o:p></p><p class=MsoNormal>           |                        \
^~~<o:p></o:p></p><p class=MsoNormal>src/sparse.h:70:5: error: 'FLOAT' redeclared as \
different kind of symbol<o:p></o:p></p><p class=MsoNormal>     70 |         FLOAT = \
271,                                     /* FLOAT   */<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal>I didn't look too deeply to see how to fix the issue, or if it's just \
something about my setup. <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal>Normally these kinds of issues need some conditional handling for \
mingw64 and/or windows.   PostGIS has a couple of special handlings.<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>If you have any luck let me \
know.   I plan to take a look at it later either way.<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>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 -&gt; Spatial \
Extensions.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Regina<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><div style='border:none;border-left:solid blue \
1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid \
#E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Gandalf the \
Gray &lt;pjduplooy.gis@gmail.com&gt; <br><b>Sent:</b> Sunday, November 19, 2023 9:53 \
AM<br><b>To:</b> Regina Obe &lt;lr@pcorp.us&gt;<br><b>Subject:</b> Re: Windows \
compile instructions<o:p></o:p></p></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=MsoNormal>Hi \
Regina<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p \
class=MsoNormal>There is actually a newer repository:<o:p></o:p></p></div><div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><a \
href="https://github.com/postgrespro/pgsphere">https://github.com/postgrespro/pgsphere</a><o:p></o:p></p></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=MsoNormal>On Sat, Nov 18, \
2023 at 7:05 PM Regina Obe &lt;<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>&gt; \
wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC \
1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Gandalf,<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I had \
written these instructions not too long ago for building pgRouting under msys/mingw, \
<a href="https://github.com/pgRouting/pgrouting/wiki/Building-on-windows-with-msys2-and-mingw64-(WIP)" \
target="_blank">https://github.com/pgRouting/pgrouting/wiki/Building-on-windows-with-msys2-and-mingw64-(WIP)</a><o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>But the \
idea here, was to have something a bit simpler for people to understand than my \
"build everything from scratch" approach.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Just \
ignore the cmake instructions, and follow the pgSphere instructions for \
building.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The key thing here, is \
using pacman (the mingw64 package manager) to install the development tool \
chain.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have \
never tried to build pgSphere (except like 15 years ago where I failed miserably for \
some reason).&nbsp; But just a warning, at a glance it looks like pgSphere hasn't \
been updated in sometime <a href="https://github.com/akorotkov/pgsphere" \
target="_blank">https://github.com/akorotkov/pgsphere</a> (and looks like it might \
only be set to work only thru PG12).&nbsp; So it's quite possible it may need some \
patches to work with newer PostgreSQL versions.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>If the version offered by \
pacman installer doesn't suit you, compiling PostgreSQL from source is fairly trivial \
as described here&nbsp; <a \
href="https://www.cybertec-postgresql.com/en/building-postgresql-with-msys2-and-mingw-under-windows/" \
target="_blank">https://www.cybertec-postgresql.com/en/building-postgresql-with-msys2-and-mingw-under-windows/</a><o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I should \
also note that the pacman packager in that ships with msys2 mingw64, has pretty much \
every dependency one would need.&nbsp; 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.<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hope that \
helps,<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regina<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><div \
style='border:none;border-left:solid windowtext 1.5pt;padding:0in 0in 0in \
4.0pt;border-color:currentcolor currentcolor currentcolor blue'><div><div \
style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in \
0in;border-color:currentcolor currentcolor'><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From:</b> Gandalf the \
Gray &lt;<a href="mailto:pjduplooy.gis@gmail.com" \
target="_blank">pjduplooy.gis@gmail.com</a>&gt; <br><b>Sent:</b> Saturday, November \
18, 2023 8:10 AM<br><b>To:</b> <a href="mailto:postgis-devel@lists.osgeo.org" \
target="_blank">postgis-devel@lists.osgeo.org</a><br><b>Subject:</b> Windows compile \
instructions<o:p></o:p></p></div></div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi guys \
(although I think this is for Regina)<o:p></o:p></p></div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Where is \
the latest compile instructions for Windows located at.<o:p></o:p></p></div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have a \
PG extension that I would like to try and compile for Windows.&nbsp; It is PG \
Sphere.<o:p></o:p></p></div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks a \
whole bunch for any guidance.<o:p></o:p></p></div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Pieter<o:p> \
</o:p></p></div></div></div></div></div></div></blockquote></div></div></div></body></html>




_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic