pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
To JIT (or not!) in Ubuntu packages
4+ messages / 2 participants
[nested] [flat]

* To JIT (or not!) in Ubuntu packages
@ 2021-09-13 22:10  Ben Chobot <bench@silentmedia.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Ben Chobot @ 2021-09-13 22:10 UTC (permalink / raw)
  To: pgsql-general

We've noticed that the Ubuntu postgresql-12 package has --with-llvm 
enabled on x86_64, but not on aarch64. Does anybody know if this was 
intentional, or just an oversight?

For what it's worth, it seems the beta postgresql-14 package for Ubuntu 
still doesn't have --with-llvm.

I'm not sure if this explains why our aarch64 DBs are missing a 
jit_provider GUC variable, but I expect it does explain why 
pg_jit_available() tells me no.





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

* Re: To JIT (or not!) in Ubuntu packages
@ 2021-09-15 00:50  Thomas Munro <thomas.munro@gmail.com>
  parent: Ben Chobot <bench@silentmedia.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Thomas Munro @ 2021-09-15 00:50 UTC (permalink / raw)
  To: Ben Chobot <bench@silentmedia.com>; +Cc: pgsql-general; Christoph Berg <myon@debian.org>

On Tue, Sep 14, 2021 at 10:11 AM Ben Chobot <bench@silentmedia.com> wrote:
> We've noticed that the Ubuntu postgresql-12 package has --with-llvm
> enabled on x86_64, but not on aarch64. Does anybody know if this was
> intentional, or just an oversight?
>
> For what it's worth, it seems the beta postgresql-14 package for Ubuntu
> still doesn't have --with-llvm.
>
> I'm not sure if this explains why our aarch64 DBs are missing a
> jit_provider GUC variable, but I expect it does explain why
> pg_jit_available() tells me no.

Hmm.  No Ubuntu here and I don't know the answer (CC Christoph).  Can
you show exactly where the package is coming from, what pg_config
outputs.  For what it's worth, it does look like it's enabled in the
Ubuntu aarch64 packages from apt.postgresql.org, according to a quick
look using caveman techniques:

$ curl -sO http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg+1_arm6...
$ ar x postgresql-14_14~beta3-1.pgdg+1_arm64.deb
$ tar xf data.tar.xz
$ strings usr/lib/postgresql/14/bin/postgres | grep 'with-llvm'
 '--build=aarch64-linux-gnu' '--prefix=/usr'
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' '--sysconfdir=/etc'
'--localstatedir=/var' '--disable-option-checking'
'--disable-silent-rules' '--libdir=${prefix}/lib/aarch64-linux-gnu'
'--runstatedir=/run' '--disable-maintainer-mode'
'--disable-dependency-tracking' '--with-icu' '--with-tcl'
'--with-perl' '--with-python' '--with-pam' '--with-openssl'
'--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3'
'--mandir=/usr/share/postgresql/14/man'
'--docdir=/usr/share/doc/postgresql-doc-14'
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/'
'--datadir=/usr/share/postgresql/14'
'--bindir=/usr/lib/postgresql/14/bin'
'--libdir=/usr/lib/aarch64-linux-gnu/'
'--libexecdir=/usr/lib/postgresql/'
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Debian
14~beta3-1.pgdg+1)' '--enable-nls' '--enable-thread-safety'
'--enable-tap-tests' '--enable-debug' '--enable-dtrace'
'--enable-cassert' '--disable-rpath' '--with-uuid=e2fs'
'--with-gnu-ld' '--with-lz4' '--with-pgport=5432'
'--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm'
'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11'
'--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p'
'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet'
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
-Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now'
'--with-gssapi' '--with-ldap' 'build_alias=aarch64-linux-gnu'
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2
-fstack-protector-strong -Wformat -Werror=format-security'
$ find . -name '*jit*.so'
./usr/lib/postgresql/14/lib/llvmjit.so

It's certainly expected to work on this arch, and we have snakefly and
eelpout testing it in the build farm.





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

* Re: To JIT (or not!) in Ubuntu packages
@ 2021-09-15 03:30  Ben Chobot <bench@silentmedia.com>
  parent: Thomas Munro <thomas.munro@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Ben Chobot @ 2021-09-15 03:30 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@gmail.com>; +Cc: pgsql-general; Christoph Berg <myon@debian.org>



Thomas Munro wrote on 9/14/21 5:50 PM:
> On Tue, Sep 14, 2021 at 10:11 AM Ben Chobot <bench@silentmedia.com> wrote:
>> We've noticed that the Ubuntu postgresql-12 package has --with-llvm
>> enabled on x86_64, but not on aarch64. Does anybody know if this was
>> intentional, or just an oversight?
>>
>> For what it's worth, it seems the beta postgresql-14 package for Ubuntu
>> still doesn't have --with-llvm.
>>
>> I'm not sure if this explains why our aarch64 DBs are missing a
>> jit_provider GUC variable, but I expect it does explain why
>> pg_jit_available() tells me no.
> Hmm.  No Ubuntu here and I don't know the answer (CC Christoph).  Can
> you show exactly where the package is coming from, what pg_config
> outputs.  For what it's worth, it does look like it's enabled in the
> Ubuntu aarch64 packages from apt.postgresql.org, according to a quick
> look using caveman techniques:
>
> $ curl -sO http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg+1_arm6...
> $ ar x postgresql-14_14~beta3-1.pgdg+1_arm64.deb
> $ tar xf data.tar.xz
> $ strings usr/lib/postgresql/14/bin/postgres | grep 'with-llvm'
>   '--build=aarch64-linux-gnu' '--prefix=/usr'
> '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
> '--infodir=${prefix}/share/info' '--sysconfdir=/etc'
> '--localstatedir=/var' '--disable-option-checking'
> '--disable-silent-rules' '--libdir=${prefix}/lib/aarch64-linux-gnu'
> '--runstatedir=/run' '--disable-maintainer-mode'
> '--disable-dependency-tracking' '--with-icu' '--with-tcl'
> '--with-perl' '--with-python' '--with-pam' '--with-openssl'
> '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3'
> '--mandir=/usr/share/postgresql/14/man'
> '--docdir=/usr/share/doc/postgresql-doc-14'
> '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/'
> '--datadir=/usr/share/postgresql/14'
> '--bindir=/usr/lib/postgresql/14/bin'
> '--libdir=/usr/lib/aarch64-linux-gnu/'
> '--libexecdir=/usr/lib/postgresql/'
> '--includedir=/usr/include/postgresql/' '--with-extra-version= (Debian
> 14~beta3-1.pgdg+1)' '--enable-nls' '--enable-thread-safety'
> '--enable-tap-tests' '--enable-debug' '--enable-dtrace'
> '--enable-cassert' '--disable-rpath' '--with-uuid=e2fs'
> '--with-gnu-ld' '--with-lz4' '--with-pgport=5432'
> '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm'
> 'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11'
> '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p'
> 'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet'
> 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
> -Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now'
> '--with-gssapi' '--with-ldap' 'build_alias=aarch64-linux-gnu'
> 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2
> -fstack-protector-strong -Wformat -Werror=format-security'
> $ find . -name '*jit*.so'
> ./usr/lib/postgresql/14/lib/llvmjit.so
Ohh, interesting, I don't have that .so file.

So I've installed 
http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg18.04+1..., 
after which I see:

$ /usr/lib/postgresql/14/bin/pg_config
BINDIR = /usr/lib/postgresql/14/bin
DOCDIR = /usr/share/doc/postgresql-doc-14
HTMLDIR = /usr/share/doc/postgresql-doc-14
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/14/server
LIBDIR = /usr/lib/aarch64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/14/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/14/man
SHAREDIR = /usr/share/postgresql/14
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/14/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--build=aarch64-linux-gnu' '--prefix=/usr' 
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man' 
'--infodir=${prefix}/share/info' '--sysconfdir=/etc' 
'--localstatedir=/var' '--disable-silent-rules' 
'--libdir=${prefix}/lib/aarch64-linux-gnu' 
'--libexecdir=${prefix}/lib/aarch64-linux-gnu' '--runstatedir=/run' 
'--disable-maintainer-mode' '--disable-dependency-tracking' '--with-icu' 
'--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' 
'--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' 
'--mandir=/usr/share/postgresql/14/man' 
'--docdir=/usr/share/doc/postgresql-doc-14' 
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' 
'--datadir=/usr/share/postgresql/14' 
'--bindir=/usr/lib/postgresql/14/bin' 
'--libdir=/usr/lib/aarch64-linux-gnu/' 
'--libexecdir=/usr/lib/postgresql/' 
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 
14~beta2-1.pgdg18.04+1)' '--enable-nls' '--enable-thread-safety' 
'--enable-tap-tests' '--enable-debug' '--enable-dtrace' 
'--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-lz4' 
'--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' 
'--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 
'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' 
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro 
-Wl,-z,now' '--with-gssapi' '--with-ldap' 
'build_alias=aarch64-linux-gnu' 'CPPFLAGS=-Wdate-time 
-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security'
CC = gcc
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE 
-I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Werror=vla -Wendif-labels 
-Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security 
-fno-strict-aliasing -fwrapv -fexcess-precision=standard 
-Wno-format-truncation -g -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lselinux -llz4 -lxslt -lxml2 -lpam -lssl 
-lcrypto -lgssapi_krb5 -lz -lreadline -lpthread -lrt -ldl -lm
VERSION = PostgreSQL 14beta2 (Ubuntu 14~beta2-1.pgdg18.04+1)

It's very similar output for PG12 from the same source.

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

* Re: To JIT (or not!) in Ubuntu packages
@ 2021-09-15 04:05  Thomas Munro <thomas.munro@gmail.com>
  parent: Ben Chobot <bench@silentmedia.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2021-09-15 04:05 UTC (permalink / raw)
  To: Ben Chobot <bench@silentmedia.com>; +Cc: pgsql-general; Christoph Berg <myon@debian.org>

On Wed, Sep 15, 2021 at 3:30 PM Ben Chobot <bench@silentmedia.com> wrote:
> So I've installed http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/postgresql-14_14~beta3-1.pgdg18.04+1..., after which I see:

Ahhh, so you're on 18.04, an old LTS.  I remember now, there was this
issue in LLVM 3.9 on that aarch64 (which I saw on Debian 9 during
testing of the JIT stuff), resolved by later LLVM versions (maybe 6?):

https://www.postgresql.org/message-id/flat/CAEepm%3D0HqkxWk2w8N2nXQXC_43Mucn-v%3D8QdY8vOG5ojo9kJRA%4...

I don't know Ubuntu versioning policies etc, but maybe something to do
with which LLVM versions it's allowed to depend on?





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


end of thread, other threads:[~2021-09-15 04:05 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 22:10 To JIT (or not!) in Ubuntu packages Ben Chobot <bench@silentmedia.com>
2021-09-15 00:50 ` Thomas Munro <thomas.munro@gmail.com>
2021-09-15 03:30   ` Ben Chobot <bench@silentmedia.com>
2021-09-15 04:05     ` Thomas Munro <thomas.munro@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