pg-semver icon indicating copy to clipboard operation
pg-semver copied to clipboard

Unable to install on M1 pro with Apple chip

Open Virthuss opened this issue 3 years ago • 3 comments

When running make on mac:

ld: can't link with a main executable file '/opt/homebrew/Cellar/postgresql@14/14.6_1/bin/postgres' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [src/semver.so] Error 1

Any workaround for M1 Pro users?

Virthuss avatar Feb 09 '23 07:02 Virthuss

I use pgenv to build from source on my M1 Mac. Weird that Homebrew ships an x64 version.

theory avatar Feb 09 '23 21:02 theory

@theory so it's working on your side ? It seems to work on another M1 when installing postgres with homebrew.

What is your output if you run file which pg_config? (text appears formatted on github, don't forget the backtick around which pg_config)

Because it seems to work when output is /opt/homebrew/opt/postgresql@13/bin/pg_config but on my current one, with /opt/homebrew/bin/pg_config, it fails.

Virthuss avatar Feb 10 '23 06:02 Virthuss

Since I use pgenv, the output is:

/Users/david/.pgenv/pgsql/bin/pg_config

Maybe you need to reinstall Postgres from Homebrew.

theory avatar Feb 10 '23 15:02 theory