Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install VTK on a mac?

I've got assignment to do for university and they say to install a virtual machine with ubuntu or Windows, install VTK and work with code::blocks. But I prefer XCode, and the virtual machine kills the battery life.

And i'm struggling installing VTK on my mac for hours now. I've tried many things and, lastly, How to install VTK 6.1 for OSX 10.8 with Cocoa/XCode support?, without success. (Actually I got lost at the options ticking for cmake: I didn't see all of the listed options. And trying to make showed the error "make: *** No targets specified and no makefile found. Stop.")

Also, I'm lost with the Qt things (is it necessary for me ?) or the python things (normally it's on my mac but is it the right version ?) and the wrap stuff; and I don't know if the procedures I found apply for my case.

To fix the idea, the VTK installing part I'm trying to reproduce on my mac is described for Ubuntu as follow:

sudo apt-get install libvtk6-dev
sudo apt-get install libpython2.7-dev

and after that, for the CMake-gui building options I have to set is

VTK_DIR = /usr/lib/cmake/vtk-6.0

How to do the equivalent on mac OSX?

If that can help, the VTK files I use are

#include <vtkCellArray.h>
#include <vtkCellData.h>
#include <vtkDoubleArray.h>
#include <vtkPoints.h>
#include <vtkVertex.h>
#include <vtkLine.h>
#include <vtkTriangle.h>
#include <vtkQuad.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkTubeFilter.h>
#include <vtkCleanPolyData.h>
#include <vtkCubeSource.h>
#include <vtkSphereSource.h>
#include <vtkGlyph3D.h>
#include <vtkProperty.h>
#include "vtkCamera.h"
like image 855
CaptainBleuten Avatar asked Oct 17 '25 16:10

CaptainBleuten


1 Answers

Just use Homebrew, the package manager for Mac OS. Install Homebrew with:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then install VTK with:

brew install vtk

Optionally you can install it with QT-support (python is already enabled):

brew install vtk --with-qt

For more install options:

brew info vtk
like image 195
Lars Bilke Avatar answered Oct 19 '25 07:10

Lars Bilke