postgrespro / pgsphere

PgSphere provides spherical data types, functions, operators, and indexing for PostgreSQL.
https://pgsphere.org
BSD 3-Clause "New" or "Revised" License
17 stars 14 forks source link

Compiler settings for healpix are not portable (OSX) #4

Closed pashkinelfe closed 3 years ago

pashkinelfe commented 3 years ago

When compiling after MOC changes with healpix usage on OS X

# compiler settings
  override CPPFLAGS += -I/usr/include/healpix_cxx
  SHLIB_LINK += -lhealpix_cxx

build errors arise:

g++ -shared -o pg_sphere.so sscan.o sparse.o sbuffer.o vector3d.o point.o euler.o circle.o line.o ellipse.o polygon.o path.o box.o output.o gq_cache.o gist.o key.o gnomo.o healpix.o moc.o process_moc.o healpix_bare/healpix_bare.o -L/usr/local/pgsql/lib -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-dead_strip_dylibs -bundle_loader /usr/local/pgsql/bin/postgres -lhealpix_cxx clang: error: invalid argument '-bundle_loader /usr/local/pgsql/bin/postgres' not allowed with '-dynamiclib'

Also on my system should be not /usr/include/healpix_cxx but /usr/local/include/healpix_cxx (the path is hardcoded now after moc commits d6979267 (Christoph Berg 2019-12-18)).

df7cb commented 3 years ago

The "invalid argument" part seems like a local issue, or at least one that isn't pgsphere's fault. The paths should be fixed in the PR I just pushed.

pashkinelfe commented 3 years ago

I suppose "invalid argument" was because -lhealpix_cxx should have been before /usr/local/pgsql/bin/postgres, not appended after everything.