Install on mac with postgresql installed via brew
jankatins opened this issue · 1 comments
jankatins commented
I installed postgresql via brew and then only installed the xcode commandline package (xcode-select --install
). Installing this extension via make USE_PGXS=TRUE
failed with
λ make USE_PGXS=TRUE
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I./ -I/usr/local/opt/postgresql@11/include/server -I/usr/local/opt/postgresql@11/include/internal -I/usr/local/Cellar/icu4c/64.2/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -c -o pg_show_plans.o pg_show_plans.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk' [-Wmissing-sysroot]
In file included from pg_show_plans.c:11:
In file included from /usr/local/opt/postgresql@11/include/server/postgres.h:46:
/usr/local/opt/postgresql@11/include/server/c.h:59:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
The fix was to overwrite the hardcoded (from the brew compile of PG) systroot: make USE_PGXS=TRUE PG_SYSROOT=$(xcrun --show-sdk-path)
see citusdata/cstore_fdw#207 (comment) for more details about the sysroot problem.
kovmir commented
Not related to pg_show_plans
.