Skip to content

Build pgvector without -march=native - #30

Merged
SilvioC2C merged 1 commit into
masterfrom
FIX-pgvector-no-march-native
Oct 14, 2026
Merged

SilvioC2C merged 1 commit into
masterfrom
FIX-pgvector-no-march-native

Conversation

@SilvioC2C

Copy link
Copy Markdown
Contributor

Build pgvector without -march=native

pgvector's Makefile defaults to OPTFLAGS = -march=native. The builder stage compiles vector.so on whatever machine builds the image, so the binary may use instructions (e.g. AVX-512) that the CPU running the image does not have. In that case the backend is killed with SIGILL as soon as the extension is created:

      server process (PID n) was terminated by signal 4: Illegal instruction
      Failed process was running: CREATE EXTENSION IF NOT EXISTS vector ...

Pass OPTFLAGS="" to make and make install so vector.so is built for generic x86-64 and runs on any host CPU, as documented in the pgvector README.

pgvector's Makefile defaults to OPTFLAGS = -march=native. The builder
stage compiles vector.so on whatever machine builds the image, so the
binary may use instructions (e.g. AVX-512) that the CPU running the
image does not have. In that case the backend is killed with SIGILL
as soon as the extension is created:

  server process (PID n) was terminated by signal 4: Illegal instruction
  Failed process was running: CREATE EXTENSION IF NOT EXISTS vector ...

Pass OPTFLAGS="" to make and make install so vector.so is built for
generic x86-64 and runs on any host CPU, as documented in the pgvector
README.
@florentx
florentx requested a review from Vampouille October 14, 2026 11:01
@SilvioC2C
SilvioC2C merged commit 2fbe4f1 into master Oct 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants