Feature request #2785

[Cmake] FindGRASS.cmake issue

Added by Nikos Ves over 14 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Build/Install
Pull Request or Patch supplied: Resolution:invalid
Easy fix?:No Copied to github as #:12845

Description

when point qgis at grass lib

 CMake Error at src/plugins/grass/CMakeLists.txt:8 (MESSAGE):
   Your GRASS version is not supported
   (/home/nikos/src/qgis-src/src/plugins/grass/modules-7.0 is not found).

which I'm pretty sure i dont have grass7 installed. Maybe grass6rc6 reports itself as 7?

Grass 6RC6 can be downloaded either from grass site or from ubuntugis ppa.
t
The problem must be in <qgis-source>/src/pluging/grass/CMakeLists.txt

IF (GRASS_NUM_VERSION LESS 60300)
  SET (GRASS_MODULES_DIR "modules-6.3")
ELSE (GRASS_NUM_VERSION LESS 60300)
  SET (GRASS_MODULES_DIR "modules-${GRASS_MAJOR_VERSION}.${GRASS_MINOR_VERSION}")
ENDIF (GRASS_NUM_VERSION LESS 60300)

Im not pretending that i know anything ccmake files before but the if looks a bit off

History

#1 Updated by Jürgen Fischer over 14 years ago

QGIS builds fine with GRASS 6.4.0rc6 here. Which GRASS version is found? Please quote the line from your build:

...
-- Found GRASS: /usr/lib/grass64 (6.4.0+42329)
...

#2 Updated by Nikos Ves over 14 years ago

grass -v

GRASS GIS 6.4.0RC6

#3 Updated by Jürgen Fischer over 14 years ago

Replying to [comment:2 vesnikos]:

grass -v

> GRASS GIS 6.4.0RC6

Sorry, I meant the output from cmake.

#4 Updated by Paolo Cavallini over 14 years ago

I confirm, it builds fine here, on two different architectures. Perhaps a leftover from another previous install?
Can you please check on anther similar machine?

#5 Updated by Nikos Ves over 14 years ago

I think I found the problem:
ccmake cache doesn't refresh, even if you change grass_prefix when you run ccmake to parse its variables.

It found a previous installation of grass 7 (which was in userland )

to recap: ccmake grass_prefix was pointing explicitly in /usr/lib/grass64
and ccmake (from a previous install, by locate? - i couldn't confirm this) was pointing in ~/grass7-src

#6 Updated by Nikos Ves over 14 years ago

more info:

findGRASS.cmake tries to find version.h in folder <grass-src>/include

but for grass6rc6 version.h is present as VERSION ( http://trac.osgeo.org/grass/browser/grass/tags/release_20100320_grass_6_4_0RC6/include/VERSION )

there isn't a version.h file (or at least I can't find one )

#7 Updated by Nikos Ves over 14 years ago

more additional info:

from http://www.mail-archive.com/[email protected]/msg07252.html

# ^ and $ appear to be non-functional in practice. This makes it
# impossible to code a non-trivial regex in CMake script.  This in turn
# forces the user to find or install other tools that can do so, rather
# than keeping their scripting logic self-contained in CMake.
#
# ^ and $ work work with respect to an entire <input> to STRING().
# That is to say, an <input> is treated as one line.  The <input>
# does not preserve newlines, even if it is read from a multi-line file.
# The following code snippet demonstrates that ^ and $ will only
# match at the beginning and end of a file, when the file is read in as
# an <input> string.

one that was suggested was

 STRING(REGEX REPLACE "\
?\
" ";" ENT "${input}")
 FOREACH(line ${ENT})
 # do the match on each line

#8 Updated by Jürgen Fischer over 14 years ago

Replying to [comment:6 vesnikos]:

more info:

findGRASS.cmake tries to find version.h in folder <grass-src>/include

but for grass6rc6 version.h is present as VERSION ( http://trac.osgeo.org/grass/browser/grass/tags/release_20100320_grass_6_4_0RC6/include/VERSION )

there isn't a version.h file (or at least I can't find one )

#9 Updated by Jürgen Fischer over 14 years ago

vesnikos, any news on this? Looks more like a GRASS installation problem on your end (missing version.h).

#10 Updated by Nikos Ves over 14 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

Should have closed that bug ages ago.

Problem lies that in clarification in the documentation: Nowhere states that qgis is NOT compatible with grass70 - just says GRASS, no version

The another issued thats needs confirmation (its been couple of weeks since i've tested it) is that GRASS_PREFIX is not being refreshed if you install another version of grass (maybe grass6RC6, after grass70svn) with the correct path. Not even a conflict error. Maybe if there are more than one grass installations, user should choose manually the path?

and the third and most major: The grass60RC6 package that comes from ubuntus' ubuntugis/unstable ppa is not compatible with qgis to be build with grass support. I had to compile from source to get grass support.

Imho findgrass.cmake is a bit hackish, and needs some love to become more robust.
Since qgis comes to be the frontend of grass, its a shame people to stumble in such annoyances

I'll close the bug, and I hope none took offence in the comments above.

#11 Updated by Jürgen Fischer over 14 years ago

Replying to [comment:11 vesnikos]:

and the third and most major: The grass60RC6 package that comes from ubuntus' ubuntugis/unstable ppa is not compatible with qgis to be build with grass support. I had to compile from source to get grass support.

Incompatible in which way?

#12 Updated by Nikos Ves over 14 years ago

Its been a while, it has something to do with the packages' "include" folder.If i remember correctly the binary package doesn't install the "include" files ( where grass' version.h residences) and there isn't a -devel package provided by the ppa.

hence if you install grass60rc6 from ubunbugis/unstable you're not able to compile qgis with grass support.

After monday, i can do some tests with a virtual machine and test this, and open a new bug if needed

#13 Updated by Giovanni Manghi over 14 years ago

hence if you install grass60rc6 from ubunbugis/unstable you're not able to compile qgis with grass support.

I can compile every day qgis with GRASS support using GRASS installed with the ubuntugis-unstable repository.

#14 Updated by Nikos Ves over 14 years ago

Replying to [comment:14 lutra]:

I can compile every day qgis with GRASS support using GRASS installed with the ubuntugis-unstable repository.

where does your grass_prefix points at, when running ccmake ?

#15 Updated by Jürgen Fischer over 14 years ago

Replying to [comment:15 vesnikos]:

Replying to [comment:14 lutra]:

I can compile every day qgis with GRASS support using GRASS installed with the ubuntugis-unstable repository.

where does your grass_prefix points at, when running ccmake ?

Also available in: Atom PDF