Compile PostGIS 2.0 (SVN)

Ryan Schmidt ryandesign at macports.org
Sat Aug 27 10:42:08 PDT 2011


On Aug 27, 2011, at 10:25, JP Glutting wrote:

> I am resurrecting this old thread, because I am having more problems compiling the latest version of Postgis 2.0.0SVN (revision 7789) on Lion, and it makes sense to keep all the information together. After configuring and make-ing as above, I am getting this error:
> 
> ld: symbol(s) not found for architecture i386
> 
> The context is:
> 
>       ...
>   "_lwgeom_calculate_gbox_geodetic", referenced from:
>       _compute_geography_stats in geography_estimate.o
>       _geography_gist_selectivity in geography_estimate.o
>       _geography_area in geography_measurement.o
>   "_gserialized_get_type", referenced from:
>       _geography_bestsrid in geography_measurement.o
>       _geography_covers in geography_measurement.o
>       _geography_perimeter in geography_measurement.o
>   "_lwgeom_calculate_gbox_cartesian", referenced from:
>       _geography_bestsrid in geography_measurement.o
>   "_lwgeom_covers_lwgeom_sphere", referenced from:
>       _geography_covers in geography_measurement.o
>   "_gserialized_get_gbox_p", referenced from:
>       _geography_point_outside in geography_measurement.o
>   "_gbox_pt_outside", referenced from:
>       _geography_point_outside in geography_measurement.o
>   "_lwgeom_area_sphere", referenced from:
>       _geography_area in geography_measurement.o
>   "_lwgeom_area_spheroid", referenced from:
>       _geography_area in geography_measurement.o
>   "_gserialized_datum_get_gbox_p", referenced from:
>       _compute_geometry_stats in geometry_gist_selectivity.o
>       _geometry_gist_sel_2d in geometry_gist_selectivity.o
> ld: symbol(s) not found for architecture i386
> collect2: ld returned 1 exit status
> lipo: can't open input file: /var/folders/k0/lzz_jzld03d8yg881mnbh7_h0000gp/T//ccgj6uq8.out (No such file or directory)
> make[1]: *** [postgis-2.0.so] Error 1
> make: *** [all] Error 1
> 
> Searching for this type of error, I saw that this is often because a framework is missing.

That would be a possibility: that the developers omitted an essential framework or library from the link line. But the fact that it says the error is for architecture i386, when the default build_arch on Lion is x86_64, suggests instead that you are building this port universal, but that a dependency is not built universal.


> I installed the postgis package that is part of Macports, in case this brought some other dependency I had missed, and tried to recompile the dependencies (proj4, GDAL, GEOS, etc. as universal, in case it was an architecture issue). GEOS wouldn't compile as universal. 

geos compiles fine universal for me, on Snow Leopard with Xcode 3. Other problems were reported already when using llvm-gcc-4.2 or clang, as would happen with Xcode 4 and thus on Lion:

https://trac.macports.org/ticket/30309

I've resolved that by forcing the use of gcc-4.2. Has that helped?


> I asked on the Postgis list (for a previous version that had the same problem), but got no response. Any hints welcome.

Yes, the postgis developers don't seem very responsive; they didn't respond to our upstream ticket about the aforementioned problem three weeks ago either.




More information about the macports-users mailing list