Bug report #16034

generated build.make-files do not contain correct PyQt4-directory. Error: sip: Unable to find file "QtXml/QtXmlmod.sip".

Added by Drei Eck almost 8 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:2.18.2 Regression?:No
Operating System:arch linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:23949

Description

When building qgis 2.18.2, somewhere in the configuration the correct directory for PyQt4 does not get propagated everywhere:

In the directory where the build takes place, the files build.cmake in the directories python/CMakeFiles/[...].dir/ contain -I /usr/share/sip instead of the needed -I /usr/share/sip/PyQt4

Complete list of affected files for me (others may be affected as well when different build options are used), within the build directory:

python/CMakeFiles/generate_sip_qgis._analysis_cpp_files.dir/build.make
python/CMakeFiles/generate_sip_qgis._core_cpp_files.dir/build.make
python/CMakeFiles/generate_sip_qgis._gui_cpp_files.dir/build.make
python/CMakeFiles/generate_sip_qgis._networkanalysis_cpp_files.dir/build.make
python/CMakeFiles/python_module_qgis__analysis.dir/build.make
python/CMakeFiles/python_module_qgis__core.dir/build.make
python/CMakeFiles/python_module_qgis__gui.dir/build.make
python/CMakeFiles/python_module_qgis__networkanalysis.dir/build.make
python/CMakeFiles/python_module_qgis__server.dir/build.make

The build error which is encountered by this is:

[...]
[ 97%] Generating gui/sip_guipart0.cpp, gui/sip_guipart1.cpp, gui/sip_guipart2.cpp, gui/sip_guipart3.cpp

sip: Unable to find file "QtXml/QtXmlmod.sip" 
make[2]: *** [python/CMakeFiles/python_module_qgis__gui.dir/build.make:633: python/gui/sip_guipart0.cpp] Error 1
make[2]: *** Deleting file 'python/gui/sip_guipart0.cpp'
make[1]: *** [CMakeFiles/Makefile2:4257: python/CMakeFiles/python_module_qgis__gui.dir/all] Error 2
make: *** [Makefile:150: all] Error 2

A quick fix is to change the content of those files after the cmake-run and before the make-run. For me, the following snipped does do it, executed within the build directory, after running cmake, before running make:

  _pyqt4_sip_dir="/usr/share/sip/PyQt4" 
  sed -i "s| /usr/share/sip | ${_pyqt4_sip_dir} |" python/CMakeFiles/{python_module_qgis__analysis,python_module_qgis__gui,python_module_qgis__server,generate_sip_qgis._analysis_cpp_files,python_module_qgis__core,generate_sip_qgis._core_cpp_files,generate_sip_qgis._gui_cpp_files,generate_sip_qgis._networkanalysis_cpp_files,python_module_qgis__networkanalysis}.dir/build.make

Leading to this error, I build qgis the following way:

  mkdir build
  cd build

  _pyqt4_sip_dir="/usr/share/sip/PyQt4" 

  cmake -G "Unix Makefiles" ../ \\
    -DCMAKE_INSTALL_PREFIX=/usr \\
    -DQGIS_MANUAL_SUBDIR=share/man \\
    -DENABLE_TESTS=FALSE \\
    -DCMAKE_SKIP_RPATH=TRUE \\
    -DPYTHON_EXECUTABLE=/usr/bin/python2 \\
    -DWITH_INTERNAL_{DATEUTIL,FUTURE,HTTPLIB2,JINJA2,NOSE2,OWSLIB,PYGMENTS,PYTZ,QWTPOLAR,SIX,WEBKIT_BINDINGS,YAML}=OFF \\
    -DWITH_INTERNAL_{QEXTSERIALPORT}=ON \\
    -DPYQT4_SIP_DIR="${_pyqt4_sip_dir}" \\
    -DWITH_SERVER=ON \\
    -DWITH_GLOBE=ON \\
    -DWITH_SERVER=ON \\
    -DWITH_GLOBE=ON \\
    -DWITH_GRASS=OFF \\
    -DWITH_GRASS7=ON \\
    -DGRASS_PREFIX7=/opt/grass \\
    -DWITH_APIDOC=OFF \\
    -DWITH_ASTYLE=OFF \\
    -DWITH_BINDINGS=ON \\
    -DWITH_CUSTOM_WIDGETS=ON \\
    -DWITH_DESKTOP=ON \\
    -DWITH_ORACLE=OFF \\
    -DWITH_POSTGRESQL=ON \\
    -DWITH_PYSPATIALITE=ON \\
    -DWITH_QSPATIALITE=ON \\
    -DWITH_QTMOBILITY=ON \\
    -DWITH_QTWEBKIT=ON \\
    -DWITH_QWTPOLAR=ON \\
    -DWITH_STAGED_PLUGINS=ON \\
    -DWITH_TOUCH=ON \\
    -DWITH_TXT2TAGS_PDF=OFF \\

  make

The output of the cmake-run is:

-- QGIS version: 2.18.2 Las Palmas (21802)
-- Found GRASS 7: /opt/grass (7.0.5, off_t size = )
-- Found Proj: /usr/lib64/libproj.so
-- Found GEOS: /usr/lib/libgeos_c.so (3.5.0)
-- Found GDAL: /usr/lib/libgdal.so (2.1.1)
-- Found Expat: /lib64/libexpat.so
-- Found Spatialindex: /usr/lib64/libspatialindex.so
-- Found Qwt: /usr/lib64/libqwt.so (6.1.3)
-- Found Sqlite3: /usr/lib64/libsqlite3.so
-- Found PostgreSQL: /usr/lib/libpq.so
-- Found SpatiaLite: /usr/lib64/libspatialite.so
-- Qt WebKit support enabled
-- Found Qt version: 4.8.7
-- Using QtMobility version: system's default
-- QtMobility version: 1.2.0
-- Touch support enabled
-- Found QScintilla2: /usr/lib64/libqscintilla2.so (2.9.3)
-- Found QCA: /usr/lib64/libqca.so (2.1.1)
-- Found QCA OpenSSL plugin
-- Pedantic compiler settings enabled
-- Found Python executable: /usr/bin/python2
-- Found Python version: 2.7.13
-- Found Python library: /usr/lib64/libpython2.7.so
-- Found PyQt4 version: 4.10.4-snapshot-e52357d82574
-- Found SIP version: 4.18.1
-- Found QScintilla2 PyQt module: 2.9.3
-- Found QwtPolar: /usr/lib64/libqwtpolar.so
-- Found GSL: -L/usr/lib -lgsl -lgslcblas -lm
-- Found FCGI: /usr/lib64/libfcgi.so
-- Qsci sip file not found - disabling bindings for derived classes
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/qgis/src/qgis-2.18.2/build

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#2 Updated by matteo ghetta almost 6 years ago

  • Description updated (diff)

Is this still valid with QGIS 3, Qt 5 and python 3?

#3 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Open to Feedback

matteo ghetta wrote:

Is this still valid with QGIS 3, Qt 5 and python 3?

you must put the ticket in feedback mode when you ask a question to the issuer.

#4 Updated by Drei Eck almost 6 years ago

matteo ghetta wrote:

Is this still valid with QGIS 3, Qt 5 and python 3?

I cannot tell, I don't build QGIS anymore from source due to complicatedness, an rather install prebuilt packages when I get into the situation that I want to do something with QGIS.

#5 Updated by Jürgen Fischer almost 6 years ago

  • Resolution set to worksforme
  • Status changed from Feedback to Closed

Also available in: Atom PDF