Opened 7 years ago

Closed 4 years ago

#55288 closed defect (fixed)

QGIS Fails to Configure/Install - CMAKE cannot find FindQJSON

Reported by: jambonrose (Andrew Pinkham) Owned by: Veence (Vincent)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc:
Port: QGIS

Description

Running macOS 10.11.6 (15G17023)

$ /usr/bin/xcodebuild -version
Xcode 8.2.1
Build version 8C1002

$ port version
Version: 2.4.2

$ port installed
The following ports are currently installed:
  bash @4.4.12_0 (active)
  expat @2.2.5_0 (active)
  gettext @0.19.8.1_0 (active)
  libiconv @1.15_0 (active)
  ncurses @6.0-20170916_0 (active)

$ echo $CFLAGS 
-I/opt/local/include

$ echo $LDFLAGS 
-L/opt/local/lib

$ sudo port clean qgis && sudo port install qgis

I've attached the output of the last command, as it is quite long. The output directs me to a QGIS log, which in turn directs me to a CMAKE log, so I have attached both of those as well.

I am not familiar with the logs, but a few items jump out at me.

The first two are failing substitutions, first in qwt (seen in terminal output), and then in qgis (seen in the qgis log).

Warning: reinplace s|QT_STATIC_CONST|static const| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_qwt/qwt61/work/qwt-6.1.3/src/qwt_scale_map.cpp
Warning: reinplace s|QT_STATIC_CONST|static const| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_qwt/qwt61/work/qwt-6.1.3/src/qwt_scale_map.h
:info:configure --->  Patching FindPythonLibrary.cmake: s|Versions/Current|Versions/3.6|
:debug:configure Executing reinplace: /usr/bin/sed -E s|Versions/Current|Versions/3.6| </opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_qgis/QGIS/work/QGIS-2_18_13/cmake/FindPythonLibrary.cmake >@file10
:warn:configure reinplace s|Versions/Current|Versions/3.6| didn't change anything in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_qgis/QGIS/work/QGIS-2_18_13/cmake/FindPythonLibrary.cmake

The second is a warning during configuration, found in the qgis log.

:info:configure CMake Warning at CMakeLists.txt:320 (FIND_PACKAGE):
:info:configure   By not providing "FindQJSON.cmake" in CMAKE_MODULE_PATH this project has
:info:configure   asked CMake to find a package configuration file provided by "QJSON", but
:info:configure   CMake did not find one.
:info:configure   Could not find a package configuration file provided by "QJSON" with any of
:info:configure   the following names:
:info:configure     QJSONConfig.cmake
:info:configure     qjson-config.cmake
:info:configure   Add the installation prefix of "QJSON" to CMAKE_PREFIX_PATH or set
:info:configure   "QJSON_DIR" to a directory containing one of the above files.  If "QJSON"
:info:configure   provides a separate development package or SDK, be sure it has been
:info:configure   installed.

I've tried setting both CMAKE_PREFIX_PATH and QJSON_DIR, but as I don't know what it's expecting, my efforts haven't yielded any changes yet.

Attachments (3)

gqis_terminal_output.txt (62.1 KB) - added by jambonrose (Andrew Pinkham) 7 years ago.
qgis_debug.log (276.1 KB) - added by jambonrose (Andrew Pinkham) 7 years ago.
qgis_CMakeOutput.log (33.1 KB) - added by jambonrose (Andrew Pinkham) 7 years ago.

Download all attachments as: .zip

Change History (17)

Changed 7 years ago by jambonrose (Andrew Pinkham)

Attachment: gqis_terminal_output.txt added

Changed 7 years ago by jambonrose (Andrew Pinkham)

Attachment: qgis_debug.log added

Changed 7 years ago by jambonrose (Andrew Pinkham)

Attachment: qgis_CMakeOutput.log added

comment:1 Changed 7 years ago by jambonrose (Andrew Pinkham)

Cc: jambonrose added

comment:2 Changed 7 years ago by jambonrose (Andrew Pinkham)

Cc: jambonrose removed

comment:3 Changed 7 years ago by mf2k (Frank Schima)

Cc: Veence removed
Owner: set to Veence
Status: newassigned

comment:4 Changed 7 years ago by Veence (Vincent)

Yeah, will look into that this weekend.

comment:5 Changed 7 years ago by jambonrose (Andrew Pinkham)

Thanks Vincent, I really appreciate it.

comment:6 Changed 7 years ago by jambonrose (Andrew Pinkham)

I think I've figured it out, but this comes with a "it works on my computer" warning.

In short, there are two problems with installing QGIS in my environment right now:

  1. Missing spatialite dependency
  2. Mixed file-naming expectations around QJSON-qt5Config.cmake/QJSONConfig.cmake

During my original read of the logs, I missed the errors about missing variables SPATIALITE_INCLUDE_DIR and SPATIALITE_LIBRARY. However, spatialite is not installed by the QGIS port. No sweat:

$ sudo port install spatialite

I was then able to fix the QJSON configuration problem by changing the file named QJSON-qt5Config.cmake to QJSONConfig.cmake. I was then able to configure and build QGIS. However, Macports now errors, as shown below.

$ sudo port clean qgis && sudo port install qgis
--->  Cleaning QGIS
--->  Computing dependencies for QGIS
--->  Fetching archive for QGIS
--->  Attempting to fetch QGIS-2_18_13_2+postgresql96+qt5.darwin_15.x86_64.tbz2 from https://packages.macports.org/QGIS
--->  Attempting to fetch QGIS-2_18_13_2+postgresql96+qt5.darwin_15.x86_64.tbz2 from http://ywg.ca.packages.macports.org/mirror/macports/packages/QGIS
--->  Attempting to fetch QGIS-2_18_13_2+postgresql96+qt5.darwin_15.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/QGIS
--->  Fetching distfiles for QGIS
--->  Verifying checksums for QGIS
--->  Extracting QGIS
--->  Applying patches to QGIS
--->  Configuring QGIS
--->  Building QGIS
--->  Staging QGIS into destroot
--->  Installing QGIS @2_18_13_2+postgresql96+qt5
--->  Activating QGIS @2_18_13_2+postgresql96+qt5
--->  Cleaning QGIS
--->  Updating database of binaries
Warning: Error determining file type of `/opt/local/lib/cmake/qjson-qt5/QJSON-qt5Config.cmake': lstat(/opt/local/lib/cmake/qjson-qt5/QJSON-qt5Config.cmake):no such file or directory
Warning: A file belonging to the `qjson-qt5' port is missing or unreadable. Consider reinstalling it.
--->  Scanning binaries for linking errors               
--->  No broken files found.  

CMake wants the file in once place, while Macports wants it in another.

Instead of moving the file, I copied it.

$ sudo cp /opt/local/lib/cmake/qjson-qt5/QJSON-qt5Config.cmake /opt/local/lib/cmake/qjson-qt5/QJSONConfig.cmake

With these changes in place, running sudo port clean qgis && sudo port install qgis allowed me to configure, build and install QGIS.

Hopefully this makes your weekend easier.

comment:7 Changed 7 years ago by Veence (Vincent)

Jambonrose :P

Ok, I corrected for the missing dependency in QGIS. Thanks!

For QJSON and QT5 it’s slightly more complex.

comment:8 Changed 7 years ago by Veence (Vincent)

Does it work now?

comment:9 Changed 7 years ago by jambonrose (Andrew Pinkham)

I'll reinstall tomorrow and let you know how it goes.

comment:10 Changed 7 years ago by Veence (Vincent)

Thanks

comment:11 Changed 7 years ago by jambonrose (Andrew Pinkham)

Finally had a moment to come back to this.

Unfortunately, attempting to install the QT5 variant raises an error.

$ sudo port install qgis +postgresql96 +qt5
Error: qgis: Error executing qt5: invalid command name "ui_err"
Error: Unable to open port: Error evaluating variants

I'm going to try to install the QT4 version first; QT4 causes problems with the rest of my environment, so I'll then round back for the QT5 version. I'll keep you posted as I go.

comment:12 Changed 7 years ago by jambonrose (Andrew Pinkham)

The error I was seeing above was due to typo in the Portfile. I've opened a PR to fix the issue.

https://github.com/macports/macports-ports/pull/1331

For the QT4 installation: Installation still errors during the configuration stage. I'm still seeing errors from CMake, but my earlier solution failed to fix the problem. I'll try debugging, as well as giving the qgis3 port a whirl.

comment:13 Changed 7 years ago by jambonrose (Andrew Pinkham)

The QGIS3 port works great! Thanks very much!

I was not able to get to the bottom of what was going on vis-a-vis the QGIS port and the troubles with CMake. Given the amount of time that it takes to build QGIS, I have to postpone further debugging for a little bit, as I need to work with QGIS for the next few weeks.

I'll follow back up as soon as I can.

Thanks again!

comment:14 Changed 4 years ago by Veence (Vincent)

Resolution: fixed
Status: assignedclosed
  • Outdated -
Note: See TracTickets for help on using tickets.