Tag Archive for 'Mac OS X'

Quantum GIS and Homebrew, Pt. 1

A few weeks ago I decided to give Homebrew as package manager a try and move some of my projects to Mac OS X as development platform. Until now I really liked the advantages of using Ubuntu as virtual machine, have development dependencies separated from my day-to-day system, safely try stuff out and be able to rollback to a snapshot if something goes terribly wrong. Sharing hardware resources is obviously the drawback of given setup, which basically made me think about alternatives.

Homebrew is great so far: very easy to setup, integrates well with Mac OS X, large repository and a great “Formula” system to add your own packages.

When it comes to GIS applications and libraries on Mac OS X, William Kyngesburye’s site is one of the best resources you’ll find out there. I used his’ downloads quite a bit. But with the move to Homebrew, I also had the intention to manage my GIS packages with it. Although Homebrew doesn’t provide user friendly double-click-to-install packages, like William does, its Terminal commands are simple enough:

$ brew install mypackage

Drawback of having Homebrew manage my GIS dependencies was, as I noticed immediately, that William’s Quantum GIS package didn’t work any longer. So I decided to build Quantum GIS on my own, from source, against dependencies managed by Homebrew. The entire build process is very well documented on QGIS’s wiki. Using Homebrew for getting all dependencies is as simple as:

$ brew install python --framework --universal
$ brew install postgis qt gdal geos proj \
sqlite libspatialite libiconv gsl pyqt qwt cmake

I edited the existing SIP-Formula slightly (added a “–universal” option) to meet QGIS’ requirements on Mac OS X.

$ brew install sip --universal

Next step is to configure and make QGIS. Some paths and libs weren’t found automatically by cmake, so I had to specify them:

$ cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=TRUE \
-D QWT_LIBRARY=/usr/local/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/include \
-D GEOS_INCLUDE_DIR=/usr/local/include \
-D GEOS_LIBRARY=/usr/local/lib/libgeos_c.dylib \
-D GDAL_INCLUDE_DIR=/usr/local/include \
-D GDAL_LIBRARY=/usr/local/lib/libgdal.dylib \
-D GSL_INCLUDE_DIR=/usr/local/include \
-D GSL_LIBRARIES=/usr/local/lib/libgsl.dylib \
-D POSTGRES_INCLUDE_DIR=/usr/local/include \
-D POSTGRES_LIBRARY=/usr/local/lib/libpq.dylib \
-D PYTHON_EXECUTABLE=/usr/local/bin/python2.7 \
..
$ make
$ make install

…produces the QGIS.app in your ~/Applications folder.

The Homebrew Formula for QGIS that I’ve started, doesn’t make a successful QGIS build yet. It fails somewhere at

Linking CXX shared library libqgis_analysis.dylib
[ 33%] Built target qgis_analysis
make: *** [all] Error 2

…although Homebrew is basically building against the same dependencies as my “manual” steps did – working on it.

So far so good. However, the bad news, maybe just in my case, is that QGIS seems to be linked to Mac OS 10.6 original Python version 2.6.1 and throws following error at startup:

Couldn’t load SIP module. (note: SIP is installed in /usr/local/bin)
Python support will be disabled.

Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named sip

Python version:
2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)]

Major downer here is the second line, “disabled Python”, which means most plugins won’t work. This is major since one of Quantum GIS’ strength is its plugin-architecture.

To be continued…

Shared Folders

…is something you may consider turning off if you’re unhappy with VMware Fusion’s performance.

As for ArcGIS Desktop, it works noticeable faster in VMware Fusion (aff link) if the entire workspace is moved inside the VMware image instead of accessed via “Shared Folders”. ArcMap feels snappier and geoprocessing runs about 35% faster as my quick benchmark showed. Performance issues caused by “Shared Folders” is mentioned at an ESRI Discussion thread too.

My benchmark test was just a geoprocessing task I needed to do for a project, executed in 3 different workspace environments:

#1 – inside the VMware image
#2 – on an external USB harddisk, mounted in Windows
#3 – on an external USB harddisk, mounted in Mac OS X and accessed through VMware Fusion’s Shared Folders feature

The task was to intersect 2 layers, everything done inside a File Geodatabase:

Layer A: 11,932 features (20,4361 vertices)
Layer B: 3,100 features (arcs from point buffering)

The intersect-process returned a 300MB feature class containing 952,265 features and 5,724,810 vertices. Below is the chart showing the time needed to complete the task for each workspace environment.

ArcGIS geoprocessing task performance in different workspace environments
VMware Fusion ArcGIS geoprocessing performance

In figures, option #1 took 8 minutes 57 seconds, option #2 9 minutes 3 seconds and option #3 needed 13 minutes 29 seconds to finish.

Clearly, the performance bottleneck in VMware Fusion is “Shared folders”. No doubt, it’s a handy feature and makes file sharing between host and guest-OS very easy, but for performance reasons you better turn it off.

Once in benchmarking-mood I ran the same task with increased memory and 2 CPUs. Out of curiosity, just to see the effect of more memory and CPU power. My standard setting for VMware Fusion is 1 CPU and 512MB RAM allocated to the guest-OS, which turned out to be the best setting for working at decent speeds in both host and guest-OS so far. The result for the same geoprocessing task with 2 CPUs and 1024MB RAM was 8 minutes 17 seconds. Little faster, but, because of experiencing a sluggish host Mac OS X, not worth it.

Despite performance I ran into another problem with “Shared Folders” and File Geodatabases a while ago. Well, I actually never verified that this problem is related to “Shared Folders”: a File Geodatabase corrupted while executing “compact database” in a “Shared Folder” workspace. According to that thread at ESRI it happened on network drives too. However, I experienced it only in “Shared Folders”, not in other workspace environments. Quite annoying bug though.

VMware Fusion

FOSS GIS sandbox

That’s what I actually had in mind: creating a local Sandbox in VMware for testing GeoServer in conjunction with other FOSS GIS software. As it turned out, it’s not necessary to set such a system up by myself. Ricardo Pinho did it already and made a VMware image already available:

GISVM is intended to be a full-feature GIS Workstation based exclusively on free GIS software: PostgreSQL, PostGIS, GeoServer, Mapserver, FWTools, QGIS/GRASS, gvSIG, uDIG and Kosmo, on Ubuntu Desktop.

Great work! Exactly what I wanted. It’s a huge time saver. GISVM gives you a feel what FOSS GIS software can do for you, without going through any installation and configuration hassles.

uDig accessing GeoServer WFS in GISVM

GISVM works well as sandbox in VMware Fusion (aff link) here on the MacBook (1 processor and 512MB RAM enabled) , although it asked for upgrading the image file and installing VMware Tools for better performance.

VMware Fusion

Moving ArcGIS to VMware Fusion

After the upgrade to Mac OS 10.5 I decided not to use Boot Camp any longer and switch entirely to a virtualization solution. Mainly because Boot Camp is limited to the primary (internal) hard drive and occupies a lot of disk space which I want to use for some other things now. A virtual machine I can run from an external hard drive too and move it to wherever I want.

My copy of Parallels Desktop (aff link) transfered the existing Windows XP installation from the Boot Camp partition to a new virtual disk image flawlessly. Problems started later when I tried to start the image for the 2nd time. The disk image apparently corrupted and I had to install everything from scratch again. After hours of Windows and ArcGIS installations, the disk image corrupted again when I tried to restart the virtual machine. I wasn’t able to find out what caused the problem, wasn’t in the mood to spend another couple of hours with basic set ups either and started looking for alternative virtualization solutions.

The next version of Parallels Desktop’s main competitor, VMware Fusion (aff link), is currently in beta and until 2nd Oct 2008 they are offering free beta licenses.

Their website lists all new features and enhancements. From my point of view – not doing any benchmarks, just trying to complete basic ArcGIS tasks in Windows – it feels snappy enough and has useful features like unity mode, snapshots, mirrored and shared folders, which you can add to the virtual machine while it’s running.

I didn’t encounter any problems setting up and running ArcGIS in VMware Fusion. Whereas I didn’t do any geoprocessing tasks yet. Geoprocessing worked well in Parallels and I expect it to do so in VMware Fusion too. If not, I’ll post it here.

However, while working with grids I noticed an issue: my ArcGIS workspace was a subfolder within the mirrored Documents directory in Mac OS X. In that environment, an ESRI grid file I was working with wasn’t fully accessible in ArcGIS. After I copied the entire workspace inside the virtual machine, everything worked fine again. Maybe it’s related to HFS, the Mac OS filesystem.

VMware Fusion

Steven and Roman brought my attention to Sun’s open source virtualization solution called Virtualbox. I tried that one too – it does a fairly good job, not as advanced as VMware Fusion though, but well documented and highly customizable. If you own a Mac, need Windows (or Solaris, Linux, FreeBSD, etc.) and prefer open source, go with VirtualBox.

Another interesting detail is that VMware Fusion is pretty active on Twitter. At least they are scanning Twitter for Tweets about their products and they even respond to those tweets – clever marketing I guess. Though I don’t how far it goes and if you can use Twitter for quick support questions. Would be very convenient.

Mac OS X Leopard Amazon discounts

Amazon (.de) is giving away 10 EUR discounts if you order Mac OS X Leopard v10.5 before 1.11.2007. Just go there and enter following code to your order: AMZNLPRDAPPL.

It’s Amazon Germany and the code is probably only valid there.

I personally will wait until all the “Leopard shredded my disk and drank all my beer” whining is gone and the system is stable and ready for productive use. So let’s say starting with 10.5.2.

VM performance on the Mac

Parallels DesktopCNET has an article about virtualization solutions for running Windows on a Mac and posted some benchmark results for the most popular applications: VMware Fusion 1.1 and Parallels Desktop 3.0 for Mac (aff links).

I’m using Parallels Desktop mainly for working with ArcGIS on my MacBook, which works quite well (more info on that). For completing heavy tasks, where I could use some extra spice, I usually restart into BootCamp.

So I found it interesting that Fusion significantly outperforms Parallels. Taking a closer look at the article, things became clearer: Fusion makes use of multiple cores while Parallels only uses one single CPU core. The benchmark limited to only one core shows very similar results.

VMware Fusion

I suppose Parallels will catch up on that issue and won’t try Fusion, since I think both of them are not quite compatible and I’m really not in the mood of setting up Windows again if something breaks (never change a running system!).

If you’re setting up a new environment for using ArcGIS on a Mac, I’d recommend giving VMware’s Fusion a try.

Google Reader Theme

Google Reader ThemeBeing a big fan of Google Reader, for reasons like keyboard short-cuts or tags instead of folders, I’m really glad to have finally found this Google Reader Theme developed by hicksdesign (it’s around since April though).

Clearly, it adopts much of the Mac OS X UI style, but still, it’s amazing how you can improve usability only by applying a decent CSS: the sidebar appears better organized and articles itself are easier readable than without the theme.

Adding the two extra style definitions as mentioned in the comment section here makes it even better.

If you’re using Google Reader, you definitely should give it a try.

El Camino

Camino BrowserCamino 1.5 was released today, a Mac OS X browser based on Gecko, the rendering engine behind Firefox and Mozilla. But unlike Firefox, Camino doesn’t feel like an alien on Mac OS X regarding visual appearance and features like access to the system’s Keychain to store passwords for instance.

One feature of Firefox which I couldn’t find in Camino’s feature list but as I just found out does work in Camino too are “search bookmarklets”. They work as follows:

E.g. for searching Wikipedia I save a bookmark with the location http://de.wikipedia.org/wiki/%s and add the keyword wiki to it. Then I’m able to search Wikipedia by simply typing the word wiki followed by a blank and my search term into the address bar. %s stands as placeholder for the search term in the bookmark address. An easy and very convenient way to quickly access any available search site.

Another example: for quickly looking up a location in Google maps I assigned the keyword map to the bookmark http://maps.google.com/maps?q=%s, so typing map mylocation into the address bar will return me a Google map showing mylocation.

In Firefox you can add a search bookmarklet for any searchfield you see on a website by a simple right click on the search field. Camino unfortunately doesn’t offer that, so I have to find the search parameters to create a valid search command for a specific website. Maybe it’s an upcoming feature of Camino.

Aqua form controls preview

Select OptgroupIt’s probably only a small step for mankind, but a major improvement for any Firefox user on Mac OS X: the next version of the famous open source browser comes with good looking Mac OS X native form controls. Anyone interested can download an early preview here.

Google Desktop indexing

Google Desktop SearchI’m wondering how Google Desktop will handle indexing on the Mac?

On Windows Google Desktop index files grow up to multiple GB file sizes. So the question that came to my mind is: does Google Desktop make use of the Spotlight index or will Google create it’s own local index from scratch?

Spotlight obviously stores its index somewhere on the hard drive and I think it must be already quite large, supposedly more than a GB on my MacBook. I don’t want another local search application to create a second index, parallel to Spotlight’s, containing more or less the same information – there is only one local drive to index – and clutter up my hard drive with a few GB of index files.

Besides, Spotlight does a fairly well job. Extended by some plugins it searches within my del.icio.us bookmarks, Open Office documents or online on Google.