Skip to content

Problem with build #627

@dmitry-lipetsk

Description

@dmitry-lipetsk

Hello,

Could anyone help me build probackup?

I am trying to build it (Ubuntu 24.04) using your instruction.

PostrgreSQL was compiled with the following steps:

  • meson setup build --prefix=/usr/local/pgsql --buildtype=debug -Dssl=openssl -Dcassert=true
  • cd build
  • ninja
  • meson test
  • sudo ninja install

Installed PG instance works as expected.

Build method 1 (PGXS)

Instruction:

To compile pg_probackup, you must have a PostgreSQL installation and raw source tree....

What is mean "raw source tree"? I pointed the folder with source that I used to build PG. Is it OK?

My command is:

make USE_PGXS=1 PG_CONFIG='/usr/local/pgsql/bin/pg_config' top_srcdir='/home/dima/.MY/GitHUB/Postgres/DEV20240722-work2/'

Errors:

/home/dima/.MY/GitHUB/PostgresPro/pg_probackup/work/src/utils/file.c:1581:(.text+0x3f74): undefined reference to deflateInit2_' /usr/bin/ld: /home/dima/.MY/GitHUB/PostgresPro/pg_probackup/work/src/utils/file.c:1601:(.text+0x4004): undefined reference to inflateInit2_'
/usr/bin/ld: /home/dima/.MY/GitHUB/PostgresPro/pg_probackup/work/src/utils/file.c:1630:(.text+0x40f3): undefined reference to gzdopen' /usr/bin/ld: /home/dima/.MY/GitHUB/PostgresPro/pg_probackup/work/src/utils/file.c:1633:(.text+0x410c): undefined reference to gzopen'
/usr/bin/ld: /home/dima/.MY/GitHUB/PostgresPro/pg_probackup/work/src/utils/file.c:1636:(.text+0x4133): undefined reference to `gzsetparams'
….

As I understand, a problem with zlib library. How can I fix it?

/sbin/ldconfig -p| grep libz.so says:

    libz.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libz.so.1
    libz.so.1 (libc6) => /lib/i386-linux-gnu/libz.so.1
    libz.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libz.so

Build method 2 (build probackup in contrib folder of PG source tree)

Instruction:

The alternative way, without using the PGXS infrastructure, is to place pg_probackup source directory into contrib directory and build it there.

Ok.

I copyed the folder with source code of probackup in '/home/dima/.MY/GitHUB/Postgres/DEV20240722-work2/contrib/pg_probackup':

image

I opened a terminal in this folder and executed "make"

Error:

Makefile:48: ../../src/Makefile.global: No such file or directory
make: *** No rule to make target '../../src/Makefile.global'. Stop.

As I understand, the problem is here:

pg_probackup/Makefile

Lines 45 to 50 in a2510f5

else
subdir=contrib/pg_probackup
top_builddir=../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

Makefile.global was generated in "PG_SRC_TREE/build/src" not in "PG_SRC_TREE/src"

I corrected top_builddir with top_builddir=../../build but it did not help.

Error:

make -C ../../build/src/backend generated-headers
make[1]: Entering directory '/home/dima/.MY/GitHUB/Postgres/DEV20240722-work2/build/src/backend'
make[1]: *** No rule to make target 'generated-headers'. Stop.
make[1]: Leaving directory '/home/dima/.MY/GitHUB/Postgres/DEV20240722-work2/build/src/backend'
make: *** [../../build/src/Makefile.global:384: submake-generated-headers] Error 2

What did I do wrong?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions