pgroonga / pgroonga

PGroonga is a PostgreSQL extension to use Groonga as index. PGroonga makes PostgreSQL fast full text search platform for all languages!
https://pgroonga.github.io/
Other
547 stars 23 forks source link

installing source code on macOS - 'groonga.h' file not found #404

Closed Somnium99 closed 8 months ago

Somnium99 commented 8 months ago

What happened?

I've been trying to install source code of one of the latest versions on macOS Ventura 13.2.1, with intel chip. But it fails with 'groonga.h' file not found.

I checked pg_config with which pg_config :

/usr/local/opt/postgresql@15/bin/pg_config`

Then ran make, make install, and also tried make HAVE_MSGPACK=1, but received :

/Library/Developer/CommandLineTools/usr/bin/make -f pgroonga.mk all
Package msgpack was not found in the pkg-config search path.
Perhaps you should add the directory containing `msgpack.pc'
to the PKG_CONFIG_PATH environment variable
No package 'msgpack' found
Requested 'groonga >= 13.0.2' but version of Groonga is 13.0.1
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2  -DPGRN_HAVE_MSGPACK -Ivendor/xxHash  -DPGRN_VERSION="\"3.1.7\"" -I. -I./ -I/usr/local/opt/postgresql@15/include/postgresql/server -I/usr/local/opt/postgresql@15/include/postgresql/internal -I/usr/local/Cellar/icu4c/72.1/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I/usr/local/opt/gettext/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/Cellar/lz4/1.9.4/include   -c -o src/pgrn-alias.o src/pgrn-alias.c
In file included from src/pgrn-alias.c:3:
src/pgrn-alias.h:6:10: fatal error: 'groonga.h' file not found
#include <groonga.h>
         ^~~~~~~~~~~
1 error generated.
make[1]: *** [src/pgrn-alias.o] Error 1
make: *** [all] Error 2

I checked that I have msgpack, by trying to install it with brew:

Warning: msgpack 6.0.0 is already installed and up-to-date.
To reinstall 6.0.0, run:
  brew reinstall msgpack

How to reproduce it

try to install 3.1.7 source code in macOS.

Expected behavior

source code installed successfully.

Environment

Additional context

No response

kou commented 8 months ago

How did you install Groonga (not PGroonga)?

Somnium99 commented 8 months ago

I don't think I installed Groonga separately, I just downloaded and installed the source code of pgroonga 3.0.3 (my current working version) by doing make / make install, and it worked.

To be more exact, prior to that, I used brew to install pgroonga. However, after we upgraded to Postgres 15 from 14, I couldn't use brew anymore because it's linked to postgres 14, so I manually installed the source code of pgroonga 3.0.3

kou commented 8 months ago

OK. You need to install Groonga separately. You can use brew install groonga for it.

Somnium99 commented 8 months ago

Thank you, it seemed to help with the installation, but now when I try to create the extension it says :

ERROR:  extension "pgroonga" is not available
DETAIL:  Could not open extension control file "/usr/local/opt/postgresql@15/share/postgresql@15/extension/pgroonga.control": No such file or directory.
HINT:  The extension must first be installed on the system where PostgreSQL is running.
kou commented 8 months ago

Homebrew's postgresql@15 and postgresql@16 don't support extension yet:

Please discuss it on https://github.com/Homebrew/homebrew-core instead of here.

(You can use PostgreSQL 15 on macOS if you install PostgreSQL 15 from source.)