OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 112 forks source link

qgis-22: Build Fails, Translations? #26

Closed riggsd closed 10 years ago

riggsd commented 10 years ago

I had a mostly-working qgis-20 install from dakcarto's repository, and attempted the upgrade to qgis-22 today. I untapped the older repo and ran brew tap osgeo/osgeo4mac; brew tap --repair, which gave me the following warnings:

Pruned 4 dead formula
Warning: Could not tap osgeo/osgeo4mac/gdal over Homebrew/homebrew/gdal
Warning: Could not tap osgeo/osgeo4mac/orfeo over Homebrew/homebrew/orfeo
Warning: Could not tap osgeo/osgeo4mac/pdal over Homebrew/homebrew/pdal
Tapped 369 formula

I then attempted to install with brew install qgis-22 --with-postgis, which failed at a step which I don't understand, "Built target translations".

[driggs@davids-mbp ~]$ nice brew install qgis-22 --with-postgis | tee qgis_install.log
==> Installing qgis-22 dependency: postgis
==> Downloading http://download.osgeo.org/postgis/source/postgis-2.1.2.tar.gz
==> ./autogen.sh
==> ./configure --with-projdir=/usr/local --with-jsondir=/usr/local/opt/json-c --with-pgconfig=/usr/local/Cellar/postgresql/9.3.4/bin/pg_config --disable-nls
==> make
==> make install DESTDIR=/private/tmp/postgis-F2HI/postgis-2.1.2/stage
==> Caveats
To create a spatially-enabled database, see the documentation:
  http://postgis.net/docs/manual-2.1/postgis_installation.html#create_new_db_extensions
If you are currently using PostGIS 2.0+, you can go the soft upgrade path:
  ALTER EXTENSION postgis UPDATE TO "2.1.2";
Users of 1.5 and below will need to go the hard-upgrade path, see here:
  http://postgis.net/docs/manual-2.1/postgis_installation.html#upgrading

PostGIS SQL scripts installed to:
  /usr/local/share/postgis
PostGIS plugin libraries installed to:
  /usr/local/opt/postgresql/lib
PostGIS extension modules installed to:
  /usr/local/opt/postgresql/share/postgresql/extension
==> Summary
🍺  /usr/local/Cellar/postgis/2.1.2: 44 files, 8.2M, built in 61 seconds
==> Installing qgis-22
==> Downloading https://github.com/qgis/QGIS/archive/final-2_2_0.tar.gz
Already downloaded: /Library/Caches/Homebrew/qgis-22-2.2.0.tar.gz
==> Downloading https://gist.githubusercontent.com/dakcarto/9781934/raw/19d25932c8f0e1e89849cc8d2fc50a43dacfae42/qgis-22-backports.diff
==> Patching
patching file src/providers/oracle/qgsoracleprovider.cpp
patching file src/app/qgsmaptoolidentifyaction.cpp
patching file debian/changelog
patching file debian/control.jessie
patching file debian/control.precise
patching file debian/control.quantal
patching file debian/control.raring
patching file debian/control.saucy
patching file debian/control.sid
patching file debian/control.sid-oracle
patching file debian/control.trusty
patching file debian/control.wheezy
patching file debian/rules
patching file src/plugins/georeferencer/qgsgeorefplugingui.cpp
patching file src/app/qgisapp.cpp
patching file src/core/qgsapplication.cpp
patching file src/providers/postgres/qgspostgresconn.cpp
patching file src/core/qgsexpression.cpp
patching file src/providers/wms/qgswmsprovider.cpp
patching file src/mapserver/qgsprojectparser.cpp
patching file src/mapserver/qgswfsserver.cpp
patching file src/core/symbology-ng/qgslinesymbollayerv2.cpp
patching file src/core/symbology-ng/qgslinesymbollayerv2.h
patching file src/app/main.cpp
patching file src/plugins/globe/globe_plugin.cpp
patching file src/core/qgsmaptopixelgeometrysimplifier.cpp
patching file src/core/qgspallabeling.cpp
patching file python/plugins/processing/admintools/CMakeLists.txt
patching file python/plugins/processing/admintools/geoserver/catalog.py
patching file src/core/qgsmaptopixelgeometrysimplifier.cpp
patching file python/plugins/processing/admintools/CMakeLists.txt
patching file python/plugins/processing/admintools/geoserver/catalog.py
patching file src/gui/qgsattributedialog.cpp
patching file src/gui/qgsattributeeditor.cpp
patching file src/core/composer/qgsatlascomposition.cpp
patching file src/core/qgsexpression.cpp
patching file src/core/qgsexpression.h
patching file src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp
patching file tests/src/core/testqgsexpression.cpp
patching file python/analysis/vector/qgsgeometryanalyzer.sip
patching file src/plugins/roadgraph/linevectorlayerwidget.cpp
patching file src/core/symbology-ng/qgsfillsymbollayerv2.cpp
patching file src/gui/symbology-ng/qgssymbollayerv2widget.cpp
patching file src/providers/wms/qgswmsprovider.cpp
patching file src/providers/wms/qgswmsprovider.h
patching file python/core/symbology-ng/qgsvectorcolorrampv2.sip
patching file src/core/symbology-ng/qgsfillsymbollayerv2.cpp
patching file src/core/symbology-ng/qgsvectorcolorrampv2.cpp
patching file src/core/symbology-ng/qgsvectorcolorrampv2.h
patching file python/plugins/GdalTools/GdalTools.py
patching file python/plugins/GdalTools/tools/GdalTools_utils.py
==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/qgis-22/2.2.0_1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=TRUE -Wno-dev -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison -DENABLE_TESTS=FALSE -DQWT_INCLUDE_DIR=/usr/local/opt/qwt/lib/qwt.framework/Headers -DQWT_LIBRARY=/usr/local/opt/qwt/lib/qwt.framework/qwt -DQWTPOLAR_INCLUDE_DIR=/usr/local/opt/qwtpolar/lib/qwtpolar.framework/Headers -DQWTPOLAR_LIBRARY=/usr/local/opt/qwtpolar/lib/qwtpolar.framework/qwtpolar -DQSCINTILLA_INCLUDE_DIR=/usr/local/opt/qscintilla2/include/Qsci -DQSCINTILLA_LIBRARY=/usr/local/opt/qscintilla2/lib/libqscintilla2.dylib -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='/usr/local/Cellar/qgis-22/2.2.0_1/lib/qgis-dev' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=FALSE -DPYTHON_EXECUTABLE='/usr/local/Frameworks/Python.framework/Versions/2.7/bin/python' -DPYTHON_CUSTOM_FRAMEWORK='/usr/local/Frameworks/Python.framework/Versions/2.7' -DGIT_MARKER='' -DWITH_MAPSERVER=TRUE -DPOSTGRES_CONFIG=/usr/local/opt/postgresql/bin/pg_config
==> make install
    Generated 5626 translation(s) (3137 finished and 2489 unfinished)
    Ignored 5008 untranslated source text(s)
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /tmp/qgis-22-NrFy/QGIS-final-2_2_0/build/CMakeFiles  89 90 91
[  9%] Built target translations
make: *** [all] Error 2

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/osgeo/homebrew-osgeo4mac/issues

Mac OS X 10.9.2, Homebrew 0.9.5, clang Apple LLVM version 5.1 x86_64-apple-darwin13.1.0, make GNU Make 3.81.

Any suggestions on how to successfully build?

Apologies if a ticket isn't the right place to post this, but it didn't seem like the QGIS Users list was appropriate, and I don't see a list specific to OSGeo Homebrew.

dakcarto commented 10 years ago

Hi. This is the appropriate place to report issues.

Since your Mac is probably compiling using multiple cores, the text directly before the make error may be unrelated (since it can be from a different thread). Please follow the Troubleshooting Homebrew guide.

Specifically, do the following:

brew gist-logs --config --doctor qgis-22

Post a link to the generated gist here. Be sure to post the https: link from the browser bar and not the git: link.

Note: the brew tap --repair warnings are described in the tap's README.md

riggsd commented 10 years ago

Thanks for your helpful tips and patience!

Here's the gist logs: https://gist.github.com/anonymous/10306820

As I mentioned, I unlinked a mostly-working qgis-20 just before this install attempt. The survex and wxmac Doctor warnings are from an attempt at porting some unrelated cave survey software.

dakcarto commented 10 years ago

The actual error is with PyQt4:

Traceback (most recent call last):
  File "/usr/local/Cellar/pyqt/4.10.4/lib/python2.7/site-packages/PyQt4/uic/pyuic.py", line 31, in <module>
    from PyQt4 import QtCore
ImportError: No module named PyQt4
make[2]: *** [python/plugins/fTools/tools/ui_frmEliminate.py] Error 1
make[1]: *** [python/plugins/fTools/tools/CMakeFiles/fTools-tools.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

This is odd since PyQt4 was found OK during CMake configure. Do you have a different PyQt4 installed in the system Python site-packages (shouldn't matter, though)?

Try setting PYTHONPATH, prior to brew install qgis-22 ...:

 export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

This assumes Homebrew pyqt is installed and /usr/local/lib/python2.7/site-packages/ contains PyQt modules. Did you install pyqt for Python 3.x instead of Python 2.x? This would explain why the formula thinks it is installed, but then can't find it (though configure should fail then). QGIS only supports Python 2.7.

riggsd commented 10 years ago

I have only the 2.7 version of PyQT installed, from the Homebrew pyqt package which I see has the following note in its info message:

[driggs@davids-mbp ~]$ brew info pyqt
pyqt: stable 4.10.4
http://www.riverbankcomputing.co.uk/software/pyqt
/usr/local/Cellar/pyqt/4.10.3 (560 files, 17M)
  Built from source
/usr/local/Cellar/pyqt/4.10.4 (63 files, 14M) *
  Built from source
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/pyqt.rb
==> Dependencies
Required: qt ✔, sip ✔
==> Options
--with-python3
    Build with python3 support
--without-python
    Build without python support
==> Caveats
Phonon support is broken.
If you need Python to find the installed site-packages:
  mkdir -p ~/Library/Python/2.7/lib/python/site-packages
  echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

I did not make the above change to 'homebrew.pth' (which doesn't exist).

However, I do note that I have no PYTHONPATH set at all (for fear of messing with virtualenvs). So I set export PYTHONPATH=/usr/local/lib/python2.7/site-packages then attempted a build again... and now I have a working qgis-22!

On startup, I see the following warning on the console:

Warning: loading of qt translation failed [/usr/local/Cellar/qt/4.8.5/translations/qt_en_US]

But so far 2.2 appears to be working properly! Thanks!

dakcarto commented 10 years ago

Thanks for the good reports, and glad you got it working.

I was not aware of the 'homebrew.pth' setup. That seems to be a caveat when Homebrew notices you built pyqt against the system Python, instead of Homebrew's. The 'homebrew.pth' setup allows for a fixed solution compared to setting PYTHONPATH.

Did you install pyqt before installing Homebrew's python? This would explain some stuff. If so, I recommend:

brew rm pyqt && brew install pyqt
# brew reinstall pyqt <-- should work, but not entirely sure it won't use the system Python again

The Warning: loading of qt translation failed... is just the fact that QGIS.app doesn't have a qt_en_US translation, as that is already the default. It's a Mac-only bug that needs fixed, and is harmless.

dakcarto commented 10 years ago

@riggsd Btw, I do quite a bit of cave exploration in Jewel Cave, in SD, and Lechuguilla, in NM.

http://myotisoft.com/ looks very interesting.