[postgis-devel] Error compiling PostGIS in Snow Leopard (logs inside)

Jorge Arevalo jorgearevalo at libregis.org
Tue Mar 13 10:44:58 PDT 2012


Hi Bborie,

Y finally solved compiling PostgreSQL myself, with the same options
than PostGIS and GDAL. Now it's working fine, but thanks for your
guide. I'll use it if I get in troubles with my current configuration.

Best regards,
Jorge

On Fri, Mar 9, 2012 at 4:57 PM, Bborie Park <dustymugs at gmail.com> wrote:
> Jorge,
>
> I have PostGIS running on OSX 10.6 but in a completely different manner.
>
> Apple used to have a doc (out-of-date though) describing how to build
> PostgreSQL in OSX.  The doc is no longer available at Apple but I did
> find a cache of it...
>
> https://bmark.us/bmark/readable/e3f9423d306258
>
> Basically, the important things to get from the link are steps 2 - 4
>
> 1. Instal Xcode
>
> 2. Install fink
>
> 3. Install readline library using fink
>
> 4. Install PostgreSQL from source.  My configure statement looks like
>
> ./configure --libdir=/usr/local/lib64 --with-libxml --enable-debug
> --enable-cassert --with-includes=/sw/include --with-libraries=/sw/lib
> && make && make install
>
> 5. Install Proj.4 from source.
>
> ./configure --libdir=/usr/local/lib64 && make && make install
>
> 6. Install GEOS from source
>
> ./configure --libdir=/usr/local/lib64 && make && make install
>
> 7. Install GDAL from source
>
> ./configure --libdir=/usr/local/lib64 && make && make install
>
> 8. Install PostGIS from source
>
> ./configure --libdir=/usr/local/lib64 --with-gettext=/sw --with-raster
> && make && make install
>
> For me, the above works perfectly
>
> If you want, I can send along my PostGIS's config.log...
>
> -bborie
>
> On Thu, Mar 8, 2012 at 5:56 AM, Jorge Arevalo <jorgearevalo at libregis.org> wrote:
>> 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
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



-- 
Jorge Arevalo
http://www.libregis.org



More information about the postgis-devel mailing list