Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.96k stars 11.35k forks source link

vtk + python compilation failure #16646

Closed smelch000 closed 11 years ago

smelch000 commented 11 years ago

hi guys,

my OSX 10.8 fails when compiling vtk with python support. Below is a partial output. Any help is greatly appreciated!

Sharpie commented 11 years ago

I can't find the actual error in the output you posted. Please review the troubleshooting page on the wiki and provide a gist containing the requested items:

https://github.com/mxcl/homebrew/wiki/Troubleshooting

smelch000 commented 11 years ago

Hi I redid

HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install vtk --qt --python --pyqt

same as before: there is no file created in ~/Library/Logs/Homebrew/vtk/. The only message about the failure is the following snippet and brew doctor does not complain at all.

==> Downloading http://www.vtk.org/files/release/5.10/vtk-5.10.0.tar.gz Already downloaded: /Library/Caches/Homebrew/vtk-5.10.0.tar.gz /usr/bin/tar xf /Library/Caches/Homebrew/vtk-5.10.0.tar.gz

...

/usr/local/Cellar/cmake/2.8.10.1/bin/cmake -E cmake_progress_report /tmp/vtk-zVhN/VTK/build/CMakeFiles [ 20%] Building CXX object Common/CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o cd /tmp/vtk-zVhN/VTK/build/Common && /usr/local/Library/ENV/4.3/c++ -DVTK_IN_VTK -DvtkCommonPythonSIP_EXPORTS -fPIC -I/tmp/vtk-zVhN/VTK/build -I/tmp/vtk-zVhN/VTK/build/Common -I/tmp/vtk-zVhN/VTK/build/Utilities -I/tmp/vtk-zVhN/VTK/build/VolumeRendering -I/tmp/vtk-zVhN/VTK/build/Rendering -I/tmp/vtk-zVhN/VTK/build/Charts -I/tmp/vtk-zVhN/VTK/build/Chemistry -I/tmp/vtk-zVhN/VTK/build/Utilities/vtkalglib -I/tmp/vtk-zVhN/VTK/Wrapping/Python -I/tmp/vtk-zVhN/VTK/build/Wrapping/Python -I/tmp/vtk-zVhN/VTK/Infovis -I/tmp/vtk-zVhN/VTK/Geovis -I/tmp/vtk-zVhN/VTK/Views -I/tmp/vtk-zVhN/VTK/VolumeRendering -I/tmp/vtk-zVhN/VTK/Hybrid -I/tmp/vtk-zVhN/VTK/Widgets -I/tmp/vtk-zVhN/VTK/Rendering -I/tmp/vtk-zVhN/VTK/Charts -I/tmp/vtk-zVhN/VTK/Chemistry -I/tmp/vtk-zVhN/VTK/Rendering/Testing/Cxx -I/tmp/vtk-zVhN/VTK/IO -I/tmp/vtk-zVhN/VTK/Imaging -I/tmp/vtk-zVhN/VTK/Graphics -I/tmp/vtk-zVhN/VTK/GenericFiltering -I/tmp/vtk-zVhN/VTK/Filtering -I/tmp/vtk-zVhN/VTK/Common -I/tmp/vtk-zVhN/VTK/Utilities -I/tmp/vtk-zVhN/VTK/Common/Testing/Cxx -I/tmp/vtk-zVhN/VTK/build/Utilities/vtknetcdf/include -I/tmp/vtk-zVhN/VTK/Utilities/vtknetcdf/include -I/tmp/vtk-zVhN/VTK/build/Utilities/vtklibproj4 -I/tmp/vtk-zVhN/VTK/Utilities/vtklibproj4 -I/tmp/vtk-zVhN/VTK/build/Utilities/DICOMParser -I/tmp/vtk-zVhN/VTK/Utilities/DICOMParser -I/tmp/vtk-zVhN/VTK/build/Utilities/vtkfreetype/include -I/tmp/vtk-zVhN/VTK/Utilities/vtkfreetype/include -I/tmp/vtk-zVhN/VTK/build/Utilities/LSDyna -I/tmp/vtk-zVhN/VTK/Utilities/LSDyna -I/tmp/vtk-zVhN/VTK/build/Utilities/MaterialLibrary -I/tmp/vtk-zVhN/VTK/Utilities/MaterialLibrary -I/tmp/vtk-zVhN/VTK/build/Utilities/vtkmetaio -I/tmp/vtk-zVhN/VTK/Utilities/vtkmetaio -I/tmp/vtk-zVhN/VTK/build/Utilities/verdict -I/tmp/vtk-zVhN/VTK/Utilities/verdict -I/tmp/vtk-zVhN/VTK/build/Utilities/vtkhdf5 -I/tmp/vtk-zVhN/VTK/Utilities/vtkhdf5 -I/tmp/vtk-zVhN/VTK/build/Utilities/vtkhdf5/src -I/tmp/vtk-zVhN/VTK/Utilities/vtkhdf5/src -I/tmp/vtk-zVhN/VTK/build/Utilities/vtkhdf5/hl/src -I/tmp/vtk-zVhN/VTK/Utilities/vtkhdf5/hl/src -I/tmp/vtk-zVhN/VTK/Utilities/utf8/source -I/tmp/vtk-zVhN/VTK/GUISupport/Qt -I/tmp/vtk-zVhN/VTK/build/GUISupport/Qt -I/tmp/vtk-zVhN/VTK/GUISupport/Qt/Chart -I/tmp/vtk-zVhN/VTK/build/GUISupport/Qt/Chart -I/tmp/vtk-zVhN/VTK/Utilities/vtkalglib -I/tmp/vtk-zVhN/VTK/Utilities/ftgl/src -I/tmp/vtk-zVhN/VTK/build/Utilities/ftgl -I/System/Library/Frameworks/Tk.framework/PrivateHeaders -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/include/python2.7 -I/usr/local/include -o CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o -c /tmp/vtk-zVhN/VTK/build/Common/sipvtkCommonPythonSIPcmodule.cpp brew: superenv removed: -I/usr/local/include /tmp/vtk-zVhN/VTK/build/Common/sipvtkCommonPythonSIPcmodule.cpp:390:12: error: excess elements in scalar initializer {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, ^~~~ /usr/include/stdio.h:82:14: note: expanded from macro 'NULL'

define NULL __DARWIN_NULL

         ^

/usr/include/sys/_types.h:82:23: note: expanded from macro '__DARWIN_NULL'

define __DARWIN_NULL __null

                  ^~~~~~

1 error generated. make[2]: * [Common/CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o] Error 1 make[1]: * [Common/CMakeFiles/vtkCommonPythonSIP.dir/all] Error 2 make: *\ [all] Error 2 ==> Configuration HOMEBREW_VERSION: 0.9.3 HEAD: cd56cdcd80145fec0c25fd15fd95f34fa2ef0c5d CPU: quad-core 64-bit arrandale OS X: 10.8.2-x86_64 Xcode: 4.5.2 CLT: 4.5.0.0.1.1249367152 X11: 2.7.4 => /opt/X11 ==> ENV CC: cc CXX: c++ MAKEFLAGS: -j1 CMAKE_PREFIX_PATH: /usr/local CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/ CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/mountain_lion HOMEBREW_MAKE_JOBS: 1 ACLOCAL_PATH: /usr/local/share/aclocal OBJC: cc PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/libpng/bin:/usr/local/opt/qt/bin:/usr/local/opt/sip/bin:/usr/local/opt/pyqt/bin:/usr/local/opt/python/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: vtk did not build

These open issues may also help: https://github.com/mxcl/homebrew/issues/16646

samueljohn commented 11 years ago

Oh, please post such long things into a gist.github.com and link here. Thanks. A gist allows us to diff your log against ours and makes this thread readable.

We also need your brew --config and brew doctor output.

samueljohn commented 11 years ago

Would you mind to try with a brewed python if you have not done so already? brew install python brew install vtk --python

samueljohn commented 11 years ago

Probably some qt issue Instead of brew install --verbose vtk --qt --python --pyqt you could try brew install --verbose vtk --python.

smelch000 commented 11 years ago

sure, I am using already the brewed python:

brew list

binutils gfortran libcdio p11-kit qt cairo git libffi pango readline cmake glib libmpc pixman sip fontconfig global libpng pkg-config sqlite freetype gmp libtasn1 play xz gdbm gnutls mpfr pyqt gettext graphviz nettle python

brew doctor Your system is raring to brew.

brew --config HOMEBREW_VERSION: 0.9.3 HEAD: cd56cdcd80145fec0c25fd15fd95f34fa2ef0c5d HOMEBREW_PREFIX: /usr/local HOMEBREW_CELLAR: /usr/local/Cellar CPU: quad-core 64-bit arrandale OS X: 10.8.2-x86_64 Xcode: 4.5.2 CLT: 4.5.0.0.1.1249367152 LLVM-GCC: build 2336 Clang: 4.1 build 421 X11: 2.7.4 => /opt/X11 System Ruby: 1.8.7-358 Perl: /usr/bin/perl Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python2.7 Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

brew install vtk --python went OK.

Is thee anything to do about qt ? This is really needed for my work… thanks a lot

S

On Dec 19, 2012, at 6:15 PM, Samuel John notifications@github.com wrote:

Would you mind to try with a brewed python if you have not done so already? brew install python brew install vtk --python

— Reply to this email directly or view it on GitHub.

samueljohn commented 11 years ago

can you please edit that long comment above and remove the log. This thread will get unusable.

smelch000 commented 11 years ago

done

samueljohn commented 11 years ago

To get closer to the core of the problem, brew install vtk --python will succeed, I assume? (so leaving out the qt related stuff?)

smelch000 commented 11 years ago

yes, vtk succeded with no problem to my knowledge

samueljohn commented 11 years ago

I can try to reproduce tomorrow, I think that it fails for me too.

smelch000 commented 11 years ago

ok, I am looking forward

Sharpie commented 11 years ago

Could also be a SIP issue---I.E VTK may not be compatible with the current version of SIP.

smelch000 commented 11 years ago

could the error be related to the following stuff?

http://pl.usenet.digipedia.org/thread/15070/9857/

samueljohn commented 11 years ago

Could be. But the err looks different. I can't care about this right now. After Christmas perhaps.

smelch000 commented 11 years ago

Hi, as it looks the pyqt is big hassle - I have seen the same error above when trying with macports - would it be possible to use vtk with pyside? I have seen some of your previous work on it. I would try installing vtk with pyside on ML. How would the installation go to have full python bindings with vtk ? Thanks!

samueljohn commented 11 years ago

I can successfully brew install vtk --python. Even then it is possible to display vtk plots and interact with vtk. The VTK API is not wrapped in Qt classes (and not in PyQt) classes.

Even without the --pyqt option, you can display native VTK render windows
from python. Alternatively, you can integrate the RenderWindowInteractor
in PyQt, PySide, Tk or Wx at runtime. Look at
    import vtk.qt4; help(vtk.qt4) or import vtk.wx; help(vtk.wx)
samueljohn commented 11 years ago

you can integrate the RenderWindowInteractor in PyQt, PySide, Tk or Wx at runtime

@smelch000 have you tried that?

samueljohn commented 11 years ago

I will update vtk to 5.10.1 in the next days. Let's see if something improves.

smelch000 commented 11 years ago

Ok, up to now I could use PyQt + Vtk in a limited way, by using an externally implemented QVTKWidget.py. For other sw the whole thing simply fails. I am looking forward if you can get a working combination.

samueljohn commented 11 years ago

Looks like for my next (new) Job I am going to need VTK an Qt so I have greater interest in getting this to run.

tfmoraes commented 11 years ago

I don't know if it's the same problem. I resolved the problem I was having compiling vtk with a little change in vtk homebrew formula. I created the following patch with the change I've done: https://gist.github.com/tfmoraes/5038005

smelch000 commented 11 years ago

Thanks, but I get the following error with vtk 10.1 and the patch does not seem to help. I am trying to install with --pyqt --vtk --qt flags. Can you be more specific about your patch?

.... [ 34%] Building CXX object Graphics/CMakeFiles/vtkGraphics.dir/vtkWindowedSincPolyDataFilter.cxx.o brew: superenv removed: -I/usr/local/include [ 34%] Building CXX object Graphics/CMakeFiles/vtkGraphics.dir/vtkYoungsMaterialInterface.cxx.o brew: superenv removed: -I/usr/local/include [ 34%] Building CXX object Graphics/CMakeFiles/vtkGraphics.dir/vtkGraphicsInstantiator.cxx.o brew: superenv removed: -I/usr/local/include Linking CXX shared library ../bin/libvtkGraphics.dylib For vtkGraphics - updating vtkGraphicsHierarchy.txt [ 34%] Built target vtkGraphics make: *\ [all] Error 2 ==> Configuration HOMEBREW_VERSION: 0.9.4 HEAD: adb43dc192b186af43b17da9b3a1525665acf1e4 CPU: quad-core 64-bit arrandale OS X: 10.8.2-x86_64 Xcode: 4.6 CLT: 4.6.0.0.1.1358221012 X11: 2.7.4 => /opt/X11 ==> ENV CC: cc CXX: c++ MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /usr/local CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/ CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/mountain_lion ACLOCAL_PATH: /usr/local/share/aclocal OBJC: cc PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/libpng/bin:/usr/local/opt/qt/bin:/usr/local/opt/sip/bin:/usr/local/opt/pyqt/bin:/usr/local/opt/python/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: vtk did not build

tfmoraes commented 11 years ago

Hi smelch000,

Your case is exactly my case. The difference is I my using OS X 10.6. Bellow the command I used to install vtk:

HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install vtk --qt --python --pyqt

The "HOMEBREW_MAKE_JOBS=1" is to force brew to use only a process to compile. The patch is because of this https://github.com/enthought/mayavi/issues/10

Thanks!

smelch000 commented 11 years ago

thanks, I tried the same command but it does not work. It is something related to 10.8, I hoped that with the latest xcode/vtk things moved on. The error I get is different from the previous version thou.

adamv commented 11 years ago

If new errors are happening, please put the new build output in a new gist.

smelch000 commented 11 years ago

I am afraid this patch does not work on 10.8 but only on 10.6

verga commented 11 years ago

The commands:

brew install vtk

and

brew install vtk --qt

work under a fresh installed Mac OS 10.8.3 with Xcode 4.6.1; however options --pyqt and/or --python fail to be installed.

Using the command suggested by tfmoraes with HOMEBREW_MAKE_JOBS=1, I get:

brew: superenv removed: -I/usr/local/include /tmp/vtk-Rwns/VTK5.10.1/Wrapping/Python/vtkPythonUtil.cxx:903:7: error: use of undeclared identifier 'Py_Exit' Py_Exit(1);

before the installation stops with

1 error generated. make[2]: * [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/vtkPythonUtil.cxx.o] Error 1 make[1]: * [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/all] Error 2 make: *\ [all] Error 2

Without the HOMEBREW_MAKE_JOBS=1, I get the error:

brew: superenv removed: -I/usr/local/include Linking CXX shared library ../bin/libvtkFiltering.dylib For vtkFiltering - updating vtkFilteringHierarchy.txt [ 13%] Built target vtkFiltering make: *\ [all] Error 2

I reinstalled python pyqt and sip, but this did not help with the vtk --python installation.

tfmoraes commented 11 years ago

Hi @verga, try to apply the following patch before the compilation https://gist.github.com/tfmoraes/5038005

verga commented 11 years ago

Thank you for your suggestion; I'll try tomorrow (today I am not in my usual office). I take you informed about the result.

2013/3/19 Thiago Franco de Moraes notifications@github.com

Hi @verga https://github.com/verga, try to apply the following patch before the compilation https://gist.github.com/tfmoraes/5038005

— Reply to this email directly or view it on GitHubhttps://github.com/mxcl/homebrew/issues/16646#issuecomment-15134210 .

Alberto Verga alberto.d.verga@gmail.com Université d'Aix-Marseille mobile: +33 6 32078229

smelch000 commented 11 years ago

I tried with the fresh 10.8.3 install and the latest Xcode 4.6.1, with and without the fix suggested by tfmoraes. It fails in both cases with the error below.

Does anybody have an idea where to look at?

[20%]Building CXX object Common/CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o

cd /tmp/vtk-kRqd/VTK5.10.1/build/Common && /usr/local/Library/ENV/4.3/c++ -DVTK_IN_VTK -DvtkCommonPythonSIP_EXPORTS -fPIC -I/tmp/vtk-kRqd/VTK5.10.1/build -I/tmp/vtk-kRqd/VTK5.10.1/build/Common -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities -I/tmp/vtk-kRqd/VTK5.10.1/build/VolumeRendering -I/tmp/vtk-kRqd/VTK5.10.1/build/Rendering -I/tmp/vtk-kRqd/VTK5.10.1/build/Charts -I/tmp/vtk-kRqd/VTK5.10.1/build/Chemistry -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtkalglib -I/tmp/vtk-kRqd/VTK5.10.1/Wrapping/Python -I/tmp/vtk-kRqd/VTK5.10.1/build/Wrapping/Python -I/tmp/vtk-kRqd/VTK5.10.1/Infovis -I/tmp/vtk-kRqd/VTK5.10.1/Geovis -I/tmp/vtk-kRqd/VTK5.10.1/Views -I/tmp/vtk-kRqd/VTK5.10.1/VolumeRendering -I/tmp/vtk-kRqd/VTK5.10.1/Hybrid -I/tmp/vtk-kRqd/VTK5.10.1/Widgets -I/tmp/vtk-kRqd/VTK5.10.1/Rendering -I/tmp/vtk-kRqd/VTK5.10.1/Charts -I/tmp/vtk-kRqd/VTK5.10.1/Chemistry -I/tmp/vtk-kRqd/VTK5.10.1/Rendering/Testing/Cxx -I/tmp/vtk-kRqd/VTK5.10.1/IO -I/tmp/vtk-kRqd/VTK5.10.1/Imaging -I/tmp/vtk-kRqd/VTK5.10.1/Graphics -I/tmp/vtk-kRqd/VTK5.10.1/GenericFiltering -I/tmp/vtk-kRqd/VTK5.10.1/Filtering -I/tmp/vtk-kRqd/VTK5.10.1/Common -I/tmp/vtk-kRqd/VTK5.10.1/Utilities -I/tmp/vtk-kRqd/VTK5.10.1/Common/Testing/Cxx -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtknetcdf -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtknetcdf -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtknetcdf/include -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtklibproj4 -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtklibproj4 -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/DICOMParser -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/DICOMParser -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtkfreetype/include -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtkfreetype/include -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/LSDyna -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/LSDyna -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/MaterialLibrary -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/MaterialLibrary -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtkmetaio -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtkmetaio -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/verdict -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/verdict -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtkhdf5 -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtkhdf5 -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtkhdf5/src -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtkhdf5/src -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/vtkhdf5/hl/src -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtkhdf5/hl/src -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/utf8/source -I/tmp/vtk-kRqd/VTK5.10.1/GUISupport/Qt -I/tmp/vtk-kRqd/VTK5.10.1/build/GUISupport/Qt -I/tmp/vtk-kRqd/VTK5.10.1/GUISupport/Qt/Chart -I/tmp/vtk-kRqd/VTK5.10.1/build/GUISupport/Qt/Chart -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/vtkalglib -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/ftgl/src -I/tmp/vtk-kRqd/VTK5.10.1/build/Utilities/ftgl -I/tmp/vtk-kRqd/VTK5.10.1/Utilities/TclTk/internals/tk8.5 -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/include/python2.7 -I/usr/local/include -o CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o -c /tmp/vtk-kRqd/VTK5.10.1/build/Common/sipvtkCommonPythonSIPcmodule.cpp brew: superenv removed: -I/usr/local/include

/tmp/vtk-kRqd/VTK5.10.1/build/Common/sipvtkCommonPythonSIPcmodule.cpp:390:12: error: excess elements in scalar initializer {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, ^~~~ /usr/include/stdio.h:82:14: note: expanded from macro 'NULL'

define NULL __DARWIN_NULL

         ^~~~~~~~~~~~~

/usr/include/sys/_types.h:82:23: note: expanded from macro '__DARWIN_NULL'

define __DARWIN_NULL __null

                  ^~~~~~

1 error generated. make[2]: * [Common/CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o] Error 1 make[1]: * [Common/CMakeFiles/vtkCommonPythonSIP.dir/all] Error 2 make: *\ [all] Error 2 ==> Configuration HOMEBREW_VERSION: 0.9.4 HEAD: 5d223542a76f3598b1a73a6b3306896861c8b7f6 CPU: quad-core 64-bit arrandale OS X: 10.8.3-x86_64 Xcode: 4.6.1 CLT: 4.6.0.0.1.1362189000 MacPorts/Fink: /opt/local/bin/port X11: 2.7.4 => /opt/X11 ==> ENV CC: cc CXX: c++ MAKEFLAGS: -j1 CMAKE_PREFIX_PATH: /usr/local CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/ CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/qt/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.8 HOMEBREW_MAKE_JOBS: 1 ACLOCAL_PATH: /usr/local/share/aclocal OBJC: cc PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/libpng/bin:/usr/local/opt/qt/bin:/usr/local/opt/sip/bin:/usr/local/opt/pyqt/bin:/usr/local/opt/python/bin:/usr/bin:/bin:/usr/sbin:/sbin

tfmoraes commented 11 years ago

@smelch000 it seems me you are not using homebrew's python, maybe that's the problem.

verga commented 11 years ago

I realize that I already tried the

-DIOKit:FILEPATH=/System/Library/Frameworks/IOKit.framework

patch without success.

2013/3/20 Thiago Franco de Moraes notifications@github.com

@smelch000 https://github.com/smelch000 it seems me you are not using homebrew's python, maybe that's the problem.

— Reply to this email directly or view it on GitHubhttps://github.com/mxcl/homebrew/issues/16646#issuecomment-15169786 .

Alberto Verga alberto.d.verga@gmail.com Université d'Aix-Marseille mobile: +33 6 32078229

jonatanskogsfors commented 11 years ago

I'm trying:

brew install vtk --python

It fails on vtkRenderingPythonTkWidgets

The computer is straight out of the box and runs 10.8.3. I have the latest Xcode and brewed python.

Check out the gisted outputs

samueljohn commented 11 years ago

@jonatanlindstrom we have a tk/python issue right now (since we updated tk to 8.6) Perhaps you have been struck by this? I am already on it.

jonatanskogsfors commented 11 years ago

@samueljohn sounds possible. Is there any way I can confirm this? Will you be helped by any data from me?

samueljohn commented 11 years ago

Python and Tk issue is fixed. I don't know if that helps here.

But you could try to brew update, brew rm python tcl tk, brew install python --with-brewed-tk.

smelch000 commented 11 years ago

sadly the fix on python + tk did not help. The error is always the same, I report it here for completeness.

cd /tmp/vtk-2Q4H/VTK5.10.1/build/Common && /usr/local/Library/ENV/4.3/c++ -DVTK_IN_VTK -DvtkCommonPythonSIP_EXPORTS -fPIC -I/tmp/vtk-2Q4H/VTK5.10.1/build -I/tmp/vtk-2Q4H/VTK5.10.1/build/Common -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities -I/tmp/vtk-2Q4H/VTK5.10.1/build/VolumeRendering -I/tmp/vtk-2Q4H/VTK5.10.1/build/Rendering -I/tmp/vtk-2Q4H/VTK5.10.1/build/Charts -I/tmp/vtk-2Q4H/VTK5.10.1/build/Chemistry -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtkalglib -I/tmp/vtk-2Q4H/VTK5.10.1/Wrapping/Python -I/tmp/vtk-2Q4H/VTK5.10.1/build/Wrapping/Python -I/tmp/vtk-2Q4H/VTK5.10.1/Infovis -I/tmp/vtk-2Q4H/VTK5.10.1/Geovis -I/tmp/vtk-2Q4H/VTK5.10.1/Views -I/tmp/vtk-2Q4H/VTK5.10.1/VolumeRendering -I/tmp/vtk-2Q4H/VTK5.10.1/Hybrid -I/tmp/vtk-2Q4H/VTK5.10.1/Widgets -I/tmp/vtk-2Q4H/VTK5.10.1/Rendering -I/tmp/vtk-2Q4H/VTK5.10.1/Charts -I/tmp/vtk-2Q4H/VTK5.10.1/Chemistry -I/tmp/vtk-2Q4H/VTK5.10.1/Rendering/Testing/Cxx -I/tmp/vtk-2Q4H/VTK5.10.1/IO -I/tmp/vtk-2Q4H/VTK5.10.1/Imaging -I/tmp/vtk-2Q4H/VTK5.10.1/Graphics -I/tmp/vtk-2Q4H/VTK5.10.1/GenericFiltering -I/tmp/vtk-2Q4H/VTK5.10.1/Filtering -I/tmp/vtk-2Q4H/VTK5.10.1/Common -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities -I/tmp/vtk-2Q4H/VTK5.10.1/Common/Testing/Cxx -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtknetcdf -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtknetcdf -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtknetcdf/include -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtklibproj4 -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtklibproj4 -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/DICOMParser -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/DICOMParser -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtkfreetype/include -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtkfreetype/include -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/LSDyna -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/LSDyna -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/MaterialLibrary -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/MaterialLibrary -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtkmetaio -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtkmetaio -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/verdict -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/verdict -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtkhdf5 -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtkhdf5 -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtkhdf5/src -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtkhdf5/src -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/vtkhdf5/hl/src -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtkhdf5/hl/src -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/utf8/source -I/tmp/vtk-2Q4H/VTK5.10.1/GUISupport/Qt -I/tmp/vtk-2Q4H/VTK5.10.1/build/GUISupport/Qt -I/tmp/vtk-2Q4H/VTK5.10.1/GUISupport/Qt/Chart -I/tmp/vtk-2Q4H/VTK5.10.1/build/GUISupport/Qt/Chart -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/vtkalglib -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/ftgl/src -I/tmp/vtk-2Q4H/VTK5.10.1/build/Utilities/ftgl -I/tmp/vtk-2Q4H/VTK5.10.1/Utilities/TclTk/internals/tk8.5 -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/include/python2.7 -I/usr/local/include -o CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o -c /tmp/vtk-2Q4H/VTK5.10.1/build/Common/sipvtkCommonPythonSIPcmodule.cpp brew: superenv removed: -I/usr/local/include /tmp/vtk-2Q4H/VTK5.10.1/build/Common/sipvtkCommonPythonSIPcmodule.cpp:390:12: error: excess elements in scalar initializer {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, ^~~~ /usr/include/stdio.h:82:14: note: expanded from macro 'NULL'

define NULL __DARWIN_NULL

         ^~~~~~~~~~~~~

/usr/include/sys/_types.h:82:23: note: expanded from macro '__DARWIN_NULL'

define __DARWIN_NULL __null

                  ^~~~~~

1 error generated. make[2]: * [Common/CMakeFiles/vtkCommonPythonSIP.dir/sipvtkCommonPythonSIPcmodule.cpp.o] Error 1 make[1]: * [Common/CMakeFiles/vtkCommonPythonSIP.dir/all] Error 2 make: *\ [all] Error 2 ==> Configuration HOMEBREW_VERSION: 0.9.4 HEAD: cb6d8389cf5d64fb2abd73a776fe7d3c784d7e42 CPU: quad-core 64-bit arrandale OS X: 10.8.3-x86_64 Xcode: 4.6.1 CLT: 4.6.0.0.1.1362189000 X11: 2.7.4 => /opt/X11 ==> ENV CC: cc CXX: c++ MAKEFLAGS: -j1 CMAKE_PREFIX_PATH: /usr/local CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/ CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/qt/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.8 HOMEBREW_MAKE_JOBS: 1 ACLOCAL_PATH: /usr/local/share/aclocal OBJC: cc PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/libpng/bin:/usr/local/opt/qt/bin:/usr/local/opt/sip/bin:/usr/local/opt/pyqt/bin:/usr/local/opt/python/bin:/usr/bin:/bin:/usr/sbin:/sbin

rajeeja commented 11 years ago

Error at 74%, please see below. Let me know how to proceed.

/usr/local/Cellar ==> brew install --examples --pyqt --python --qt vtk ==> Installing vtk dependency: qt ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.4.mountain_lion.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring qt-4.8.4.mountainlion.bottle.1.tar.gz ==> Caveats We agreed to the Qt opensource license for you. If this is unacceptable you should uninstall. ==> Summary /usr/local/Cellar/qt/4.8.4: 2781 files, 180M ==> Installing vtk dependency: sip dyld: DYLD environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid ==> Downloading http://www.riverbankcomputing.co.uk/hg/sip/archive/4.13.3.tar.gz ######################################################################## 100.0% ==> Patching patching file build.py patching file siputils.py ==> python build.py prepare ==> python configure.py --destdir=/usr/local/Cellar/sip/4.13.3/lib/python2.7/site-packages --bindir=/usr/local/Cellar/sip/4.13.3/bin --incdir=/usr/local/Cellar/sip/4.13.3/include --sipdir=/usr/local/share/sip ==> make install ==> Caveats For non-homebrew Python, you need to amend your PYTHONPATH like so: export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH ==> Summary /usr/local/Cellar/sip/4.13.3: 9 files, 596K, built in 4 seconds ==> Installing vtk dependency: pyqt dyld: DYLD environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid ==> Downloading http://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.9.4/PyQt-mac-gpl-4.9.4.tar.gz ######################################################################## 100.0% ==> python ./configure.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4.9.4/bin --destdir=/usr/local/Cellar/pyqt/4.9.4/lib/python2.7/site-packages --sipdir=/usr/local/Cellar/pyqt/4.9.4/share/sip ==> make ==> make install ==> Caveats For non-homebrew Python, you need to amend your PYTHONPATH like so: export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH ==> Summary /usr/local/Cellar/pyqt/4.9.4: 552 files, 20M, built in 5.3 minutes ==> Installing vtk dyld: DYLD environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid ==> Downloading http://www.vtk.org/files/release/5.10/vtk-5.10.1.tar.gz Already downloaded: /Library/Caches/Homebrew/vtk-5.10.1.tar.gz ==> Patching patching file Wrapping/Python/setup_install_paths.py ==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/vtk/5.10.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DVTK_REQUIRED_OBJCXX_FLAGS='' -DVTK_USE_CARBON=OFF -DBUILD_TESTING=OFF -DBUILD_SHARE ==> make

[ 74%] Building CXX object Rendering/CMakeFiles/vtkRenderingPythonD.dir/vtkRenderingPythonInit.cxx.o brew: superenv removed: -I/usr/local/include Linking CXX shared library ../bin/libvtkRenderingPythonD.dylib [ 74%] Built target vtkRenderingPythonD make: *\ [all] Error 2

smelch000 commented 11 years ago

I confirm that with the latest python 2.7.4 the installation advanced but not to the end. The expanded error is below. Advice from superior entities is greatly appreciated.

[ 75%] Building CXX object Rendering/CMakeFiles/vtkRenderingPythonTkWidgets.dir/vtkCocoaTkUtilities.mm.o cd /tmp/vtk-MYQ6/VTK5.10.1/build/Rendering && /usr/local/Library/ENV/4.3/c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DVTK_IN_VTK -DvtkRenderingPythonTkWidgets_EXPORTS -fPIC -I/tmp/vtk-MYQ6/VTK5.10.1/build -I/tmp/vtk-MYQ6/VTK5.10.1/build/Common -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities -I/tmp/vtk-MYQ6/VTK5.10.1/build/VolumeRendering -I/tmp/vtk-MYQ6/VTK5.10.1/build/Rendering -I/tmp/vtk-MYQ6/VTK5.10.1/build/Charts -I/tmp/vtk-MYQ6/VTK5.10.1/build/Chemistry -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtkalglib -I/tmp/vtk-MYQ6/VTK5.10.1/Wrapping/Python -I/tmp/vtk-MYQ6/VTK5.10.1/build/Wrapping/Python -I/tmp/vtk-MYQ6/VTK5.10.1/Infovis -I/tmp/vtk-MYQ6/VTK5.10.1/Geovis -I/tmp/vtk-MYQ6/VTK5.10.1/Views -I/tmp/vtk-MYQ6/VTK5.10.1/VolumeRendering -I/tmp/vtk-MYQ6/VTK5.10.1/Hybrid -I/tmp/vtk-MYQ6/VTK5.10.1/Widgets -I/tmp/vtk-MYQ6/VTK5.10.1/Rendering -I/tmp/vtk-MYQ6/VTK5.10.1/Charts -I/tmp/vtk-MYQ6/VTK5.10.1/Chemistry -I/tmp/vtk-MYQ6/VTK5.10.1/Rendering/Testing/Cxx -I/tmp/vtk-MYQ6/VTK5.10.1/IO -I/tmp/vtk-MYQ6/VTK5.10.1/Imaging -I/tmp/vtk-MYQ6/VTK5.10.1/Graphics -I/tmp/vtk-MYQ6/VTK5.10.1/GenericFiltering -I/tmp/vtk-MYQ6/VTK5.10.1/Filtering -I/tmp/vtk-MYQ6/VTK5.10.1/Common -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities -I/tmp/vtk-MYQ6/VTK5.10.1/Common/Testing/Cxx -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtknetcdf -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtknetcdf -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtknetcdf/include -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtklibproj4 -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtklibproj4 -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/DICOMParser -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/DICOMParser -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtkfreetype/include -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtkfreetype/include -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/LSDyna -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/LSDyna -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/MaterialLibrary -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/MaterialLibrary -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtkmetaio -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtkmetaio -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/verdict -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/verdict -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtkhdf5 -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtkhdf5 -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtkhdf5/src -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtkhdf5/src -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/vtkhdf5/hl/src -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtkhdf5/hl/src -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/utf8/source -I/tmp/vtk-MYQ6/VTK5.10.1/GUISupport/Qt -I/tmp/vtk-MYQ6/VTK5.10.1/build/GUISupport/Qt -I/tmp/vtk-MYQ6/VTK5.10.1/GUISupport/Qt/Chart -I/tmp/vtk-MYQ6/VTK5.10.1/build/GUISupport/Qt/Chart -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/vtkalglib -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/ftgl/src -I/tmp/vtk-MYQ6/VTK5.10.1/build/Utilities/ftgl -I/tmp/vtk-MYQ6/VTK5.10.1/Utilities/TclTk/internals/tk8.5 -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/Cellar/qt/4.8.4/include -F/usr/local/Cellar/qt/4.8.4/lib -I/usr/local/Cellar/qt/4.8.4/include/QtGui -I/usr/local/Cellar/qt/4.8.4/include/QtSql -I/usr/local/Cellar/qt/4.8.4/lib/QtCore.framework/Headers -I/usr/lib/libIOKit.dylib -I/usr/include/python2.7 -I/usr/local/include -o CMakeFiles/vtkRenderingPythonTkWidgets.dir/vtkCocoaTkUtilities.mm.o -c /tmp/vtk-MYQ6/VTK5.10.1/Rendering/vtkCocoaTkUtilities.mm brew: superenv removed: -I/usr/local/include /tmp/vtk-MYQ6/VTK5.10.1/Rendering/vtkCocoaTkUtilities.mm:57:28: error: no member named 'view' in 'TkWindowPrivate' NSView _result = macWin->view;


1 error generated.
make[2]: *_\* [Rendering/CMakeFiles/vtkRenderingPythonTkWidgets.dir/vtkCocoaTkUtilities.mm.o] Error 1
make[1]: **\* [Rendering/CMakeFiles/vtkRenderingPythonTkWidgets.dir/all] Error 2
make: **\* [all] Error 2
==> Configuration
HOMEBREW_VERSION: 0.9.4
HEAD: f5543c372454b215f2cfda648ae875179c8ceef8
CPU: quad-core 64-bit arrandale
OS X: 10.8.3-x86_64
Xcode: 4.6.1
CLT: 4.6.0.0.1.1362189000
X11: 2.7.4 => /opt/X11
==> ENV
CC: cc
CXX: c++
MAKEFLAGS: -j1
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/qt/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.8
HOMEBREW_MAKE_JOBS: 1
ACLOCAL_PATH: /usr/local/share/aclocal
OBJC: cc
PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/libpng/bin:/usr/local/opt/qt/bin:/usr/local/opt/sip/bin:/usr/local/opt/pyqt/bin:/usr/local/opt/python/bin:/usr/bin:/bin:/usr/sbin:/sbin
tfmoraes commented 11 years ago

@smelch000, try to turn off the support to Tk. You have to add something like this at cmake invocation: -DVTK_USE_TK=OFF

rich4653 commented 11 years ago

I had the same errors as other posters here, but finally managed to get it to build (on 10.8)

-> error: no member named 'view' in 'TkWindowPrivate'

The internal header 'tkMacOSXInt.h' included with vtk source contains struct 'TkWindowPrivate' which does not contain a member called 'view'. Apples header in '/System/Library/Frameworks/Tk.framework/Headers/tk-private' does.

Now I think 'brew install python' doesn't install tcl-tk unless you add --with-brewed-tk? In any case I ran 'brew uninstall tcl-tk' to remove this. I assume this means the only tcl-tk hanging around is Apples. I then forced brew to use this by modifying the formula ('brew edit vtk') so that it looks like:

def install args = std_cmake_args + %W[ -DVTK_REQUIRED_OBJCXX_FLAGS='' -DVTK_USE_CARBON=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH:STRING='#{lib}/vtk-5.10' -DCMAKE_INSTALL_NAME_DIR:STRING='#{lib}/vtk-5.10' -DTK_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers -DTK_INTERNAL_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers/tk-private ]

(I added the last two lines)

This fixed the first error and also the second (the one related to 'Linking CXX shared library ../bin/libvtkRenderingPythonD.dylib').

My guess as to what is going on is that vtk is mixing libraries and headers from different tcl-tks. Maybe brew's tcl-tk matches vtk's internal headers and could be used instead (I couldn't get this to work)? Interestingly, I did the same install earlier today on 10.6 and did not have this problem.

Anyway, hope this helps somebody.

samueljohn commented 11 years ago

@rich4653 thanks for the detective work. I was too busy this week to investigate my self.

However, the tcl-tk formula should not influence this build because we made it keg-only (=it installs only into it's Cellar and is not symlinked to /usr/local or whereever brew --prefix is).

@rich4653 can you post your brew --config so I can see if your system config?

rich4653 commented 11 years ago

@samueljohn, you're probably right: that the tcl-tk formula should not influence this build. I'm not an expert but I'm pretty sure the problem is something to do with tcl-tk. I tried a lot of things before it built and what finally appeared to make the difference was explicitly directing cmake to Apple's tcl-tk headers: -DTK_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers -DTK_INTERNAL_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers/tk-private

Perhaps an alternative solution would be to make vtk build with brew's tcl-tk? Maybe this version matches the tcl-tk headers bundled with vtk?

Richards-Mac-mini:~ rich$ brew --config HOMEBREW_VERSION: 0.9.4 ORIGIN: https://github.com/mxcl/homebrew HEAD: 3085c4033d5e534ded3d38326db5cfcdef3416bb HOMEBREW_PREFIX: /usr/local HOMEBREW_CELLAR: /usr/local/Cellar CPU: quad-core 64-bit ivybridge OS X: 10.8.3-x86_64 Xcode: 4.6.1 CLT: 4.6.0.0.1.1362189000 LLVM-GCC: build 2336 Clang: 4.2 build 425 X11: 2.7.4 => /opt/X11 System Ruby: 1.8.7-358 Perl: /usr/bin/perl Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/bin/python2.7 Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

smelch000 commented 11 years ago

Great job, it works. As an alternative I also tried disabling tcl/tk altogether with -DVTK_USE_TK=OFF and it works nicely. Thank you for your help!

samueljohn commented 11 years ago

Since homebrew/dupes recently updated tcl-tk to 8.6, it could be the case that VTK does not support it yet?

verga commented 11 years ago

In my case errors arise much earlier:

Linking CXX shared library ../bin/libvtkFiltering.dylib
For vtkFiltering - updating vtkFilteringHierarchy.txt
[ 15%] Built target vtkFiltering
make: *** [all] Error 2

brew --config gives

HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: bc33a4090754532cebdd7d7b7d5ca3e2a02cd509
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.8.3-x86_64
Xcode: 4.6.1
CLT: 4.6.0.0.1.1362189000
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

and brew --env

CC: cc
CXX: c++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.8
ACLOCAL_PATH: /usr/local/share/aclocal
OBJC: cc
PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/python/bin:/usr/bin:/bin:/usr/sbin:/sbin

Changes related to Tk do not help. I installed python with: --with-brewed-tk, --with-brewed-openssl Before the last error, other errors occur:

[ 12%] Building CXX object Wrapping/Python/CMakeFiles/vtkPythonCore.dir/PyVTKSpecialObject.cxx.o
/tmp/vtk-nYBe/VTK5.10.1/Wrapping/Python/vtkPythonUtil.cxx:903:7: error: use of
      undeclared identifier 'Py_Exit'
      Py_Exit(1);
      ^
/tmp/vtk-nYBe/VTK5.10.1/Wrapping/Python/PyVTKMutableObject.cxx:382:10: error: 
      use of undeclared identifier 'PyNumber_CoerceEx'
  return PyNumber_CoerceEx(ob1, ob2);
         ^
/tmp/vtk-nYBe/VTK5.10.1/Wrapping/Python/PyVTKMutableObject.cxx:389:10: error: 
      use of undeclared identifier 'PyNumber_ToBase'
  return PyNumber_ToBase(ob, 16);
         ^
/tmp/vtk-nYBe/VTK5.10.1/Wrapping/Python/PyVTKMutableObject.cxx:407:10: error: 
      use of undeclared identifier 'PyNumber_ToBase'
  return PyNumber_ToBase(ob, 8);
         ^
1 error generated.

These errors are related with the python bindings,

make[2]: *** [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/vtkPythonUtil.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 12%] 3 errors generated.
make[2]: *** [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/PyVTKMutableObject.cxx.o] Error 1
...
/tmp/vtk-nYBe/VTK5.10.1/Wrapping/Python/PyVTKSpecialObject.cxx:116:7: error: 
      use of undeclared identifier 'Py_ReprEnter'
  i = Py_ReprEnter(self);
      ^
/tmp/vtk-nYBe/VTK5.10.1/Wrapping/Python/PyVTKSpecialObject.cxx:166:3: error: 
      use of undeclared identifier 'Py_ReprLeave'
  Py_ReprLeave(self);
  ^
2 errors generated.
make[2]: *** [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/PyVTKSpecialObject.cxx.o] Error 1

brew install vtk --qt installs smoothly.

verga commented 11 years ago

I found a work around to install vtk with the python option. I added the following arguments to cmake, within the build.include? python block:

  args << '-DVTK_WRAP_PYTHON=ON'
  args << '-DVTK__INSTALL_NO_PYTHON:BOOL=ON'

  # Cmake picks up the system's python dylib, even if we have a brewed one.
  python_prefix = `python-config --prefix`.strip
  args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
  args << "-DPYTHON_DEBUG_LIBRARY:FILEPATH='#{python_prefix}/Python'"
  args << "-DPYTHON_EXECUTABLE:FILEPATH='#{python_prefix}/bin/python27'"
  args << "-DPYTHON_INCLUDE_PATH:FILEPATH='#{python_prefix}/Headers'"

With this modification of vtk.rb the installation stop at [75%] instead of [16%] before. Finally, adding the Tk library path:

  -DTK_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers
  -DTK_INTERNAL_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers/tk-private

the installation (brew install vtk --python --pyqt --qt) ALMOST ends (!). I get:

[100%] Building CXX object Charts/CMakeFiles/vtkChartsPythonSIP.dir/sipvtkChartsPythonSIPcmodule.cpp.o
brew: superenv removed: -I/usr/local/include
Linking CXX shared module ../bin/vtkChartsPythonSIP.so
[100%] Built target vtkChartsPythonSIP
make: *** [all] Error 2

A ''sip'' problem?

verga commented 11 years ago

I corrected two typos and the installation ended smoothly: one underscore in '-DVTK_INSTALL_NO_PYTHON:BOOL=ON', and python2.7 (or simply python) instead of python27.

  args << '-DVTK_WRAP_PYTHON=ON'
  args << '-DVTK_INSTALL_NO_PYTHON:BOOL=ON'

  # Cmake picks up the system's python dylib, even if we have a brewed one.
  python_prefix = `python-config --prefix`.strip
  args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
  args << "-DPYTHON_DEBUG_LIBRARY:FILEPATH='#{python_prefix}/Python'"
  args << "-DPYTHON_EXECUTABLE:FILEPATH='#{python_prefix}/bin/python'"
  args << "-DPYTHON_INCLUDE_PATH:FILEPATH='#{python_prefix}/Headers'"

For me, the brew vtk installation problem is closed. Thank you all for your help!

verga commented 11 years ago

In order to get the python module vtk in site-packages, delete '-DVTK_INSTALL_NO_PYTHON:BOOL=ON':

args << '-DVTK_WRAP_PYTHON=ON'

# Cmake picks up the system's python dylib, even if we have a brewed one.
  python_prefix = `python-config --prefix`.strip
  args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
  args << "-DPYTHON_DEBUG_LIBRARY:FILEPATH='#{python_prefix}/Python'"
  args << "-DPYTHON_EXECUTABLE:FILEPATH='#{python_prefix}/bin/python'"
  args << "-DPYTHON_INCLUDE_PATH:FILEPATH='#{python_prefix}/Headers'"

works! In summary it is enough to add the three last lines to vtk.rb in the python block to install.