Repository navigation
Build pgvector without -march=native - #30
Merged
Merged
Conversation
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.
Vampouille
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.