How can I prevent homebrew from upgrading VTK dependency for PCL? - macos

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?

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.

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

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

Related

Installing Bakefile in Mac osx 10.11

I have been trying to install bakefile(v0.2.9) in mac osx 10.11. Whenever I try to install bakefile using the dmg file I get The installation failed.The installer could not install the software because there was no software found to install error.
I even tried building it from the source code(v1.2.5.1 from github). I built it using the sudo make command.However sudo make install command throws No rule to make target install.
Is there any other way to install bakefile in macosx 10.11?
Edit :
Finally I managed to install the bakefile 0.2.9 in osx 10.11. I can't use the latest version as it does not supports the bakefile we have been using in our projects.
Though the installation is successful,I get the segmentation fault 11 when I try to build the bakefiles(.bkl). Some of the forums suggested that the problem could be associated with python 2.7. I followed all the steps needed to resolve the issue. But none of them helped.
I have been using python 2.7.11. How can I avoid this segmentation fault?
I advice against using the legacy 0.2.9 version.
I even tried building it from the source code(v1.2.5.1 from github).
You didn’t, that’s the problem — you tried to build a very different version, 0.2.9 != 1.2.5.1. The relation between these two branches is explained at http://bakefile.org — they are incompatible and different.
If you want to build 0.2.9 from sources, you need to download and build 0.2.9.
If you want to use the 1.x version, you can download packaged “binary” version, as explained at https://github.com/vslavik/bakefile
P.S. You don’t need to, and shouldn’t, use sudo when installing somewhere you typically have access to, such as /usr/local on OS X.

libpng not linked on Mac OSX 10.9.2

I installed matrix2png on my Mac and had used it without problem before last week when I installed another image manipulating tool "circos". Circos requires me to install a different version of libpng, and I did. After that, I am no longer able to run matrix2png, which gives me the following error. I think the old ligpnb is not linked any more. Does anyone know how to fix this error? - appreciate your help.
dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /usr/local/bin/matrix2png
Reason: image not found
Those step solve my problem:
brew versions libpng
You will see some versions of libpng, but unfortunately not 1.5.15, so next you should install 1.5.18.
git checkout 7bec702 Library/Formula/libpng.rb
brew install libpng
You'll will find version 1.5.18 and some another versions.
ln -s /usr/local/Cellar/libpng/1.5.18/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib`
See https://github.com/Homebrew/homebrew-php/issues/1055
Some more info on installing certain versions of brew formulas can be found at https://coderwall.com/p/lqphzg.
Your new version of libpng has probably changed the name of its dyld files. This often happens with upgrades (especially following a major release). To verify this, open up the terminal and type:
ls /usr/local/lib/libpng*
What do you see?
From your error message we know that matrix2png is looking for libpng15 but if you've upgraded when instaling circos then you may now have libpng16 on your system. Consequently matrix2png won't be able to find the files that it's looking for and will be unhappy.
Fixing it this time:
Try re-installing matrix2png and see whether it notices the dependency issues and fixes it for you. You don't really want to downgrade libpng nor do you want to have two versions of it on your system, so having an up-to-date version of matrix2png would be good.
It looks like matrix2png comes from C source code, so you'll want to rebuild it. Download the source code or and then open a terminal. Navigate to the folder with the source code and run configure and then make. Configure will generate a Makefile for your system, and then make will use that file to generate a new binary. I've tested this on my Mac (with libpng16), and found that matrix2png built without any errors.
Suggested future approach:
To prevent future linking problems, you may want to use a package manager like homebrew or macports. In case you're using (or want to use) homebrew, it has circos and lib2png (but not matrix2png, sorry!). Once brew is installed, type the following into the terminal:
brew install libpng
And it should detect linking issues / version conflicts and guide you through fixing them. Brew places all of it's files in a 'cellar' location in /usr/local/Cellar and then symbolically links them into your system.
In case you're already using brew, try brew doctor and follow the instructions to resolve problems.
My experience (I've been dealing with a lot of version conflicts in the past few weeks) is that package managers make life much easier. Occasionally I've had to remove and reinstall packages to fix version issues, but in general brew keeps things neat and working.

Haskell wx fails install Macosx

I was trying to get wxHaskell installed on my mac (Osx Mavericks). I fixed the issue with gcc, and I used brew to install wxmac (version 3.0). The issue that keeps coming up is that the hackage cabal searches for looks for wx 2.9, while I have 3.0. It says that it can't find:
Warning: No config found to match: /usr/local/bin/wx-config --version=2.9 --version-full
in /usr/local/Cellar/wxmac/3.0.0.0/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.
I can't find any way to install a different version of wx through brew. Does anyone have a fix?
Thanks!

How should I upgrade Xcode after upgrading to OS X Lion?

I've just found out, that my homebrew doesn't work anymore after I upgraded to OS X Lion.
$ brew install clojure
Warning: Xcode is not installed! Builds may fail!
Error: No such file or directory - /usr/bin/cc
and
$ brew doctor
We couldn't detect gcc 4.2.x. Some formulae require this compiler.
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
You have no /usr/bin/cc. This will cause numerous build issues. Please
reinstall Xcode.
Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
after some googling, I found out that I should upgrade Xcode to version 4.1. The problem is, I have version 3.2.5 installed and I can't find any way of uninstalling it.
When I look at App Store, it looks like I don't have Xcode installed at all. I'm afraid that if I install it via App Store, it will somehow conflict with the version I have currently installed. However I can't find it in Applications, and I can't find any update function either.
Software Update doesn't prompt me to update Xcode, and I also don't see it in Installed Software.
What should I do?
Thanks to the readme found at /Developer, I found a way to uninstall Xcode via
$ sudo /Developer/Library/uninstall-devtools --mode=all
edit: I just ran the installer for Xcode 4, and it detected old version of Xcode, offering me to move it to /Developer-old.
I fixed it by
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

How to install macports openmpi on Mac osx 10.5.8?

I want the latest version of openmpi. I like to use macports because it is easy to install, uninstall, and upgrade software. I have installed the latest mpi via building from source, but no one seems to be able to get it to build properly with macports. There is always a build error. There are tickets (and you can see the logs at ), but they seem to be collecting dust and it seems strange that no one had found a solution.
I have tried uninstalling the built in version (I know, openmpi says not to do that--but it works fine if I reinstall it--even in a different directory), but I still the same build errors. I also tried with different gcc.
Does anyone know what is so difficult about getting openmpi via macports?
sudo port install openmpi
worked for me

Resources