Conversation
I know @samueljohn and @youngtaekoh have been working on this formula independently of each other and myself, but I wanted to submit this pull request as one possible solution that I think is valid. cf #12612. I took @youngtaekoh's sip+pyqt changes and applied them. I found that by removing the workarounds that the python |
Had to fix a typo in 32e4916 |
@2bits I am working on the fix_xcode thing right now. |
That helps to see your take on it. Vtk is strange software, and it's not fun how it takes 15min to compile each time I want to try something different. I doubt I'll work on it unless 12810 happens, especially because your bug report to them got no replies. |
Have you found a cure for this bug/work-around reported upstream ? |
Let's see. My solution is this pull request, but it doesn't work because HB during
and see what happens. When it almost worked except for the If instead I use all the RPATH workarounds, I think it was crashing when I try to import the module. When I looked at your branch and saw you setting Because I spent a whole day compiling this dozens of times, the different errors I had are all running together, and I can't really trust I'm remembering the problems anymore, sigh. |
I'll try and take a look at this tonight. |
Well I just tested my formula by shelling out of the install, linking vtk, and it will import the vtk module into system python. So that's good. And it writes the module into |
@samueljohn From my testing, this formula works with both system python and HB python doing Testing still needs to be done to prove to myself that the X11, tcl, and Qt4 bindings work. I'll get to that in a bit. |
I'll test it on my systems. Yesterday, the build was not successful on my system but you pushed a new version since then. But I don't have much time till monday. |
Sorry about that. I fixed an error. No rush here because Jack decided to close my request to modify |
@2bits, I have updated my vtk branch. I can now successfully build (and import vtk) against a brewed python with The problem I had (on my xcode-only system) was that I had to add It's all work in progress, though. |
@2bits just a question: I have seen you removed the ":BOOL" and ":STRING" parts of the args given to cmake. So they are not needed? |
|
||
# Remove duplicate files that will cause the final link phase to fail. | ||
%w(easy-install.pth site.py site.pyc).each do |f| | ||
rm pydir/f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the --python
option was not given, will this cause an error because the files are not there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's one of the things I fixed which got lost in a commit blizzard.
I just pushed a new commit to fix the missing
It turns out that those type modifiers are only needed if you preload the cache in a text file like we talked about on your XCode thread. When you supply cmake variables from the command line, they can be left out. Personally I find those obscure the code. |
Those typedefs are also required if the variable doesn't exist in CMakeCache.txt, which happens when the variable is never used in CMakeLists.txt. So in the case of vtk, these two need the typedef:
Currently I found my formula doesn't work with HB non-framework python entirely. Though I can run python and import vtk, I get an error running
From reading this, https://github.com/Lokaltog/vim-powerline/issues/13#issuecomment-3997965 it turns out that exporting DYLD_LIBRARY_PATH=/usr/lib makes it work. Ugly. So blah and a general blerg. It looks like Jack is going to pull a solution for #12810, though, which is cool. |
In c898792 I added back in the typedefs for those two vars and changed to non-interpolated strings. |
I have never used |
On my system, I still need the |
Thanks for the info about skip clean. I will try that.
This formula won't need the RPATH workaround nor the
On that issue, I'd like to see a gist of your |
SIde note: I tried adding a dep on ffmpeg and enabling that CMake variable, but got build errors due to API changes. I didn't try the dep on R or adding deps on libtiff, jpeg, etc. |
I did not apply @jacknagel's patch. I'll test your formula with Jack's patch tomorrow. |
Sounds good. Make a gist of your CMakeCache.txt when you have some time. |
@2bits the difference between your and my CMakeCache.txt is due to my Xcode-only setup and cmake. Perhaps there is a cmake env var, I could set so cmake picks up the Frameworks from inside of Xcode.app?
this is fine, since the headers are symlinked from the framework to that dir.
this is bullshit. The private headers are not symlinked to Xcode.app/.../usr/include :-(
The same is true for opengl. The libs are found in /System/Library but not the freamework from inside Xcode.app.
|
Okay, I fixed the OPENGL and AGL stuff by adding However, since the std_cmake_parameters include |
It sounds like you've gotten into some gory CMake issues. What I can offer is limited, but I'll mention that CMake does a good job of making separate Find modules that you should read when it's not finding what you want. They are located in
From reading FindTCL.cmake, it looks like there are some variables you can preload. I don't know at this point how to tune the search directories globally, but you did come across the one, |
else | ||
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'" | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is empty.
Besides the caveats, I am super-satisfied now. Tested on my machines. Like charm. It runs! |
Examples are small so I will just install them. They are worth it to someone who is crafting something complex with vtk. The caveats seem good, but they seem to imply that PyQt would work with vtk even without the I didn't otool the |
The stuff in |
Right on. Then my long description for the
That listing is from before it moves |
@2bits I read this as
To the long description for our Btw.: Concerning the examples. I just tested to build them, too. It works without problems, so basically we could add an |
system 'make' | ||
system 'make install' # Finally move libs in their places. | ||
# And move the examples into the Cellar, 2.5 MB, which are very useful. | ||
system 'exit 1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sollbruchstelle? (This is a German word) :-D
@2bits no problem. Ping me for a final test-run. |
I decided that 4MB of examples without an option is more than justified considering any project using vtk is bound to be highly complex and would find this data handy. |
That is true and I agree. But some may prefer to have the C/C++ and other examples to be compiled (which is harder to do it afterwars oneself). That takes extra time and therefore an option might be nice. |
I am building your formula right now. Looks good ... |
oic, the |
Perhaps we should bottle vtk. But not in this pull request. You did a fantastic job on this formula! |
Thanks. It was a team effort. Did we learn anything, though? Is there something we should be reporting upstream? |
Well, I'd like to refactor all the python specific code and place it somewhere central. Not only The VTK team is working on a new, modular VTK 6 version. Let's hope, it's not too different/difficult to adapt :-/ |
Is this ready for final review, then? I should have some time tomorrow. |
@jacknagel almost. @2bits wants to add the On Xcode-only with the new XQuartz, there seems to be a problem though, but I'd not hold this formula any longer because of that. |
Upgrade vtk to version 5.10. Add deps on `sip` and `pyqt` if the user options `--pyqt` Add cmake args to enable SIP/PyQt if `--pyqt` Add cmake args for `-DSIP_PYQT_DIR` as `HOMEBREW_PREFIX/share/sip`. Add `skip_clean :all` to help vtkpython find the symbol `_environ` Change the location of the python `.so` modules so they and the Egg get installed into `lib/which_python/'site-packages'`. Add code so `site-packages` is created and prepended to the PYTHONPATH to stop build errors. Add `-DPYTHON_INCLUDE_DIR` so the right headers are located. Remove the workaround code that was previously added to support Python getting RPATHs, as RPATHS are fixed in Homebrew Core. Add code that removes three duplicate files in `site-packages` that cause the linking step to fail, files that already exist in HB `site-packages` when using brewed Python. Add code to `mv` the python module directory `vtk` out of the `VTK-5.10-py2.7.egg` and into `site-packages`. Without that, you can't import vtk into Python. Add code to install the `Examples` Tested on Lion using clang and llvm from XCode-4.3.3 with the CLT and without the CLT against system Python, HB framework Python, HB non-framework Python, Qt-4.8.2, sip, pyqt, pyside and shiboken.
Amended to add |
@jacknagel this is ready for final review. @2bits has put huge amounts of time into it. I'd pull it :-) |
Pulled, sorry for the delay. |
Upgrade vtk to version 5.10. Add deps on `sip` and `pyqt` if the user options `--pyqt` Add cmake args to enable SIP/PyQt if `--pyqt` Add cmake args for `-DSIP_PYQT_DIR` as `HOMEBREW_PREFIX/share/sip`. Add `skip_clean :all` to help vtkpython find the symbol `_environ` Change the location of the python `.so` modules so they and the Egg get installed into `lib/which_python/'site-packages'`. Add code so `site-packages` is created and prepended to the PYTHONPATH to stop build errors. Add `-DPYTHON_INCLUDE_DIR` so the right headers are located. Remove the workaround code that was previously added to support Python getting RPATHs, as RPATHS are fixed in Homebrew Core. Add code that removes three duplicate files in `site-packages` that cause the linking step to fail, files that already exist in HB `site-packages` when using brewed Python. Add code to `mv` the python module directory `vtk` out of the `VTK-5.10-py2.7.egg` and into `site-packages`. Without that, you can't import vtk into Python. Add code to install the `Examples` Tested on Lion using clang and llvm from XCode-4.3.3 with the CLT and without the CLT against system Python, HB framework Python, HB non-framework Python, Qt-4.8.2, sip, pyqt, pyside and shiboken. Closes Homebrew#12807. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Upgrade vtk to version 5.10. Add deps on `sip` and `pyqt` if the user options `--pyqt` Add cmake args to enable SIP/PyQt if `--pyqt` Add cmake args for `-DSIP_PYQT_DIR` as `HOMEBREW_PREFIX/share/sip`. Add `skip_clean :all` to help vtkpython find the symbol `_environ` Change the location of the python `.so` modules so they and the Egg get installed into `lib/which_python/'site-packages'`. Add code so `site-packages` is created and prepended to the PYTHONPATH to stop build errors. Add `-DPYTHON_INCLUDE_DIR` so the right headers are located. Remove the workaround code that was previously added to support Python getting RPATHs, as RPATHS are fixed in Homebrew Core. Add code that removes three duplicate files in `site-packages` that cause the linking step to fail, files that already exist in HB `site-packages` when using brewed Python. Add code to `mv` the python module directory `vtk` out of the `VTK-5.10-py2.7.egg` and into `site-packages`. Without that, you can't import vtk into Python. Add code to install the `Examples` Tested on Lion using clang and llvm from XCode-4.3.3 with the CLT and without the CLT against system Python, HB framework Python, HB non-framework Python, Qt-4.8.2, sip, pyqt, pyside and shiboken. Closes Homebrew#12807. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Upgrade vtk to version 5.10. Add deps on `sip` and `pyqt` if the user options `--pyqt` Add cmake args to enable SIP/PyQt if `--pyqt` Add cmake args for `-DSIP_PYQT_DIR` as `HOMEBREW_PREFIX/share/sip`. Add `skip_clean :all` to help vtkpython find the symbol `_environ` Change the location of the python `.so` modules so they and the Egg get installed into `lib/which_python/'site-packages'`. Add code so `site-packages` is created and prepended to the PYTHONPATH to stop build errors. Add `-DPYTHON_INCLUDE_DIR` so the right headers are located. Remove the workaround code that was previously added to support Python getting RPATHs, as RPATHS are fixed in Homebrew Core. Add code that removes three duplicate files in `site-packages` that cause the linking step to fail, files that already exist in HB `site-packages` when using brewed Python. Add code to `mv` the python module directory `vtk` out of the `VTK-5.10-py2.7.egg` and into `site-packages`. Without that, you can't import vtk into Python. Add code to install the `Examples` Tested on Lion using clang and llvm from XCode-4.3.3 with the CLT and without the CLT against system Python, HB framework Python, HB non-framework Python, Qt-4.8.2, sip, pyqt, pyside and shiboken. Closes Homebrew#12807. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Upgrade vtk to version 5.10.
Add deps on
sip
andpyqt
if the user options--pyqt
Add cmake args to enable SIP/PyQt if
--pyqt
Add cmake args for
-DSIP_PYQT_DIR
asHOMEBREW_PREFIX/share/sip
.Add
skip_clean :all
to help vtkpython find the symbol_environ
Change the location of the python
.so
modules so they and the Eggget installed into
lib/which_python/'site-packages'
.Add code so
site-packages
is created and prepended to thePYTHONPATH to stop build errors.
Add
-DPYTHON_INCLUDE_DIR
so the right headers are located.Remove the workaround code that was previously added to support
Python getting RPATHs, as RPATHS are fixed in Homebrew Core.
Add code that removes three duplicate files in
site-packages
that cause the linking step to fail, files that already
exist in HB
site-packages
when using brewed Python.Add code to
mv
the python module directoryvtk
out of theVTK-5.10-py2.7.egg
and intosite-packages
. Without that,you can't import vtk into Python.
Tested on Lion using clang and llvm from XCode-4.3.3 with the CLT
and without the CLT against system Python, HB framework Python,
HB non-framework Python, Qt-4.8.2, sip, pyqt, pyside and shiboken.