pg_tle icon indicating copy to clipboard operation
pg_tle copied to clipboard

Cannot build the extension on macOS

Open pyrocks opened this issue 2 years ago • 3 comments

Description

I can't build the extension on macOS, specifically 14.4.1. I did not see anywhere in the documentation that the extension is limited to linux or x86_64.

Steps to reproduce

Followed the installation instructions - cloned the repository and ran make in the cloned folder.

Expected outcome

Extension being built successfully

Actual outcome

ld: warning: ignoring file '/usr/local/Cellar/postgresql@15/15.6_1/bin/postgres': found architecture 'x86_64', required architecture 'arm64'
Undefined symbols for architecture arm64:
  "_AllocSetContextCreateInternal", referenced from:
      _execute_extension_script in tleextension.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_tle.so] Error 1

Analysis

It would also be nice if the extension was installable using pgxn.

pyrocks avatar Apr 08 '24 12:04 pyrocks

Hi, is the cpu chip of your mac running on apple silicon or intel? it looks like your local installation of postgres is using the x86 architecture but your host is running on the arm64 architecture

anth0nyleung avatar Apr 08 '24 15:04 anth0nyleung

Hi, my mac is using apple silicon, but I have migrated to it from an intel based mac, which might explain why the local installation is using a x86. With that being said, I didn't have problems installing other extensions (i.e postgresql anonymizer).

pyrocks avatar Apr 09 '24 14:04 pyrocks

I would suggest reinstalling postgres binaries and retry building pg_tle. Im also running on a apple silicon cpu and it builds without any issue

anth0nyleung avatar Apr 10 '24 14:04 anth0nyleung