Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am on Ubuntu building qgis with grass plugin. I have build grass code separately and used --prefix to provide the path

GRASS_PREFIX is /usr/local/grass-6.4.2 and GRASS_INCLUDE_DIR is /usr/local/grass-6.4.2/include and LIB_PATH is /usr/local/grass-6.4.2/lib/libgrass_gproj.so. I have unchecked WITH_GRASS

When I compile qgis I get the following

[  0%] Built target version
[ 17%] Built target qgis_core
[ 19%] Built target qgis_analysis
[ 19%] Built target qgis_networkanalysis
[ 27%] Built target ui
[ 40%] Built target qgis_gui
[ 40%] Built target memoryprovider
[ 41%] Built target delimitedtextprovider
[ 42%] Built target osmprovider
[ 43%] Built target qgissqlanyconnection
[ 44%] Built target sqlanywhereprovider
[ 44%] Built target gdalprovider
[ 45%] Built target mssqlprovider
[ 47%] Built target postgresprovider
[ 48%] Built target spatialiteprovider
[ 48%] Built target crssync
[ 73%] Built target qgis
[ 75%] Built target diagramoverlay
[ 76%] Built target interpolationplugin
[ 76%] Built target dxf2shpconverterplugin
[ 77%] Built target spatialqueryplugin
[ 78%] Built target sqlanywhereplugin
[ 79%] Built target roadgraphplugin
[ 80%] Built target zonalstatisticsplugin
Linking CXX shared module ../../../output/lib/qgis/plugins/libgrassplugin.so
/usr/bin/ld: cannot find -lqgisgrass
collect2: ld returned 1 exit status
make[2]: *** [output/lib/qgis/plugins/libgrassplugin.so] Error 1
make[1]: *** [src/plugins/grass/CMakeFiles/grassplugin.dir/all] Error 2
make: *** [all] Error 2

Please let me the what I am missing. Thank you.

Regards, Srikanth


I solved it. I can see the grass plugin in qgis. But the plugin is not able to find the grass utilities. Then I tried to build using WITH_GRASS = yes; to link the grassplugin to grass, then I get the following. I think it says there is a build directory issue. I can't figure how do I fix it. Please advice.

Found GRASS: /usr/lib/grass64 (6.4.2)
Touch support disabled
Found Proj: /usr/lib/libproj.so
Found GEOS: /usr/lib/libgeos_c.so
Found GDAL: /usr/lib/libgdal.so (1.9.1)
Found Expat: /usr/lib/x86_64-linux-gnu/libexpat.so
Found Spatialindex: /usr/lib/libspatialindex.so
Found Qwt: /usr/lib/libqwt-qt4.so (5.2.2)
Found Sqlite3: /usr/lib/x86_64-linux-gnu/libsqlite3.so
Found SpatiaLite: /usr/lib/libspatialite.so
Pedantic compiler settings enabled
Debug output enabled
Found Python executable: /usr/bin/python
Found Python version: 2.7.3
Found Python library: /usr/lib/libpython2.7.so
Found SIP version: 4.13.2
Found PyQt4 version: 4.9.1
CMake Error at src/plugins/grass/CMakeLists.txt:116 (ADD_LIBRARY):
  add_library cannot create target "grassplugin" because another target with
  the same name already exists.  The existing target is a module library
  created in source directory
  "/home/develop1/QGIS_Develop/qgis-1.8.0/src/plugins/grass".  See
  documentation for policy CMP0002 for more details.


CMake Error at src/plugins/grass/CMakeLists.txt:140 (TARGET_LINK_LIBRARIES):
  Attempt to add link library "qgisgrass" to target "grassplugin" which is
  not built in this directory.


CMake Error at src/plugins/grass/CMakeLists.txt:140 (TARGET_LINK_LIBRARIES):
  Attempt to add link library "qgis_gui" to target "grassplugin" which is not
  built in this directory.


CMake Error at src/plugins/grass/CMakeLists.txt:140 (TARGET_LINK_LIBRARIES):
  Attempt to add link library "util" to target "grassplugin" which is not
  built in this directory.


CMake Error at src/plugins/grass/CMakeLists.txt:150 (ADD_EXECUTABLE):
  add_executable cannot create target "qgis.g.browser" because another target
  with the same name already exists.  The existing target is an executable
  created in source directory
  "/home/develop1/QGIS_Develop/qgis-1.8.0/src/plugins/grass".  See
  documentation for policy CMP0002 for more details.


CMake Error at src/plugins/grass/CMakeLists.txt:152 (TARGET_LINK_LIBRARIES):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libQtGui.so" to
  target "qgis.g.browser" which is not built in this directory.


CMake Error at src/plugins/grass/CMakeLists.txt:152 (TARGET_LINK_LIBRARIES):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libQtCore.so" to
  target "qgis.g.browser" which is not built in this directory.


CMake Error at src/plugins/grass/CMakeLists.txt:160 (INSTALL):
  install TARGETS given target "grassplugin" which does not exist in this
  directory.


CMake Error at src/plugins/grass/CMakeLists.txt:172 (INSTALL):
  install TARGETS given target "qgis.g.browser" which does not exist in this
  directory.
share|improve this question
    
It is attempting to build against libqgisgrass.so but cannot find it. Run find / -name libqgisgrass.so; does it return anything? I think it is typically is /usr/lib and that is where it is for me in Arch Linux. –  RomaH Nov 26 '12 at 19:11
    
Of course it might not be there while building. –  RomaH Nov 26 '12 at 19:35
    
In case you also compiled grass from source, and, run directly the produced grass-binary (i.e. you do not install grass), you can set GRASS_PREFIX to point to it, e.g. for grass64_release, it might be something like GRASS_PREFIX=/geo/osgeo/src/grass64_release/dist.x86_64-unknown-linux-gnu. –  Nikos Alexandris Dec 31 '12 at 11:54
add comment

2 Answers 2

Unless you have a special reason (you are customizing the code for instance), you should use the UbuntuGIS repository.

The 10.04 LTS Lucid repository section is loaded with stable GIS tools including QGIS, GRASS, GDAL 1.9.2, Spatialite and PostGIS. The 12.04 LTS Precise section has nearly as much available and prebuilt, ready to run. More information is available at UbuntuGIS page in Ubuntu Wiki

Someone else may be able to answer your compiling/building questions. Good luck with your coding!

share|improve this answer
    
I don't think there is QGIS 1.8 package for quantal yet(?), if that is why he is building. However, your could use apt-get build-dep qgis that should and hopefully get you all your dependences (for 1.7.5, though nothing drastic should have changed) if you missed one. However, I am not sure if it will satisify against built packages greater then what is available in the repos. –  RomaH Nov 26 '12 at 20:42
    
Yes. I am customizing the code to address few specific requirements and need to get that working. –  Srikanth Nov 27 '12 at 5:40
    
Yes. I am customizing the code to address few specific requirements and need to get that working. @RomaH I have installed in qgis (1.8.0) using the repository to satisfy the dependencies apt-get build-dep qgis but no use. I have libqgisgrass.so.1.8.0 in /usr/lib but could not detect it. –  Srikanth Nov 27 '12 at 6:24
    
I solved it. I had to rename libqgisgrass.so.1.8.0 to libqgisgrass.so :) –  Srikanth Nov 27 '12 at 9:27
    
Okay great as long as renaming didn't break anything, ha! You might make a copy or link of the file to be sure. You might also submit your own answer and accept it after the wait period to wrap up the question. –  RomaH Nov 27 '12 at 13:34
show 3 more comments

To compile Quantum GIS from source, including access to GRASS-GIS' (version 6.4) modules, a working GRASS-GIS installation is required. GRASS-GIS can be installed within Ubuntu in various ways, for example

Note, most likely an appropriate entry in the /etc/ld.so.conf file (or in a dedicated file inside ld.so.conf.d/ directory, customarily named with an .conf extension) will be necessary so a runnning QuantumGIS can detect the QGIS-GRASS plugin libqgisgrass.so. The entry might be like /geo/osgeo/src/grass64_release/dist.x86_64-unknown-linux-gnu/lib or similar -- it should point to GRASS librairies!

Having GRASS-GIS running on a system, QGIS can be compiled from source as documented in the INSTALL file included in QGIS' source code repository. In short, given that pre-required build tools and package dependencies are installed and functional, the steps are:

  • getting the latest source code, using for example git
git clone git://github.com/qgis/Quantum-GIS.git
  • or downloading a compressed package of the latest stable version (as of this answer's date 1.8) using wget and decompress it
wget http://qgis.org/downloads/qgis-1.8.0.tar.bz2
tar xvzf qgis_1.1.0.tar.gz
  • enter (or create inside the QGIS source code directory) the directory where the compilation will take place and run the ccmake configuration tool
cd QuantumGIS
mkdir build
cd build
ccmake ..

At this point, don't forget to define the GRASS_PREFIX parameter, i.e. set it to the directory that holds GRASS-GIS' in your system (might be /usr/lib/grass64 or even /some/directory/grass64_release/dist.x86_64-unknown-linux-gnu in case you don't install GRASS-GIS system/user-wide)

Micha Silver recommends in a relevant blog-post, titled Compiling QGIS on Fedora 10, to check the configuration before compiling by instructing ccmake -L. If no errors are encountered, go trough the actual compilation using make (note, without sudo). In case of errors (e.g. untraceable librairies) go through the respective manuals, fora and public mailiing lists. The installation can be completed then simply by executing sudo make install.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.