citusdata / citusdata/postgresql-hll

Build problems on Mac OSX Mojave

Open
#68 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
1.2k
Forks
115
PR merge metrics
No merged PRs in 30d

Description

My builds failed with

```
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 -std=c99 -fPIC -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/usr/local/Cellar/postgresql/11.2/include -I. -I./ -I/usr/local/Cellar/postgresql/11.2/include/server -I/usr/local/Cellar/postgresql/11.2/include/internal -I/usr/local/Cellar/icu4c/63.1/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -c -o src/hll.o src/hll.c
clang: error: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Werror,-Wmissing-sysroot]
make: *** [src/hll.o] Error 1
```

And after removing `-Werror` in the makefile

```
λ make
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 -std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/usr/local/Cellar/postgresql/11.2/include -I. -I./ -I/usr/local/Cellar/postgresql/11.2/include/server -I/usr/local/Cellar/postgresql/11.2/include/internal -I/usr/local/Cellar/icu4c/63.1/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -c -o src/hll.o src/hll.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
In file included from src/hll.c:16:
In file included from /usr/local/Cellar/postgresql/11.2/include/server/postgres.h:46:
/usr/local/Cellar/postgresql/11.2/include/server/c.h:59:10: fatal error: 'stdio.h' file not found
#include
^~~~~~~~~
1 error generated.
make: *** [src/hll.o] Error 1
```

After installing header files via `open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg` (From https://github.com/neovim/neovim/issues/9050#issuecomment-424417456) and adding `-I/usr/include` to the cpp flags, it compiled.

I ended up with this `PG_CPPFLAGS`:

```
PG_CPPFLAGS = -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I$(libpq_srcdir) -I/usr/include
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.