Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#753 closed defect (fixed)

cannot build geos 3.5.0

Reported by: rashadkm Owned by: geos-devel@…
Priority: major Milestone: 3.6.2
Component: Build/Install (cmake) Version: 3.6.1
Severity: Unassigned Keywords:
Cc: manuelgrizonnet

Description

trying to make geos 3.5.0 package for osgeo4w.

include could not find load file: GenerateSourceGroups

-- Looking for stddef.h - found
-- Check size of __int64
-- Check size of __int64 - done
-- Performing Test HAVE_STD_ISNAN
-- Performing Test HAVE_STD_ISNAN - Failed
-- Performing Test HAVE_ISNAN
-- Performing Test HAVE_ISNAN - Success
-- Performing Test HAVE_STD_ISFINITE
-- Performing Test HAVE_STD_ISFINITE - Failed
-- Performing Test HAVE_FINITE
-- Performing Test HAVE_FINITE - Success
-- Generating revision header C:/OSGeo4W/usr/src/osgeo4w/geos/geos-3.5.0/geos_svn_revision.h
Can't fetch local revision (neither .svn nor .git found)
Not updating existing rev file at GEOS_SVN_REVISION
CMake Error at CMakeLists.txt:326 (include):
  include could not find load file:

    GenerateSourceGroups


CMake Error at include/CMakeLists.txt:57 (GenerateSourceGroups):
  Unknown CMake command "GenerateSourceGroups".


-- Configuring incomplete, errors occurred!
See also "C:/OSGeo4W/usr/src/osgeo4w/geos/geos-3.5.0-build/CMakeFiles/CMakeOutput.log".
See also "C:/OSGeo4W/usr/src/osgeo4w/geos/geos-3.5.0-build/CMakeFiles/CMakeError.log".

C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0-build>cmake --build . --config Release --target INSTALL
NMAKE : fatal error U1073: incapable d'obtenir 'INSTALL'

Change History (24)

comment:2 by mloskot, 8 years ago

Resolution: fixed
Status: newclosed

CMake (still) assumes you build source tree checked out from SVN or Git repository, not from the package.

Try this fixed CMakeLists.txt from trunk in r4112

comment:3 by rashadkm, 8 years ago

Thanks for the quick fix.

I cannot checkout from svn as I am preparing a package for OSGeo4W.

Is it possible to get a n updated source archive with this patch. ?

comment:4 by mloskot, 8 years ago

No. First you need to check it out or just download CMakeLists.txt (https://trac.osgeo.org/geos/browser/trunk/CMakeLists.txt?rev=4112&format=txt), and test if solution works for you. Once you have tested it and confirmed it's sound, the package may be updated.

in reply to:  4 comment:5 by rashadkm, 8 years ago

Replying to mloskot:

No. First you need to check it out or just download CMakeLists.txt (https://trac.osgeo.org/geos/browser/trunk/CMakeLists.txt?rev=4112&format=txt), and test if solution works for you. Once you have tested it and confirmed it's sound, the package may be updated.

okay. seems fair. I will test it tomorrow and update to you.

comment:6 by rashadkm, 8 years ago

it is not working. the same problem. The error that there is no GenerateSourceGroups.cmake file existing in the source tree.

https://trac.osgeo.org/geos/browser/trunk/CMakeLists.txt#L329

comment:7 by rashadkm, 8 years ago

I found the file in here https://trac.osgeo.org/geos/browser/trunk/cmake/modules. but it is not found in the downloaded archive.

copying the file from trac.osgeo.org into geos-3.5.0/cmake/modules fixed the problem for me

comment:8 by rashadkm, 8 years ago

another error;

BufferOp.cpp C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0\src\operation\buffer\BufferOp.cpp(92) : error C2589: '(' : illeg al token on right side of '::' C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0\src\operation\buffer\BufferOp.cpp(92) : error C2059: syntax erro r : '::' C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0\src\operation\buffer\BufferOp.cpp(92) : error C2589: '(' : illeg al token on right side of '::' C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0\src\operation\buffer\BufferOp.cpp(92) : error C2589: '(' : illeg al token on right side of '::' C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0\src\operation\buffer\BufferOp.cpp(92) : error C2589: '(' : illeg al token on right side of '::' C:\OSGeo4W\usr\src\osgeo4w\geos\geos-3.5.0\src\operation\buffer\BufferOp.cpp(92) : error C2589: '(' : illeg al token on right side of '::' NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe'á: code retour '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"'á: code retour '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"'á: code retour '0x2' Stop.

Version 0, edited 8 years ago by rashadkm (next)

comment:9 by rashadkm, 8 years ago

sucessfully built geos 3.5.0 for osgeo4W 32bit

  1. geos-3.5.0.tar.gz from http://download.osgeo.org/geos/geos-3.5.0.tar.bz2
  2. https://trac.osgeo.org/geos/browser/trunk/CMakeLists.txt?rev=4112&format=txt
  3. https://trac.osgeo.org/geos/browser/trunk/cmake/modules/GenerateSourceGroups.cmake?format=txt

and when running cmake, I added -DCMAKE_CXX_FLAGS:STRING="-DNOMINMAX"

TODO: backport (2) and (3) to 3.5.0 release include -DNOMINMAX patch inside the (1) if compiler is MSVC. optional. I would also added /EHsc for msvc compiler in the cmakelists.txt

Do you prefer to create a patch against trunk?

in reply to:  9 comment:10 by mloskot, 8 years ago

Replying to rashadkm:

sucessfully built geos 3.5.0 for osgeo4W 32bit

  1. geos-3.5.0.tar.gz from http://download.osgeo.org/geos/geos-3.5.0.tar.bz2
  2. https://trac.osgeo.org/geos/browser/trunk/CMakeLists.txt?rev=4112&format=txt
  3. https://trac.osgeo.org/geos/browser/trunk/cmake/modules/GenerateSourceGroups.cmake?format=txt

and when running cmake, I added -DCMAKE_CXX_FLAGS:STRING="-DNOMINMAX"

TODO: backport (2) and (3) to 3.5.0 release include -DNOMINMAX patch inside the (1) if compiler is MSVC. optional. I would also added /EHsc for msvc compiler in the cmakelists.txt

Do you prefer to create a patch against trunk?

Great job. That is the testing I was asking for.

No need for patch, I will merge the related changes from trunk to branches/3.5.

comment:11 by mloskot, 8 years ago

Fixes merged from trunk into branches/3.5 (r4115).

Regarding publishing new source package, please post request to geos-devel mailing list.

comment:12 by rashadkm, 8 years ago

Thanks. I will post to geos-devel for updating source archive.

comment:13 by Mateusz Loskot <mateusz@…>, 7 years ago

In c1682daa/git:

CMake should not try to generate geos_svn_revision.h if GEOS is built from packaged sources.
Fixes #753

git-svn-id: http://svn.osgeo.org/geos/trunk@4112 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:14 by Mateusz Loskot <mateusz@…>, 7 years ago

In c1682daa/git:

CMake should not try to generate geos_svn_revision.h if GEOS is built from packaged sources.
Fixes #753

git-svn-id: http://svn.osgeo.org/geos/trunk@4112 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:15 by Mateusz Loskot <mateusz@…>, 7 years ago

In c1682daa/git:

CMake should not try to generate geos_svn_revision.h if GEOS is built from packaged sources.
Fixes #753

git-svn-id: http://svn.osgeo.org/geos/trunk@4112 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:16 by manuelgrizonnet, 7 years ago

Cc: manuelgrizonnet added
Component: DefaultBuild/Install (cmake)
Milestone: 3.5.13.6.2
Resolution: fixed
Status: closedreopened
Version: 3.5.03.6.1

The file cmake/modules/GenerateSourceGroups.cmake is not available in geos 3.6.1 source archive (http://download.osgeo.org/geos/geos-3.6.1.tar.bz2) which prevent to compile it using cmake on Linux.

This bug was discussing several problems which where fixed in trunk and branch 3.5 but I'm not sure what prevent to add this macro to geos source package. I'm perhaps missing something here.

Regards,

comment:17 by mloskot, 7 years ago

Resolution: fixed
Status: reopenedclosed

I'm perhaps missing something here.

Just do not use CMake to build GEOS, especially if 0) you don't want to use experimental build configuration 1) it is not working for you 2) you are not able to patch & fix it.

It is indicated in red that The official build system is the GNU Automake - https://trac.osgeo.org/geos/wiki/BuildingOnUnixWithCMake

Last edited 7 years ago by mloskot (previous) (diff)

comment:18 by rashadkm, 7 years ago

I guess fixing this bug is not hard. But to go unoffical on cmake support for this seems bad IMHO.

in case of projects with cross build, cmake does a nice job rather than using switching between nmake and autconf for windows and otherwise.

btw, the red text in wiki says official cmake support since 3.5.0.

in reply to:  17 ; comment:19 by manuelgrizonnet, 7 years ago

Replying to mloskot:

I'm perhaps missing something here.

Just do not use CMake to build GEOS, especially if 0) you don't want to use experimental build configuration 1) it is not working for you 2) you are not able to patch & fix it.

It is indicated in red that The official build system is the GNU Automake - https://trac.osgeo.org/geos/wiki/BuildingOnUnixWithCMake

Sorry I did not put much context to explain why I reopened the discussion. I was updating the geos version from 3.5 to 3.6 in the orfeo toolbox superbuild which compiles geos using cmake.

I was able to patch & fix the issue by just adding the cmake macro GenerateSourceGroups to the geos source tree:

https://github.com/orfeotoolbox/OTB/blob/update_superbuild_6.2/SuperBuild/patches/GEOS/geos-1-fixes-all.diff

geos 3.6.1 compiles with cmake without error now. Let me know if there is something I can contribute upstream to improve the support of cmake.

Best,

Manuel

in reply to:  18 comment:20 by mloskot, 7 years ago

Replying to rashadkm:

btw, the red text in wiki says official cmake support since 3.5.0.

The wording on that wiki page is a bit unfortunate as it may suggest that in terms of feature and completeness GEOS supports CMake as well as Autotools. That is not true.

CMake is just officially shipped with GEOS, but as far as my info is up to date, it is secondary build configuration that may be lacking.

in reply to:  19 comment:21 by mloskot, 7 years ago

Replying to manuelgrizonnet:

geos 3.6.1 compiles with cmake without error now. Let me know if there is something I can contribute upstream to improve the support of cmake.

I'm not involved in releasing GEOS, but AFAIU /cmake folder is not being copied into source package archive during ./autogen.sh && ./configure && make dist-bzip2 used to prepare the package.

So, seems like there is some autotools magic missing,.

comment:22 by strk, 7 years ago

Probably something that needs be added to EXTRA_DIST You're welcome to send patches, manuelgrizonnet

comment:23 by manuelgrizonnet, 7 years ago

Thanks!

I've submitted a PR:

https://github.com/OSGeo/geos/pull/85

Hope it helps.

Regards,

comment:24 by Sandro Santilli <strk@…>, 7 years ago

In 60abce6/git:

Merge pull request #85 from grizonnetm/master

ENH: add GenerateSourceGroups.cmake to EXTRA_DIST

Closes #753

Note: See TracTickets for help on using tickets.