[postgis-devel] [geos-devel] [#317] Build configuration for CMake build system

Mateusz Loskot mateusz at loskot.net
Wed Jan 20 15:05:40 PST 2010


strk wrote:
> On Mon, Jan 18, 2010 at 09:31:26PM +0000, Mateusz Loskot wrote:
> 
>> I have added GEOS build configuration for CMake (http://www.cmake.org/)
>> build system.
> 
> Great!
> 
> I've tried the "cmake ../trunk && make" run and got linking error:
> 
> Linking CXX executable geos_unit
> CMakeFiles/geos_unit.dir/geostest2.cpp.o: In function `main':
> geostest2.cpp:(.text+0x588): multiple definition of `main'
> CMakeFiles/geos_unit.dir/geos_unit.cpp.o:geos_unit.cpp:(.text+0x6f2): first defined here
> CMakeFiles/geos_unit.dir/bug176.cpp.o: In function `do_sir()':
> bug176.cpp:(.text+0x0): multiple definition of `do_sir()'
> CMakeFiles/geos_unit.dir/geostest2.cpp.o:geostest2.cpp:(.text+0x0): first defined here
> CMakeFiles/geos_unit.dir/bug176.cpp.o: In function `do_buffer()':
> bug176.cpp:(.text+0x16a): multiple definition of `do_buffer()'
> CMakeFiles/geos_unit.dir/geostest2.cpp.o:geostest2.cpp:(.text+0x16a): first defined here
> CMakeFiles/geos_unit.dir/bug176.cpp.o: In function `main':
> bug176.cpp:(.text+0x588): multiple definition of `main'
> CMakeFiles/geos_unit.dir/geos_unit.cpp.o:geos_unit.cpp:(.text+0x6f2): first defined here
> collect2: ld returned 1 exit status
> 
> Is the above expected ?
> SVN At revision 2876.

Hmm, strange. I do not get any such error.
I can do clean rebuild using GCC 4.4.1.

> Funny enough, on second 'make' run, after those error, I get
> an error earlier:
> 
> [  0%] Building CXX object src/CMakeFiles/geos.dir/algorithm/distance/DiscreteHausdorffDistance.cpp.o
> In file included from /usr/src/geos/trunk/include/geos/algorithm/distance/PointPairDistance.h:24,
>                  from /usr/src/geos/trunk/include/geos/algorithm/distance/DiscreteHausdorffDistance.h:23,
>                  from /usr/src/geos/trunk/src/algorithm/distance/DiscreteHausdorffDistance.cpp:20:
> /usr/src/geos/cmake_build/include/geos/platform.h:147:3: error: #error "Could not find finite or isfinite function or macro!"
> make[2]: *** [src/CMakeFiles/geos.dir/algorithm/distance/DiscreteHausdorffDistance.cpp.o] Error 1
> make[1]: *** [src/CMakeFiles/geos.dir/all] Error 2

Yes, I was playing with the platform.h a bit and then I was gradually
fixing this kind of issues about missing isnan or isfinite on various
systems. So, something may be still not working well on some environments.

However, remember to remove old versions of platform.h
if you have any, for instance generated by autoconf
build in trunk/include/geos. It may cause problems.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org



More information about the postgis-devel mailing list