[postgis-devel] Error compiling PostGIS in Snow Leopard (logs inside)
Jorge Arevalo
jorgearevalo at libregis.org
Thu Mar 8 05:56:24 PST 2012
On Wed, Mar 7, 2012 at 1:18 AM, Jorge Arevalo <jorgearevalo at libregis.org> wrote:
> Hi,
>
> I'm trying to compile PostGIS in Snow Leopard using KyngChaos Frameworks
> (UnixImageIO, PROJ and GEOS frameworks. See
> http://www.kyngchaos.com/macosx/build/index). I've successfully compiled
> GDAL using those frameworks, plus expat
> (http://www.kyngchaos.com/macosx/build/expat). Instructions are here
> http://trac.osgeo.org/gdal/wiki/BuildingOnMac
>
> Now I get errors when trying to compile PostGIS on Mac. The configure line
> used is:
>
> ./configure --with-pgconfig=/Library/PostgreSQL/9.1/bin/pg_config
> --mandir=/usr/local/pgsql/man
> --with-geosconfig=/Library/Frameworks/GEOS.framework/unix/bin/geos-config
> --with-projdir=/Library/Frameworks/PROJ.framework/unix
> --with-gdalconfig=/Library/Frameworks/GDAL.framework/unix/bin/gdal-config
>
> And the configure output is here (correct):
> http://dl.dropbox.com/u/61566717/output/configure_output.log
>
> When I execute make, I get this error: "Undefined symbols for architecture
> i386:", followed by some lwgeom functions. Looks like those functions are
> not linked, because they're not found. I got a similar error compiling GDAL,
> but I fixed it by specifying "--without-libtool" in configure time. I can't
> do the same with PostGIS.
>
> Things I've tried:
> - Specify "--disable-libtool-lock" in configure time. Not working.
> - Specify "--without-raster" in configure time. The error raises when trying
> to build librtcore.a. Not working. Same error, but when trying to build the
> pgsql2shp loader.
>
> Here, the complete make output:
> http://dl.dropbox.com/u/61566717/output/make_output.log
>
> Any clues?
>
> Many thanks in advance.
>
> Best regards,
> --
> Jorge Arevalo
> http://www.libregis.org
Ok, I have some clues. I'm using this enviroment variables:
export CFLAGS="-Os -arch i386 -arch x86_64"
export PG_CPPFLAGS="-arch i386 -arch x86_64"
export SHLIB_LINK="-arch i386 -arch x86_64"
export LDFLAGS="-arch i386 -arch x86_64"
And the error I get is ld: symbol(s) not found for architecture i386
The symbols not found are some lwgeom functions. Apparently, they're
not constructed for i386 arch.
Here, the log created by make:
http://dl.dropbox.com/u/61566717/output/make_output.log
If I remove the x86_64 arch from the enviroment vars (even when my
processor is a 64bits one):
export CFLAGS="-Os -arch i386"
export PG_CPPFLAGS="-arch i386"
export SHLIB_LINK="-arch i386"
export LDFLAGS="-arch i386"
I get ld: symbol(s) not found for architecture x86_64
With the same symbols. Now they're not constructed for x86_64 arch.
Here, the log created by make:
http://dl.dropbox.com/u/61566717/output/make_i386.log
But if I do the opposite, and I try to compile just for x86_64 arch :
export CFLAGS="-Os -arch x86_64"
export PG_CPPFLAGS="-arch x86_64"
export SHLIB_LINK="-arch x86_64"
export LDFLAGS="-arch x86_64"
I get again: ld: symbol(s) not found for architecture i386
Here, the log created by make:
http://dl.dropbox.com/u/61566717/output/make_x86_64.log
Checking the makefile for lwgeom library, I don't see anything that
can force to compile against one architecture or another.
What's happening? How does PostGIS choose the architecture to compile
for? Should I define other enviroment vars?
Thanks in advance, and best regards
--
Jorge Arevalo
http://www.libregis.org
More information about the postgis-devel
mailing list