xcode 如何在 Mac 上安装 VTK?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32853082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install VTK on a mac?
提问by CaptainBleuten
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.
我有大学要完成的任务,他们说要在 ubuntu 或 Windows 上安装虚拟机,安装 VTK 并使用 code::blocks。但我更喜欢XCode,虚拟机会扼杀电池寿命。
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.")
我现在几个小时都在努力在我的 mac 上安装 VTK。我已经尝试了很多东西,最后,如何在支持 Cocoa/XCode 的情况下为 OSX 10.8 安装 VTK 6.1?, 没有成功。(实际上,我迷失在为 cmake 打勾的选项中:我没有看到所有列出的选项。尝试 make 时显示错误“make: *** 未指定目标且未找到 makefile。停止。”)
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.
另外,我对 Qt 的东西(对我来说有必要吗?)或 python 的东西(通常它在我的 Mac 上,但它是正确的版本吗?)和包装的东西迷失了;我不知道我找到的程序是否适用于我的案例。
To fix the idea, the VTK installing part I'm trying to reproduce on my mac is described for Ubuntu as follow:
为了解决这个问题,我尝试在我的 mac 上复制的 VTK 安装部分在 Ubuntu 中的描述如下:
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
之后,对于我必须设置的 CMake-gui 构建选项是
VTK_DIR = /usr/lib/cmake/vtk-6.0
VTK_DIR = /usr/lib/cmake/vtk-6.0
How to do the equivalent on mac OSX?
如何在 mac OSX 上做等价的?
If that can help, the VTK files I use are
如果这有帮助,我使用的 VTK 文件是
#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"
回答by Lars Bilke
Just use Homebrew, the package manager for Mac OS. Install Homebrew with:
只需使用Homebrew,Mac OS 的包管理器。使用以下命令安装 Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And then install VTK with:
然后使用以下命令安装 VTK:
brew install vtk
Optionally you can install it with QT-support (python is already enabled):
您可以选择使用 QT-support 安装它(python 已经启用):
brew install vtk --with-qt
For more install options:
更多安装选项:
brew info vtk