pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JIT on Windows with Postgres 12.1
10+ messages / 7 participants
[nested] [flat]

* JIT on Windows with Postgres 12.1
@ 2020-02-11 16:32  Catch All <catchall@lightn.org>
  0 siblings, 1 reply; 10+ messages in thread

From: Catch All @ 2020-02-11 16:32 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

I am using the EDB Windows PG 12.1 installer and it seems not to have JIT
enabled:
C:\Program Files\PostgreSQL\12\bin>pg_config --configure
--enable-thread-safety --enable-nls --with-ldap --with-openssl
--with-ossp-uuid
--with-libxml --with-libxslt --with-icu --with-tcl --with-perl --with-python

Is this expected?  Is there a Windows installer available for PG 12 with
JIT enabled?

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-12 08:39  Josef Šimánek <josef.simanek@gmail.com>
  parent: Catch All <catchall@lightn.org>
  0 siblings, 1 reply; 10+ messages in thread

From: Josef Šimánek @ 2020-02-12 08:39 UTC (permalink / raw)
  To: Catch All <catchall@lightn.org>; +Cc: pgsql-general@lists.postgresql.org

Hello.

If I understand it well, JIT is enabled only for builds with "--with-llvm"
flag. Seems EDB Windows PG 12.1 installer is not build with llvm (and jit)
support.

I'm not aware of any PG 12 Windows installer with JIT/LLVM enabled.

út 11. 2. 2020 v 22:41 odesílatel Catch All <catchall@lightn.org> napsal:

> I am using the EDB Windows PG 12.1 installer and it seems not to have JIT
> enabled:
> C:\Program Files\PostgreSQL\12\bin>pg_config --configure
> --enable-thread-safety --enable-nls --with-ldap --with-openssl
> --with-ossp-uuid
> --with-libxml --with-libxslt --with-icu --with-tcl --with-perl
> --with-python
>
> Is this expected?  Is there a Windows installer available for PG 12 with
> JIT enabled?
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-12 19:42  Andres Freund <andres@anarazel.de>
  parent: Josef Šimánek <josef.simanek@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Andres Freund @ 2020-02-12 19:42 UTC (permalink / raw)
  To: Josef Šimánek <josef.simanek@gmail.com>; +Cc: Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org

Hi,

On 2020-02-12 09:39:19 +0100, Josef Šimánek wrote:
> I'm not aware of any PG 12 Windows installer with JIT/LLVM enabled.

It's not currently supported by the windows buildsystem. I don't
personally have the expertise to change that (I've not worked on windows
after ~2003). So somebody would have to step in to make that work,
first.

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-12 19:54  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 2 replies; 10+ messages in thread

From: Tom Lane @ 2020-02-12 19:54 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org

Andres Freund <andres@anarazel.de> writes:
> On 2020-02-12 09:39:19 +0100, Josef Šimánek wrote:
>> I'm not aware of any PG 12 Windows installer with JIT/LLVM enabled.

> It's not currently supported by the windows buildsystem. I don't
> personally have the expertise to change that (I've not worked on windows
> after ~2003). So somebody would have to step in to make that work,
> first.

First you would need either a Windows-native LLVM, or a JIT provider
based on Microsoft's compiler.  I don't know if the former exists
(it would not be our job to create it).  I'm not sure if the latter
is possible, but for sure it'd be a large task if it is possible.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-12 20:01  Justin <zzzzz.graf@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 10+ messages in thread

From: Justin @ 2020-02-12 20:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

Here is a link to build  LLVM on windows

http://llvm.org/docs/GettingStartedVS.html

On Wed, Feb 12, 2020 at 2:55 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Andres Freund <andres@anarazel.de> writes:
> > On 2020-02-12 09:39:19 +0100, Josef Šimánek wrote:
> >> I'm not aware of any PG 12 Windows installer with JIT/LLVM enabled.
>
> > It's not currently supported by the windows buildsystem. I don't
> > personally have the expertise to change that (I've not worked on windows
> > after ~2003). So somebody would have to step in to make that work,
> > first.
>
> First you would need either a Windows-native LLVM, or a JIT provider
> based on Microsoft's compiler.  I don't know if the former exists
> (it would not be our job to create it).  I'm not sure if the latter
> is possible, but for sure it'd be a large task if it is possible.
>
>                         regards, tom lane
>
>
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-12 20:05  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 10+ messages in thread

From: Andres Freund @ 2020-02-12 20:05 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org

Hi,

On 2020-02-12 14:54:56 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2020-02-12 09:39:19 +0100, Josef Šimánek wrote:
> >> I'm not aware of any PG 12 Windows installer with JIT/LLVM enabled.
> 
> > It's not currently supported by the windows buildsystem. I don't
> > personally have the expertise to change that (I've not worked on windows
> > after ~2003). So somebody would have to step in to make that work,
> > first.
> 
> First you would need either a Windows-native LLVM, or a JIT provider
> based on Microsoft's compiler.  I don't know if the former exists
> (it would not be our job to create it).

Yes, LLVM would work on windows. I'd not even be surprised if one could
make it work on windows already when using a mingw based build, instead
of msvc.


> I'm not sure if the latter is possible, but for sure it'd be a large
> task if it is possible.

Yea, it'd be a lot of work to add a second provider. No iea if there's
any support for it around visual studio - but I also see no point going
there.

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-13 03:25  Michael Paquier <michael@paquier.xyz>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 10+ messages in thread

From: Michael Paquier @ 2020-02-13 03:25 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org

On Wed, Feb 12, 2020 at 12:05:11PM -0800, Andres Freund wrote:
> Yes, LLVM would work on windows. I'd not even be surprised if one could
> make it work on windows already when using a mingw based build, instead
> of msvc.

For MSVC, assuming that you have the proper dependencies for JIT
compilation and LLVM available, and just for the reference if anybody
is interesting in making that happen (Tom and Andres are aware of that
already), one would need to do roughly an update of src/tools/msvc/ to
add a new option path to LLVM, and update install-windows.sgml to add
the new optional dependency.  Note that including LLVM in the builds
means adding conditionally the files part of src/backend/jit/llvm/,
but one can take for example OpenSSL as a model of how it happens.
That would take care of the build.  There may be some
Windows-dependent stuff needed to make JIT work properly on Windows
though.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-13 03:32  Andres Freund <andres@anarazel.de>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 10+ messages in thread

From: Andres Freund @ 2020-02-13 03:32 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org

Hi,

On 2020-02-13 12:25:40 +0900, Michael Paquier wrote:
> On Wed, Feb 12, 2020 at 12:05:11PM -0800, Andres Freund wrote:
> > Yes, LLVM would work on windows. I'd not even be surprised if one could
> > make it work on windows already when using a mingw based build, instead
> > of msvc.
> 
> For MSVC, assuming that you have the proper dependencies for JIT
> compilation and LLVM available, and just for the reference if anybody
> is interesting in making that happen (Tom and Andres are aware of that
> already), one would need to do roughly an update of src/tools/msvc/ to
> add a new option path to LLVM, and update install-windows.sgml to add
> the new optional dependency.  Note that including LLVM in the builds
> means adding conditionally the files part of src/backend/jit/llvm/,
> but one can take for example OpenSSL as a model of how it happens.
> That would take care of the build.

That's not really the hard part. That's integrating the generation of
LLVM bitcode files into the buildsystem. As the absolute minimum
llvmjit_types.bc needs to be generated, but to be meaningfully supported
we'd need to generate all the .bc files we're generating on make based
builds.

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2020-02-13 03:49  Michael Paquier <michael@paquier.xyz>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 10+ messages in thread

From: Michael Paquier @ 2020-02-13 03:49 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org

On Wed, Feb 12, 2020 at 07:32:08PM -0800, Andres Freund wrote:
> That's not really the hard part. That's integrating the generation of
> LLVM bitcode files into the buildsystem. As the absolute minimum
> llvmjit_types.bc needs to be generated, but to be meaningfully supported
> we'd need to generate all the .bc files we're generating on make based
> builds.

Oh, I see.  That's indeed...  Not straight-forward.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: JIT on Windows with Postgres 12.1
@ 2021-01-30 11:20  109 ktke <yuuki109gn@gmail.com>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 10+ messages in thread

From: 109 ktke @ 2021-01-30 11:20 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Josef Šimánek <josef.simanek@gmail.com>; Catch All <catchall@lightn.org>; pgsql-general@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

On Wed, Feb 12, 2020 at 12:05:11PM -0800, Andres Freund wrote:
> Yes, LLVM would work on windows. I'd not even be surprised if one could
> make it work on windows already when using a mingw based build, instead
> of msvc.
In my mingw environment, postgresql build with option "--with-llvm"
failed with the follwing message. Is it difficult to make PostgreSQL
JIT work on windows using mingw?

--Message1
/mingw64/bin/clang -Wno-ignored-attributes -fno-strict-aliasing
-fwrapv -O2  -I../../../../src/include  -I./src/include/port/win32
"-I../../../../src/include/port/win32" -DWIN32_STACK_RLIMIT=4194304
-DBUILDING_DLL -flto=thin -emit-llvm -c -o latch.bc latch.c
latch.c:680:19: error: static_assert expression is not an integral
constant expression
        StaticAssertStmt(WSA_INVALID_EVENT == NULL, "");
        ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--

--Message2(When commenting latch.c:680 out)
llvmjit_inline.cpp:32:10: fatal error: sys/mman.h: No such file or directory
   32 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.
--

--Environment
PostgreSQL:postgresql13.0
Windows:Windows10
MSYS2 packages:mingw-w64-x86_64-gcc base-devel
mingw-w64-x86_64-llvm(llvm11 installed) mingw-w64-x86_64-clang(clang11
installed)
--

--
Yuuki Fujii





^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2021-01-30 11:20 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 16:32 JIT on Windows with Postgres 12.1 Catch All <catchall@lightn.org>
2020-02-12 08:39 ` Josef Šimánek <josef.simanek@gmail.com>
2020-02-12 19:42   ` Andres Freund <andres@anarazel.de>
2020-02-12 19:54     ` Tom Lane <tgl@sss.pgh.pa.us>
2020-02-12 20:01       ` Justin <zzzzz.graf@gmail.com>
2020-02-12 20:05       ` Andres Freund <andres@anarazel.de>
2020-02-13 03:25         ` Michael Paquier <michael@paquier.xyz>
2020-02-13 03:32           ` Andres Freund <andres@anarazel.de>
2020-02-13 03:49             ` Michael Paquier <michael@paquier.xyz>
2021-01-30 11:20               ` 109 ktke <yuuki109gn@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox