Bug report #10614

compiling QGIS with GRASS 7 support

Added by pvanbosgeo - over 10 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GRASS
Affected QGIS version:2.18.4 Regression?:No
Operating System:Linux (Ubuntu) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19018

Description

I am trying to compile QGIS with GRASS7 support (using GDAL build with GRASS7 support - I did the 3-step approach, compiling gdal without grass, than grass and than gdal again, but with grass support), but it doesn't work. Because QGIS compiles fine without grass support, this may be related to problems with the gdal-grass integration. On the other hand, gdal compiled without problems and I can read grass raster and vector layers directly with gdal.

[ 24%] Built target gpxprovider
Scanning dependencies of target crssync
[ 24%] Building CXX object src/providers/grass/CMakeFiles/qgisgrass.dir/qgsgrass.cpp.o
[ 24%] Generating qrc_images.cxx
[ 24%] Building CXX object src/crssync/CMakeFiles/crssync.dir/main.cpp.o
Linking CXX executable ../../output/bin/crssync
[ 24%] Generating moc_qgshelpviewer.cxx
[ 24%] Generating ui_qgshelpviewerbase.h
/home/paulo/Software/spatial/Quantum-GIS/src/providers/grass/qgsgrass.cpp: In static member function ‘static void QgsGrass::setLocation(QString, QString)’:
/home/paulo/Software/spatial/Quantum-GIS/src/providers/grass/qgsgrass.cpp:381:35: error: ‘G_available_mapsets’ was not declared in this scope
char ms = G_available_mapsets();
^
/home/paulo/Software/spatial/Quantum-GIS/src/providers/grass/qgsgrass.cpp: In static member function ‘static void QgsGrass::setMapset(QString, QString, QString)’:
/home/paulo/Software/spatial/Quantum-GIS/src/providers/grass/qgsgrass.cpp:400:35: error: ‘G_available_mapsets’ was not declared in this scope
char *ms = G_available_mapsets();
^
Scanning dependencies of target qgis_help
[ 44%] Built target qgis_gui
[ 44%] Building CXX object src/providers/grass/CMakeFiles/qgisgrass.dir/qgsgrassfeatureiterator.cpp.o
make2: *
[src/providers/grass/CMakeFiles/qgisgrass.dir/qgsgrass.cpp.o] Error 1
make2: *
* Waiting for unfinished jobs....
[ 44%] Building CXX object src/helpviewer/CMakeFiles/qgis_help.dir/main.cpp.o
[ 44%] Building CXX object src/python/CMakeFiles/qgispython.dir/qgispython.cpp.o
[ 44%] Built target crssync
[ 44%] Generating analysis/sip_analysispart0.cpp, analysis/sip_analysispart1.cpp, analysis/sip_analysispart2.cpp, analysis/sip_analysispart3.cpp

[ 44%] Building CXX object src/python/CMakeFiles/qgispython.dir/qgspythonutilsimpl.cpp.o
/home/paulo/Software/spatial/Quantum-GIS/src/providers/grass/qgsgrassfeatureiterator.cpp: In constructor ‘QgsGrassFeatureSource::QgsGrassFeatureSource(const QgsGrassProvider*)’:
/home/paulo/Software/spatial/Quantum-GIS/src/providers/grass/qgsgrassfeatureiterator.cpp:619:7: warning: unused variable ‘layerId’ [-Wunused-variable]
int layerId = QgsGrassProvider::openLayer( p->mGisdbase, p->mLocation, p->mMapset, p->mMapName, p->mLayerField );
^
make1: * [src/providers/grass/CMakeFiles/qgisgrass.dir/all] Error 2
make1:
Waiting for unfinished jobs....
[ 44%] [ 44%] Building CXX object src/helpviewer/CMakeFiles/qgis_help.dir/qgshelpviewer.cpp.o
Building CXX object src/helpviewer/CMakeFiles/qgis_help.dir/moc_qgshelpviewer.cxx.o
Linking CXX shared library ../../output/lib/libqgispython.so
[ 44%] [ 44%] Built target qgispython
Building CXX object src/helpviewer/CMakeFiles/qgis_help.dir/qrc_images.cxx.o
Linking CXX executable ../../output/lib/qgis/qgis_help
[ 44%] Built target qgis_help
Scanning dependencies of target python_module_qgis__analysis
[ 44%] [ 44%] [ 44%] [ 44%] Building CXX object python/CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart0.cpp.o
Building CXX object python/CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart2.cpp.o
Building CXX object python/CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart1.cpp.o
Building CXX object python/CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart3.cpp.o
Linking CXX shared library ../output/python/qgis/_analysis.so
[ 44%] Built target python_module_qgis__analysis
make: *
* [all] Error 2

History

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

  • Category set to GRASS

#2 Updated by Tobias Schneider over 10 years ago

I don't know if this is of any help, but Synaptic tells me that the Grass70 package is defective.

#3 Updated by Giovanni Manghi over 10 years ago

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

AFAIK QGIS is not prepared to support GRASS 7 through the QGIS/GRASS plugin. On the other hand the Processing toolbox already have support for GRASS 7 modules, but for that I don't think that QGIS needs to be compiled with GRASS.

#4 Updated by pvanbosgeo - over 10 years ago

It would maybe be good what is holding back the support of GRASS through the QGIS GRASS plugin. Is it a problem with gdal (or the gdal-grass plugin) or rather a QGIS problem. This will also determine whether it is of any use to try to get this higher on the agenda of the GRASS or GDAL developers. On the other hand, if it is a QGIS issue, this can be changed to a feature request?

As for the processing toolbox, it doesn't work for me either. It tells me GRASS GIS 7 is missing or not correctly configured. It is however running without problems, and as I don't see how otherwise I can configure it to work with QGIS I am at a loss here too.

@Tobias: I compiled grass7 from source. If you see it in synaptic, did you install it through a ppa?

#5 Updated by Giovanni Manghi over 10 years ago

pvanbosgeo - wrote:

It would maybe be good what is holding back the support of GRASS through the QGIS GRASS plugin. Is it a problem with gdal (or the gdal-grass plugin) or rather a QGIS problem. This will also determine whether it is of any use to try to get this higher on the agenda of the GRASS or GDAL developers. On the other hand, if it is a QGIS issue, this can be changed to a feature request?

As for the processing toolbox, it doesn't work for me either. It tells me GRASS GIS 7 is missing or not correctly configured. It is however running without problems, and as I don't see how otherwise I can configure it to work with QGIS I am at a loss here too.

there is a long discussion here

http://lists.osgeo.org/pipermail/qgis-developer/2014-April/032305.html

but to resume the problem is also (beside de technical issues) that there is basically no one interested in investing keeping the qgis/grass plugin up to date and bug free.

on the other hand the Processing toolbox already works with GRASS 7, it is just a matter to configure it correctly in the proper QGIS menu (maybe you may want to wait for this fix too https://github.com/qgis/QGIS/pull/1487 ).

#6 Updated by pvanbosgeo - over 10 years ago

Thanks for the feedback and links. As for the processing toolbox, if you are on Linux, there does not seem to be much to configure from within QGIS. To quote from the manual, 'If you are running Linux, you just have to make sure that GRASS is correctly installed, and that it can be run without problem from a console'. Which it does in my case. But I still get the message that grass 7 is not installed or correctly configured.

#7 Updated by Giovanni Manghi over 10 years ago

pvanbosgeo - wrote:

Thanks for the feedback and links. As for the processing toolbox, if you are on Linux, there does not seem to be much to configure from within QGIS. To quote from the manual, 'If you are running Linux, you just have to make sure that GRASS is correctly installed, and that it can be run without problem from a console'. Which it does in my case. But I still get the message that grass 7 is not installed or correctly configured.

I haven't tested on Linux yet because it is too boring for me to compile a large package as GRASS. On the other hand on Windows with osgeo4w (that includes grass 7) the paths are configurable and Processing works fine (tested a few modules).

you may want to file a ticket against Processing/GRASS 7 on Linux.

#8 Updated by pvanbosgeo - over 10 years ago

I'll do that... although I got one step further. When compiling GRASS master the name of the executable is grass71 while the toolbox is (apparently) looking for grass70. Creating a link grass70 to grass71 solves that problem. But then there are other errors, which I will report in a new ticket. Thanks.

#9 Updated by Radim Blazek almost 10 years ago

Fixed in 08e39fc.

GRASS data providers work with GRASS 7, the problem was caused by changes introduced in 7.1.

#10 Updated by Saber Razmjooei over 7 years ago

  • Status changed from Closed to Reopened
  • Affected QGIS version changed from master to 2.18.4
  • OS version deleted (14.04)
  • Resolution deleted (invalid)

I am having similar problems with GRASS 7.2.1 (svn revision 70792) with both QGIS master and 2.18 branch.

#11 Updated by Saber Razmjooei over 7 years ago

  • Status changed from Reopened to Closed

Seems to be working with the latest stable GRASS

Also available in: Atom PDF