From: TopCoder2K (@TopCoder2K) <noreply+TopCoder2K@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #834: Ubuntu 20.04: fatal error: postgres.h: No such file or directory
Date: Sun, 04 May 2025 06:24:04 +0000
Message-ID: <gh-pgvector-pgvector-834@github.com> (raw)
I'm trying to upgrade from 0.7.3 to 0.7.4. The 0.7.3 version was installed by another user and worked fine. When I run `make`, I get the error though `postgresql-server-dev-12` is installed (I have PostgreSQL 12.17). What should I check/do?
Some results:
```
$ cd /tmp/
$ git clone --branch v0.7.4 https://github.com/pgvector/pgvector.git
$ cd pgvector/
$ sudo apt install postgresql-server-dev-12
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
postgresql-client-16
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
postgresql-server-dev-12
1 upgraded, 0 newly installed, 0 to remove and 188 not upgraded.
Need to get 1003 kB of archives.
After this operation, 19.5 kB of additional disk space will be used.
Get:1 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 postgresql-server-dev-12 amd64 12.22-2.pgdg20.04+1 [1003 kB]
Fetched 1003 kB in 0s (4642 kB/s)
(Reading database ... 109466 files and directories currently installed.)
Preparing to unpack .../postgresql-server-dev-12_12.22-2.pgdg20.04+1_amd64.deb ...
Unpacking postgresql-server-dev-12 (12.22-2.pgdg20.04+1) over (12.19-1.pgdg20.04+1) ...
Setting up postgresql-server-dev-12 (12.22-2.pgdg20.04+1) ...
$ make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/16/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/bitutils.o src/bitutils.c
src/bitutils.c:1:10: fatal error: postgres.h: No such file or directory
1 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/bitutils.o] Error 1
```