build geos-3.0.0 / geos-3.0.3

243 views
Skip to first unread message

janus

unread,
Feb 6, 2009, 10:57:34 AM2/6/09
to SpatiaLite Users
Hi,

I am trying to build spatialite. Well, I am stuck at the second step
(building geos) .
I build proj on XP with mingw/msys successfully but when I build geos
I get this error:

....
ibgeos.lax/libsimplify.a/TopologyPreservingSimplifier.o .libs/
libgeos.lax/libutil.a/Assert.o .libs/libgeos.lax/libutil.a/
GeometricShapeFactory.o .libs/libgeos.lax/libutil.a/math.o .libs/
libgeos.lax/libutil.a/Profiler.o .libs/libgeos.la-1.o
make[2]: *** [libgeos.la] Error 5
make[2]: Leaving directory `/c/geos-3.0.0/source'
make[1]: *** [all-recursive] Error 1

ld.exe crashes. I tried to build geos-3.0.3 also with the latest mingw/
gcc - same problem. Does anyone know a combination of mingw/gcc/geos
version that does compile on XP?

thx
janus

janus

unread,
Feb 6, 2009, 5:21:21 PM2/6/09
to SpatiaLite Users
I had to set max_cmd_len in the file libtool to 5000 to build geos.
Then it compiled. I build libiconv-1.11 (1.12 did not compile) and
finally I tried to built spatialite: Any idea whats wrong? After the
install of proj I have the proj libs and headers in msys usr/local/
include (lib)

*** Warning: This system can not link to static lib archive /usr/local/
lib/libproj.la.
*** I have the capability to make that library automatically link in
when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
rm -fr .libs/libspatialite.dll.a
gcc -shared .libs/version.o -Wl,--whole-archive ../spatialite/.libs/
libspatialite.a ../gaiageo/.libs/libgaiageo.a -Wl,--no-whole-archive -
L/usr/local/lib ../sqlite3/.libs/libsqlite3.dll.a /usr/local/lib/
libgeos_c.dll.a /usr/local/lib/libgeos.dll.a /usr/local/lib/
libiconv.dll.a -o .libs/libspatialite-2.dll -Wl,--enable-auto-image-
base -Xlinker --out-implib -Xlinker .libs/libspatialite.dll.a
Creating library file: .libs/libspatialite.dll.a
../spatialite/.libs/libspatialite.a(spatialite.o)(.text
+0xe91a):spatialite.c: undefined reference to `pj_get_release'
../spatialite/.libs/libspatialite.a(spatialite.o)(.text
+0x11676):spatialite.c: undefined reference to `pj_get_release'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0xc79):gg_transform.c: undefined reference to `pj_init_plus'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0xc98):gg_transform.c: undefined reference to `pj_init_plus'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0xdf2):gg_transform.c: undefined reference to `pj_transform'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0x1006):gg_transform.c: undefined reference to `pj_transform'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0x1273):gg_transform.c: undefined reference to `pj_transform'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0x14b7):gg_transform.c: undefined reference to `pj_transform'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0x15ef):gg_transform.c: undefined reference to `pj_free'
../gaiageo/.libs/libgaiageo.a(gg_transform.o)(.text
+0x15fa):gg_transform.c: undefined reference to `pj_free'
collect2: ld returned 1 exit status
make[2]: *** [libspatialite.la] Error 1
make[2]: Leaving directory `/c/spatialite-2.2/src/versioninfo'

janus

unread,
Feb 7, 2009, 4:19:31 PM2/7/09
to SpatiaLite Users
although I seems I am just talking to myself ....

Finally I build spatialite. But I just copied the libraries from
spatialite_win_libs. It turned out that proj wasn't built properly.
Some libraries did not compile. I also tried it with a tutorial form
the qgis website, but I always got errors. Why is it such a pain to
build this stuff on windows ...

Alessandro Furieri

unread,
Feb 8, 2009, 12:37:03 PM2/8/09
to spatiali...@googlegroups.com
Hi,

> Why is it such a pain to build this stuff on windows ...

You are perfectly right.
Building on Windows + MSYS + MinGW is really a big pain;
and if this is true on a general way, building GEOS really
is an awful nightmare.

a) Windows has it's own idiosyncrasies
(and the standard tools as make, gcc ... are primarily
intended for Unix-like systems, not for Windows)
b) MSYS + MinGW are really wonderful, but they are neither
perfect nor infallible
c) some packages (notably GEOS) are so complex and huge
that building them is anyway a quite complex task
[on Linux as well]

GEOS actually is the C++ porting of the original Java JTS;
so, in order to allow for an easiest porting from Java,
GEOS developers used lots and lots of 'extreme' C++ features,
and this make compiling GEOS a tricky and risky affair, because
the slightest syntax incompatibility will produce a complete
failure.

To make things a little bitter, the GEOS devel team supports
MS compilers for Windows, but not MinGW :-(

On Windows I wasn't able to build any GEOS version
(3.0.0, 3.0.1, 3.0.3) using the latest MinGW;
I finally got a successful build using an obsolete and
not yet updated PC I've dismissed last year; oldest MinGW
versions will build GEOS successfully, but the latest ones
will inexorably fail for some reason.

[Quite surprisingly, no one of the problems you've encountered
is similar to the ones I found ... they are completely different]

And that's not all; I wasn't able to build GEOS on Fedora 9 as well,
after I installed the latest gcc updates.
I can successfully build on Ubuntu 8.04 and/or on Fedora 7, but on
Fedora 9 I got a complete failure.

So the problem seems to be this one: latest GCC versions
(October 2008, more or less) have some (obscure) incompatibility
with GEOS own 'extreme' C++ syntax ....

bye, Sandro

jan

unread,
Feb 8, 2009, 2:45:43 PM2/8/09
to spatiali...@googlegroups.com
Hi,

thanks for your comprehensive answer. Well, I use Qt a lot and whatever
I do it compiles on Linux and Win - that might explain my frustration
especially with building proj. Surprisingly GEOS build without a problem
after I changed max_cmd_len in libtool. btw help came from this thread
http://osdir.com/ml/gis.geos.devel/2007-01/msg00000.html

Maybe you should change your build proj/GEOS howto on your website. I
seems its not for everyone a little ./configure - make - make install :-)

If you are interested we could put together all experience with building
these libraries on windows (from us, other users) - which version of all
tools, source, OS and if the build failed or not.

And btw: thx for developing spatialite :-)

cheers
Jan

Alessandro Furieri schrieb:
Reply all
Reply to author
Forward
0 new messages