begriffs / pg_rational

Precise fractional arithmetic for PostgreSQL
MIT License
233 stars 14 forks source link

Mac M1 - Make Install Error #24

Closed stoickeyboard closed 2 years ago

stoickeyboard commented 2 years ago

When running make install on a M1 Macbook, I get the following errors /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'? /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'

When running arch -x86_64 make, make install works fine but then I get the following error could not load library "/Applications/Postgres.app/Contents/Versions/14/lib/postgresql/pg_rational.so": dlopen(/Applications/Postgres.app/Contents/Versions/14/lib/postgresql/pg_rational.so, 0x000A): tried: '/Applications/Postgres.app/Contents/Versions/14/lib/postgresql/pg_rational.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Is running this extension with an M1 Mac not possible, or is there a special way I have to build it?

Thanks for your work btw!

stoickeyboard commented 2 years ago

Did notice that I had two versions of Postgres installed on my machine. One from brew and another from the Postgres app. I uninstalled homebrew version by running homebrew uninstall posgresgql then I ran sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp to set the path for the Postgres app. And finally ran make sudo make install and it ran fine.