Re: Problems using pgxs on Win32

Lists: pgsql-hackerspgsql-patches
From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Problems using pgxs on Win32
Date: 2004-10-30 16:03:56
Message-ID: cm0e1c$u03$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

I'm trying to change the Makefile system for PL/Java so that it uses
PGXS instead of compiling using a complete PostgreSQL source tree. As it
turns out, the directory "include/port/win32" is not present in the
PostgreSQL binary installation. Without it, it's not possible to compile
on win32.

Do I need some special configuration in order to get the missing pieces?

Regards,
Thomas Hallgren


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems using pgxs on Win32
Date: 2004-11-01 08:42:57
Message-ID: Pine.LNX.4.61.0411011030340.17116@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Dear Thomas,

> I'm trying to change the Makefile system for PL/Java so that it uses PGXS
> instead of compiling using a complete PostgreSQL source tree. As it turns
> out, the directory "include/port/win32" is not present in the PostgreSQL
> binary installation. Without it, it's not possible to compile on win32.

Indeed, this directory is not installed by the "install" target.

If it is really needed, it is no big deal. However if done so, it should
be under "include/server/port/win32/", not "include/port/win32", but this
should be taken care of by some macro, I guess.

> Do I need some special configuration in order to get the missing pieces?

I guess you're the first one ever to test this under win32;-)

You can try to copy by hand the directory into include/server/port/ of
your installation, and check whether it is the only issue.

Have a nice day,

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr


From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Problems using pgxs on Win32
Date: 2004-11-01 11:07:33
Message-ID: thhal-0mrFhAknk3kA5aAHi9b3giY/sUqmDo5@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Fabien,
There's quite a few issues. Here's what I had to do in order to get my
stuff working. I don't think it's any use for me to submit changes in
form of a patch at this point since pgxs seems to be a bit on the
drawing table still. I started another thread that was not win32 related
also with the subject "Problems with pgxs" that I relate to here as well.

>>... the directory "include/port/win32" is not present in the PostgreSQL
>>binary installation. Without it, it's not possible to compile on win32.
>
> Indeed, this directory is not installed by the "install" target.
>
> If it is really needed, it is no big deal.

It's needed alright. It contains files included from c.h which in turn
is included from postgres.h.

> However if done so, it should
> be under "include/server/port/win32/", not "include/port/win32", but this
> should be taken care of by some macro, I guess.
>
Yes, a special macro is needed for this, I made a change in
Makefile.global (around line 176), like so:

ifdef PGXS
override CPPFLAGS := -I$(includedir_server)
-I$(includedir_server)/port/win32 -I$(includedir_internal) $(CPPFLAGS)
else # not PGXS
...

> You can try to copy by hand the directory into include/server/port/ of
> your installation, and check whether it is the only issue.
>
Next problem is that the all-lib target is wrong (see other thread). I
can get around that by changing my local makefile and instead of the
recommended:

all: all-lib

use:

all: $(shlib)

Final issue is BE_DLLLIBS in Makefile.port. It's defined as:

BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres

The src/backend is of course not present but what's worse, the
libpostgres.a library is not included in the install. I copied it from
src/backend into the <prefix>/lib directory and changed the
Makefile.port to read:

ifdef PGXS
BE_DLLLIBS= -lpostgres
else
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
endif

and everything build OK.

Regards,
Thomas Hallgren


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Problems using pgxs on Win32
Date: 2004-11-01 11:29:03
Message-ID: Pine.LNX.4.61.0411011313290.1285@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Dear Thomas,

> There's quite a few issues. Here's what I had to do in order to get my stuff
> working. I don't think it's any use for me to submit changes in form of a
> patch at this point since pgxs seems to be a bit on the drawing table still.

Well, it is supposed to work;-)

"pgxs" is just a reworking of the previous compilation infrastructure for
contribs so that it can be used outside of the main tree. So I don't feel
responsible for the actual dependency rules (say, whether all-lib make
sense), but I do feel responsible for the missing files, and the fixes
needed to adapt the infrastructure to the installation tree vs the source
tree.

> I started another thread that was not win32 related also with the
> subject "Problems with pgxs" that I relate to here as well.

Yep, I noticed.

> Yes, a special macro is needed for this, I made a change in Makefile.global
> (around line 176), like so:
>
> ifdef PGXS
> override CPPFLAGS := -I$(includedir_server)
> -I$(includedir_server)/port/win32 -I$(includedir_internal) $(CPPFLAGS)
> else # not PGXS
> ...

Why can't you #include "port/win32/some_file.h" which would (I think)
avoid the issue without adding a win32 specific -I to all architectures??
I'm not sure I'm happy if I see a win32 path when compiling under some
unix.

> Final issue is BE_DLLLIBS in Makefile.port. It's defined as:
>
> BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres

Argh.

> The src/backend is of course not present but what's worse, the libpostgres.a
> library is not included in the install. I copied it from src/backend into the
> <prefix>/lib directory and changed the Makefile.port to read:

It looks like another missing file.

It could be also installed into lib/pgxs/src/backend so that the previous
definition works, but If it is possible to install it in lib (that is
maintainers agreee about it), then it looks better.

I'll try to submit a patch this week.

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr


From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Problems using pgxs on Win32
Date: 2004-11-01 12:40:12
Message-ID: thhal-0MsdhAgfl3kA18LwuLmewICYJy4hxJ8@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Fabien,
>> ifdef PGXS
>> override CPPFLAGS := -I$(includedir_server)
>>-I$(includedir_server)/port/win32 -I$(includedir_internal) $(CPPFLAGS)
>> else # not PGXS
>> ...
>
>
> Why can't you #include "port/win32/some_file.h" which would (I think)
> avoid the issue without adding a win32 specific -I to all architectures??
> I'm not sure I'm happy if I see a win32 path when compiling under some
> unix.
>
I'm not sure I understand. I'm not the one including the missing files.
They are included when I include postgres.h.

Regards,
Thomas Hallgren


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems using pgxs on Win32
Date: 2004-11-02 07:26:16
Message-ID: Pine.LNX.4.61.0411020816530.13443@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Dear Thomas,

>>> ifdef PGXS
>>> override CPPFLAGS := -I$(includedir_server)
>>> -I$(includedir_server)/port/win32 -I$(includedir_internal) $(CPPFLAGS)
>>> else # not PGXS
>>
>> Why can't you #include "port/win32/some_file.h" which would (I think)
>> avoid the issue without adding a win32 specific -I to all architectures??
>> I'm not sure I'm happy if I see a win32 path when compiling under some
>> unix.
>>
> I'm not sure I understand. I'm not the one including the missing files. They
> are included when I include postgres.h.

Ok.

It seems that this directory provides fake header files to replace "unix"
system headers. Hence ISTM that no one wants this -I on any other
platform, so the possible inclusion must be added under some condition,
not just ifdef PGXS.

I'm wondering how it works within the source tree. I guess the
Makefile.port must/should take care of this issue, and maybe it is broken
under pgxs? I'll look into that, but I cannot test anything:-(

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: pgxs under Win32 for PL/Java
Date: 2004-11-07 10:28:52
Message-ID: Pine.GSO.4.58.0411071121220.20318@chailly99
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Dear Thomas,

> I'm trying to change the Makefile system for PL/Java so that it uses
> PGXS instead of compiling using a complete PostgreSQL source tree. As it
> turns out, the directory "include/port/win32" is not present in the
> PostgreSQL binary installation. Without it, it's not possible to compile
> on win32.

Please find enclosed a patch which attempts to fix your use of pgxs under
win32:
- install port/* includes
- install libpostgres.a by default (it seems to require MAKE_DLL=true)
- fix include path under win32 portname

The specific win32 fixes are performed in the Makefile.win32 file.

I have no mean to test that on a win32 machine. Could you do it?

I'm wondering whether the MAKE_DLL fix should also be done under cygwin.
Any opinion?

Thanks in advance,

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr

Attachment Content-Type Size
make-win32.patch text/plain 1.3 KB

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pgxs under Win32 for PL/Java
Date: 2004-11-07 10:50:59
Message-ID: thhal-0iJZpAvNI30Ax3pY+mZkncpJdexENxC@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Fabien COELHO wrote:

>I have no mean to test that on a win32 machine. Could you do it?
>
>
>
Sure, I'll test it sometime tomorrow or the day after. I'll get back to you.

>I'm wondering whether the MAKE_DLL fix should also be done under cygwin.
>Any opinion?
>
>
I can test cygwin too. But just out of curiosity; why would anyone want
to use cygwin with 8.0?

Regards,
Thomas Hallgren


From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pgxs under Win32 for PL/Java
Date: 2004-11-07 10:50:59
Message-ID: thhal-0iJZpAvFI30Asm7d12xRe635MPS1eNt@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Fabien COELHO wrote:

>I have no mean to test that on a win32 machine. Could you do it?
>
>
>
Sure, I'll test it sometime tomorrow or the day after. I'll get back to you.

>I'm wondering whether the MAKE_DLL fix should also be done under cygwin.
>Any opinion?
>
>
I can test cygwin too. But just out of curiosity; why would anyone want
to use cygwin with 8.0?

Regards,
Thomas Hallgren


From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgxs under Win32 for PL/Java
Date: 2004-11-07 16:50:07
Message-ID: thhal-05OppAj9K30APwCodk1ZM/1fNnj4kwS@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Fabien,
Seems you forgot to put a "-I" before the include directive in
src/makefiles/Makefile.win32, i.e. change:

override CPPFLAGS+= $(includedir_server)/port/win32

to:

override CPPFLAGS+= -I$(includedir_server)/port/win32

but in other respects, the patch seems to work fine on win32. I'll test
Cygwin next.

Regards,
Thomas Hallgren


From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgxs under Win32 for PL/Java
Date: 2004-11-07 18:33:32
Message-ID: thhal-09QJqAj1L30A2N+V5jOdIZNcNdlg65B@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Fabien,
The problem described in the recent thread "cygwin build failure"
prevents me from building on Cygwin at present. I'll await a patch for that.

Regards,
Thomas Hallgren


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgxs under Win32 for PL/Java
Date: 2004-11-08 07:15:57
Message-ID: Pine.LNX.4.61.0411080814400.4884@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> Seems you forgot to put a "-I" before the include directive in
> src/makefiles/Makefile.win32, i.e. change:

Indeed.

> but in other respects, the patch seems to work fine on win32.
> I'll test Cygwin next.

Ok. Thanks for your test and debug.

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Thomas Hallgren <thhal(at)mailblocks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems using pgxs on Win32
Date: 2004-11-28 03:32:53
Message-ID: 200411280332.iAS3Wrp10509@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


I assume all the pgxs changes have been applied by Tom.

---------------------------------------------------------------------------

Fabien COELHO wrote:
>
> Dear Thomas,
>
> > I'm trying to change the Makefile system for PL/Java so that it uses PGXS
> > instead of compiling using a complete PostgreSQL source tree. As it turns
> > out, the directory "include/port/win32" is not present in the PostgreSQL
> > binary installation. Without it, it's not possible to compile on win32.
>
> Indeed, this directory is not installed by the "install" target.
>
> If it is really needed, it is no big deal. However if done so, it should
> be under "include/server/port/win32/", not "include/port/win32", but this
> should be taken care of by some macro, I guess.
>
> > Do I need some special configuration in order to get the missing pieces?
>
> I guess you're the first one ever to test this under win32;-)
>
> You can try to copy by hand the directory into include/server/port/ of
> your installation, and check whether it is the only issue.
>
> Have a nice day,
>
> --
> Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073