FG
💻 Software🤖 AI & LLMs

can't make pgvector

Freshalmost 2 years ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -mmacosx-version-min=10.15 -arch x86_64 -arch arm64 -O2 -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -I. -I./ -I/Library/PostgreSQL/15/include/postgresql/server -I/Library/PostgreSQL/15/include/postgresql/internal -I/opt/local/Current_v15/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -I/opt/local/20220418/include/libxml2 -I/opt/local/Current_v15/include -I/opt/local/Current_v15/include -I/opt/local/Current_v15/include/libxml2 -I/opt/local/Current_v15/include -I/opt/local/Current_v15/include/openssl/ -c -o src/bitutils.o src/bitutils.c clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk' [-Wmissing-sysroot] clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk' [-Wmissing-sysroot] In file included from src/bitutils.c:1: In file included from /Library/PostgreSQL/15/include/postgresql/server/postgres.h:46: /Library/PostgreSQL/15/include/postgresql/server/c.h:59:10: fatal error: 'stdio.h' file not found #include <stdio.h> ^~~~~~~~~ 1 error generated. make: *** [src/bitutils.o] Error 1 this is the error. ls /L

Error Output

error: 'stdio.h' file not found

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: can't make pgvector

Low Risk

Had the same problem and indeed `make` (as instructed for Linux and Mac in the `README`) uses the Command Line Tools referred to by Postgresql. So it's not pgvector's fault. In my case, it's because the Mac installer from https://www.postgresql.org/download/ installs Postgresql configured to use outdated version of Command Line Tools. I solved it like this: - Uninstall Postgresql (there is an un

84

Trust Score

3 verifications

100% success
  1. 1

    Had the same problem and indeed `make` (as instructed for Linux and Mac in the `

    Had the same problem and indeed `make` (as instructed for Linux and Mac in the `README`) uses the Command Line Tools referred to by Postgresql. So it's not pgvector's fault.

  2. 2

    In my case, it's because the Mac installer from https://www.postgresql.org/downl

    In my case, it's because the Mac installer from https://www.postgresql.org/download/ installs Postgresql configured to use outdated version of Command Line Tools.

  3. 3

    I solved it like this:

    - Uninstall Postgresql (there is an uninstall file in `/Library/Postgresql/16/`) - Install it again using homebrew: `brew install postgresql@16` - Run `pg_config`, you should have the installed version of Command Line Tools configured - If `pg_config` fails, maybe you forgot to export the bin folder path. To do so run: `echo 'export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"' >> ~/.zshrc` - Then `make` ... (as per installation instructions)

  4. 4

    Here are some other things to try:

    - Check that indeed it's the case by running `pg_config`. You should see the faulty SDK. - Try to reinstall Command Line Tools to see if this gets you the right version - Rename `/Library/Developer/CommandLineTools` to `/Library/Developer/CommandLineTools_BACKUP` or whatever, for an eventual backup. - run `xcode-select --install` - Follow the install wizard - Check if you now have the right SDKs inside `/Library/Developer/CommandLineTools/SDKs/` - Otherwise you can try to install the (most probably) outdated version from https://developer.apple.com/download/all/ (You need an apple ID t

Validation

Resolved in pgvector/pgvector GitHub issue #592. Community reactions: 2 upvotes.

Verification Summary

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

pgvectorembeddingsvector-search