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.
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:11GRASS_PREFIX
to point to it, e.g. for grass64_release, it might be something likeGRASS_PREFIX=/geo/osgeo/src/grass64_release/dist.x86_64-unknown-linux-gnu
. – Nikos Alexandris Dec 31 '12 at 11:54