Question

I would like to install the pcl formula through homebrew, which is documented here: http://www.pointclouds.org/documentation/tutorials/installing_homebrew.php

Unfortunately, homebrew decides it needs to upgrade my VTK installation to the latest release (6.0) even though I have a perfectly working version (5.10.1) installed already. I would like to compile against and link with this existing version. (The minimum VTK version for pcl is listed as 5.6.1, so everything should work fine. I actually manually build pcl and tried to link it against VTK 6.0, which doesn't even work, yet.)

Therefore, my question is, why does homebrew try to upgrade VTK (to an incompatible version) and how can I prevent it from doing this?

All I am calling is: brew install pcl, which triggers this:

==> Installing pcl dependency: vtk
==> Downloading http://www.vtk.org/files/release/6.0/vtk-6.0.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/vtk-6.0.0.tar.gz

This eventually leads to an error, as vtk 6.0 does not compile under Mac OS X 10.9 through homebrew (https://github.com/Homebrew/homebrew-science/issues/401).

To be clear, even if VTK 6.0 would compile fine, I do not want to upgrade, so does anyone know how to prevent homebrew from upgrading a dependent formula?

Was it helpful?

Solution 2

Homebrew actually has a formula for vtk5 separately now, so this should now be the correct way to install it (currently it's 5.10.1).

brew install vtk5 --with-qt

You also need eigen, flann, qhull and boost. Also useful, but optional is getting sphinx via pip install sphinx if you want docs. If you want to build simulations (see below option) then you need to get glew too (although it wouldn't find the header).

I can verify that this works on 10.8 and will check 10.9 tonight. I've had problems installing 1.7.1 from the archive, but cloning the github repository worked for me.

$ git clone https://github.com/PointCloudLibrary/pcl pcl-trunk

$ cd pcl_trunk

$ mkdir build; cd build

$ cmake .. -DBUILD_global_tests=ON -DBUILD_examples=ON -DBUILD_simulations=ON

$ ./configure; make; make install

Without VTK you can get to a few % before the PCL install fails. Installing VTK with X11 seems to be a recipe for a disaster here, I had to manually install libX11, libXt and others because VTK was trying to include the incorrect headers. The problems continued with OpenGL and I couldn't compile past around 42%. I reinstalled vtk5 without --with-x11 and it compiled fully.

There is a PCL formula for Homebrew knocking around, but it's rarely updated and I didn't have much luck editing it (not familiar enough with Brew's syntax). I tried to update it and submit a pull request, but when it came to testing the actual 'stable' build fails at the moment so there's no point.

EDIT: To be clear, installing the 1.7.1 tarball fails due to some problem with Eigen (around 12% in when compiling pcl_search).

Proposed pull request, it's a HEAD only fix at the moment. https://github.com/ros/homebrew-hydro/pull/7

OTHER TIPS

You can trick Homebrew to think it has Vtk 6.0 installed. For that you have to run this command in a terminal

ln -s /usr/local/Cellar/vtk/5.10.1 /usr/local/Cellar/vtk/6.0.0

When the time comes for you to really want to update vtk, just eliminate that symlink with

rm /usr/local/Cellar/vtk/6.0.0

and let Homebrew do its job.

Just downgrade to previous version.

1) cd /usr/local/Library/Taps/homebrew-science/
2) brew versions vtk
3) git checkout 27a4327 vtk.rb
4) brew uninstall vtk && brew install vtk
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top