Re: [HACKERS] Compiling extensions on Windows

2014-01-20 Thread Albe Laurenz
Craig Ringer wrote: > Out of personal interest (in pain and suffering) I was recently looking > into how to compile extensions out-of-tree on Windows using Visual > Studio (i.e. no PGXS). > > It looks like the conventional answer to this is "Do a source build of > PG, compile your ext in-tree in c

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Craig Ringer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/13/2014 11:35 AM, Joe Conway wrote: > On 01/12/2014 07:22 PM, Craig Ringer wrote: >> On 01/13/2014 11:13 AM, Joe Conway wrote: What I mean is that >> you should not need a full Pg build tree to compile extensions. >> Just as we use PGXS on *nix,

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Joe Conway
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/12/2014 07:22 PM, Craig Ringer wrote: > On 01/13/2014 11:13 AM, Joe Conway wrote: What I mean is that you > should not need a full Pg build tree to compile extensions. Just as > we use PGXS on *nix, so it is possible to just use Visual Studio to

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Craig Ringer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/13/2014 11:13 AM, Joe Conway wrote: > Yes, that's more-or-less how I do it. I checked with EDB to be sure > I had the same SDK (looks like last time I did it it was SDK 7.1), > then I: > > 1) download postgres source 2) copy plr source into con

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Joe Conway
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/12/2014 06:56 PM, Craig Ringer wrote: > On 01/07/2014 12:41 AM, Joe Conway wrote: >> Yes, this pretty much exactly describes how I build PL/R for >> Windows. I had to match my build system SDK with the one EDB >> uses to get a compatible binary.

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Craig Ringer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/07/2014 12:41 AM, Joe Conway wrote: > Yes, this pretty much exactly describes how I build PL/R for > Windows. I had to match my build system SDK with the one EDB uses > to get a compatible binary. It would be nice if we had something > equivalent

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Craig Ringer
On 01/13/2014 02:04 AM, Tom Lane wrote: > Craig Ringer writes: > >> I think we can just emit a prototype for the function from >> PG_FUNCTION_INFO_V1. > > Doesn't sound like it. On second thought, agreed. The externs tending to appear in headers kills that. In that case - after the rush for th

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Tom Lane
Craig Ringer writes: > Turned out to be trivial to test. If the prototype with PGDLLEXPORT > appears *first*, then all is well. If the prototype with PGDLLEXPORT > appears AFTER a user-provided prototype it fails with: That's sort of what I thought would happen. It's problematic because putting

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Craig Ringer
On 01/12/2014 04:54 PM, Craig Ringer wrote: > On 01/12/2014 12:00 AM, Tom Lane wrote: >> So if it's really necessary to change anything here, I'd rather see us >> take the approach of hiding it in PG_FUNCTION_INFO_V1. What happens >> if we do that and there's also a manually-written prototype? >

Re: [HACKERS] Compiling extensions on Windows

2014-01-12 Thread Craig Ringer
On 01/12/2014 12:00 AM, Tom Lane wrote: > Craig Ringer writes: >> > We don't set __declspec(dllexport) on extension functions automatically >> > when building stand-alone on Windows. So it's necessary to explicitly >> > specify PGDLLEXPORT for each function. > I'm not sure I believe this. I don't

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Andrew Dunstan
On 01/11/2014 01:55 PM, Magnus Hagander wrote: On Sat, Jan 11, 2014 at 7:05 PM, Tom Lane > wrote: Magnus Hagander mailto:mag...@hagander.net>> writes: > On Sat, Jan 11, 2014 at 5:00 PM, Tom Lane mailto:t...@sss.pgh.pa.us>> wrote: >> I'm not sure I beli

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Magnus Hagander
On Sat, Jan 11, 2014 at 7:05 PM, Tom Lane wrote: > Magnus Hagander writes: > > On Sat, Jan 11, 2014 at 5:00 PM, Tom Lane wrote: > >> I'm not sure I believe this. I don't see any PGDLLEXPORT symbols in any > >> of the standard contrib modules; how is it that they work? > > > They are built thro

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Tom Lane
Magnus Hagander writes: > On Sat, Jan 11, 2014 at 5:00 PM, Tom Lane wrote: >> I'm not sure I believe this. I don't see any PGDLLEXPORT symbols in any >> of the standard contrib modules; how is it that they work? > They are built through our perl toolkit, which enables exporting of *all* > symbo

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Magnus Hagander
On Sat, Jan 11, 2014 at 5:00 PM, Tom Lane wrote: > Craig Ringer writes: > > We don't set __declspec(dllexport) on extension functions automatically > > when building stand-alone on Windows. So it's necessary to explicitly > > specify PGDLLEXPORT for each function. > > I'm not sure I believe this

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Tom Lane
Craig Ringer writes: > We don't set __declspec(dllexport) on extension functions automatically > when building stand-alone on Windows. So it's necessary to explicitly > specify PGDLLEXPORT for each function. I'm not sure I believe this. I don't see any PGDLLEXPORT symbols in any of the standard

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Craig Ringer
On 01/06/2014 07:44 PM, Sandeep Thakkar wrote: > Okay. > > BTW, I just checked that Windows 32bit installer ships the libintl.h. > Did you try if it works for you? Or it requires more headers? Somehow, > Windows 64bit installer installer missed it. I'll fix the build script. Actually, on second

Re: [HACKERS] Compiling extensions on Windows

2014-01-11 Thread Craig Ringer
On 01/06/2014 07:44 PM, Sandeep Thakkar wrote: > Okay. > > BTW, I just checked that Windows 32bit installer ships the libintl.h. > Did you try if it works for you? Or it requires more headers? Somehow, > Windows 64bit installer installer missed it. I'll fix the build script. That appears to be t

Re: [HACKERS] Compiling extensions on Windows

2014-01-06 Thread Joe Conway
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/05/2014 07:32 PM, Craig Ringer wrote: > Out of personal interest (in pain and suffering) I was recently > looking into how to compile extensions out-of-tree on Windows using > Visual Studio (i.e. no PGXS). > > It looks like the conventional answ

Re: [HACKERS] Compiling extensions on Windows

2014-01-06 Thread Sandeep Thakkar
Okay. BTW, I just checked that Windows 32bit installer ships the libintl.h. Did you try if it works for you? Or it requires more headers? Somehow, Windows 64bit installer installer missed it. I'll fix the build script. On Mon, Jan 6, 2014 at 4:55 PM, Craig Ringer wrote: > If libintl.h and any

Re: [HACKERS] Compiling extensions on Windows

2014-01-06 Thread Craig Ringer
If libintl.h and any headers it in turn includes are bundled, there is no longer an issue with NLS. That was just a workaround for building exts when Pg's headers tried to refer to nonexistent headers when NLS was enabled. On 6 Jan 2014 18:57, Sandeep Thakkar wrote:Sure. I'll make the changes so

Re: [HACKERS] Compiling extensions on Windows

2014-01-06 Thread Dave Page
On Mon, Jan 6, 2014 at 10:57 AM, Sandeep Thakkar wrote: > Sure. I'll make the changes so that the next available Windows installers > include lbintl.h in $Installdir/include. How about the changes with respect > to NLS? No, there's nothing to change there. Craig was suggesting that users could di

Re: [HACKERS] Compiling extensions on Windows

2014-01-06 Thread Sandeep Thakkar
Sure. I'll make the changes so that the next available Windows installers include lbintl.h in $Installdir/include. How about the changes with respect to NLS? On Mon, Jan 6, 2014 at 2:44 PM, Dave Page wrote: > On Mon, Jan 6, 2014 at 3:32 AM, Craig Ringer > wrote: > > Hi all > > > > Out of perso

Re: [HACKERS] Compiling extensions on Windows

2014-01-06 Thread Dave Page
On Mon, Jan 6, 2014 at 3:32 AM, Craig Ringer wrote: > Hi all > > Out of personal interest (in pain and suffering) I was recently looking > into how to compile extensions out-of-tree on Windows using Visual > Studio (i.e. no PGXS). > > It looks like the conventional answer to this is "Do a source b

Re: [HACKERS] Compiling extensions on Windows

2014-01-05 Thread Andrew Dunstan
On 01/05/2014 10:32 PM, Craig Ringer wrote: Hi all Out of personal interest (in pain and suffering) I was recently looking into how to compile extensions out-of-tree on Windows using Visual Studio (i.e. no PGXS). It looks like the conventional answer to this is "Do a source build of PG, compil

[HACKERS] Compiling extensions on Windows

2014-01-05 Thread Craig Ringer
Hi all Out of personal interest (in pain and suffering) I was recently looking into how to compile extensions out-of-tree on Windows using Visual Studio (i.e. no PGXS). It looks like the conventional answer to this is "Do a source build of PG, compile your ext in-tree in contrib/, and hope the re