[postgis-devel]WKTRaster:WhyhavingtocompilePostgreSQL&PostGISfirst?

Mateusz Loskot Mateusz.Loskot at cadcorp.com
Wed Mar 4 10:34:21 PST 2009


Mark Cave-Ayland wrote:
> Mateusz Loskot wrote:
> 
> > Pierre,
> >
> > I can't agree, unless a few details are clarified: system and
> > building system.
> > There is plenty of variants, even the popular configurations may
> > vary. When it comes to report a problem, it's good to answer basic
> > questions:
> > 1. Is it Unix or Windows?
> > 2. Is it Unix with GNU toolchain (GCC & autotools: Autoconf,
> > Automake, libtool, etc.)?
> > 3. Is it Unix with non-GNU stuff (ie. Solaris and its native
> > compiler)?
> > 4. Is it Windows with native compiler - Microsoft Visual C++?
> > 5. Is it Windows with GNU GCC compiler?
> > 5.1. Is it MinGW or GCC from Cygwin?
> > 6. Is it Windows with yet other compiler?
> >
> > There shouldn't be any need to (re)build PostgreSQL if you use
> > Visual C++.
> > Support (or lack of it) of easy configuration of PostGIS for Visual
> > C++ is a different story.
> 
> Unfortunately there is with PostGIS if you use newer versions of
> PostgreSQL. Since PostgreSQL 8.3 is now compiled with MSVC, there is no
> way to generate the required PGXS Makefiles, and so you must use MingW
> to generate them.


So, how it's possible developers build extensions using Visual C++?
One of example at the bottom of this page:

http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html

> >> 2) That it takes 20 minutes. The setup is very different on Windows.
> >> All this is a Linux thing and you have to do a lot trial and 
> >> error to get
> >> it to work on Windows. Took me three days (and two nights).
> >
> > I won't repeat myself, but MinGW should be banned as it's more a
> > troublemaker than helps.
> 
> I think this is a little harsh;
> the MingW project does struggle due to
> lack of resource, but that is like most open source projects.
> In fact,
> if MingW hadn't been available, it is quite unlikely that the native
> Windows port of PostgreSQL would happened due to the invasiveness of
> the changes required.

It may seem harsh, but in *my* opinion MinGW makes more troubles than helps.
Considering that
a) C/C++ code is portable
b) it can be compiled using Visual C++ and
c) there is building configuration for Visual Studio toolset,
then I can't see any reason why some makefiles couldn't be generated
under Windows without MinGW or cygwin.

All 3 questions have positive answer for PostgreSQL >= 8.3. 

> While I appreciate that MSVC is a powerful environment for Windows
> programmers, I am not aware of any in-built tools that can do the same
> job as autotools.

According to the manual, there is no need for autotools on Windows with PostgreSQL:

"When building, make sure there are no tools from MinGW or Cygwin present in your system"

Except the PGXS, but here again, it's really strange why there is lack of a few scripts for Windows.
However, PostgreSQL team says it clearly that PGXS building is not configured to be portable.
 
Best regards,
--
Mateusz Loskot
Senior Programmer, Cadcorp
http://www.cadcorp.com



> CMake could be a promising start, but until PostgreSQL
> makes use of it then we are stuck anyway because the MSVC-build doesn't
> generate the required PGXS Makefiles.






More information about the postgis-devel mailing list