error: "postgres.h not found"
slavitch opened this issue · comments
brew install timescaledb
==> Installing timescaledb from timescale/tap
==> Downloading https://timescalereleases.blob.core.windows.net/homebrew/timescaledb-2.0.1.tar.lzma
Already downloaded: /Users/michael/Library/Caches/Homebrew/downloads/86a311958704c9e6161d1c81bf3816fde00fbd697c961ca015d0ad2283788a8a--timescaledb-2.0.1.tar.lzma
==> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD="brew"
==> cd ./build && make
Last 15 lines from /Users/michael/Library/Logs/Homebrew/timescaledb/02.build:
/tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/process_utility.c:6:10: error: 'postgres.h' file not found [clang-diagnostic-error]
#include <postgres.h>
^
2 errors generated.
Error while processing /tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/process_utility.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/process_utility.c.o] Error 1
error: unknown warning option '-Wno-format-truncation' [clang-diagnostic-unknown-warning-option]
/tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/planner.c:6:10: error: 'postgres.h' file not found [clang-diagnostic-error]
#include <postgres.h>
^
2 errors generated.
Error while processing /tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/planner.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/planner.c.o] Error 1
make[1]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/all] Error 2
make: *** [all] Error 2
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/timescale/homebrew-tap/issues
Those files (such as postgres.h
, libpq-fe.h
, etc.) would act as the library for the code compiling.
timescaledb
will look for those files under /usr/local/Cellar/postgresql@12/12.6/include/server
if you installed the postgresql through brew
(assume you installed postgresql 12.6)
However, those files are actually under /usr/local/Cellar/postgresql@12/12.6/include/postgresql/server
.
So try ln -s /usr/local/Cellar/postgresql@12/12.6/include/postgresql/server /usr/local/Cellar/postgresql@12/12.6/include/server
this commend mentioned in this issue and check if the compiling works.
Hope this could help.
This post helped me to resolve similar issue of missing postgres.h file
Hello, i 've got the same issue in my ubuntu system (20.04) trying to compile (make) the source code
"timescaledb/src/uuid.c:6:10: fatal error: postgres.h: No such file or directory"
Can you please provide me a fix for this issue.
Thank you
- Hey @vkaragounis , as we mentioned in the previous command you should be on PG 14 at least to fix the error. Are you using homebrew on linux or trying to mimic the steps?
If you update and still got the error, please open another issue describing your context.