Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#19111 closed enhancement (fixed)

Proposed additions to vtk5 Portfile

Reported by: tgamblin@… Owned by: mf2k (Frank Schima)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: vtk qt carbon vtk5 python pyqt4 qt4 Cc: dweber@…
Port: vtk5

Description

I've added some variants to the vtk5 Portfile that better integrate with qt4-mac and py25-pyqt4. I'd like to see these added to the MacPorts distro... who do I talk to about this?

The current vtk5 portfile only allows building with cocoa or x11 support, but the cocoa build of vtk5 doesn't allow embedding in qt widgets because there are some unimplemented methods in vtkCocoaRenderWindow in VTK 5.2. These methods are implemented properly for the Carbon build of VTK, so to embed in Qt, you have to build VTK with Carbon support.

I've added two variants to the build to allow this:

tcltk: bundles up the tcl/tk build options into a variant carbon: sets VTK_USE_COCOA to OFF and VTK_USE_CARBON to ON.

I separated these out because I couldn't get things to build properly with Carbon, Tk, and Python. If you want to integrate with PyQt4, you would build VTK like this:

sudo port install vtk5 +carbon +python

If you want to build what the vtk5 port builds right now, these are the options you would use:

sudo port install vtk5 +tcltk +x11 +python

Can I get these changes integrated into MacPorts? I've attached my modified Portfile.

The only thing I'm unsure of is what the default variants should be. I've set them to my preferred variants (+carbon +python), but just so that nobody gets surprised they should probably be set to +tcltk +x11 +python to reflect what the port does right now.

Thanks! -Todd Gamblin

Attachments (2)

Portfile (5.9 KB) - added by tgamblin@… 16 years ago.
Portfile.2 (6.0 KB) - added by tgamblin@… 16 years ago.

Download all attachments as: .zip

Change History (15)

Changed 16 years ago by tgamblin@…

Attachment: Portfile added

comment:1 Changed 16 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to macsforever2000@…
Status: newassigned

comment:2 Changed 16 years ago by mf2k (Frank Schima)

I can build with +carbon +python, but when I attempted to build with +tcltk +x11 +python, but I get the following error:

$ sudo port install vtk5 +tcltk +x11 +python
--->  Computing dependencies for vtk5
--->  Fetching vtk5
--->  Verifying checksum(s) for vtk5
--->  Extracting vtk5
--->  Configuring vtk5
--->  Building vtk5
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_mports_trunk_dports_graphics_vtk5/work/VTK" && make all " returned error 2
Command output:       vtkCarbonRenderWindow::MakeCurrent()       in vtkCarbonRenderWindow.o
  "_aglEnable", referenced from:
      vtkCarbonRenderWindow::UpdateGLRegion()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::UpdateGLRegion()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::UpdateGLRegion()       in vtkCarbonRenderWindow.o
  "_aglSetOffScreen", referenced from:
      vtkCarbonRenderWindow::CreateOffScreenWindow(int, int)in vtkCarbonRenderWindow.o
  "_aglChoosePixelFormat", referenced from:
      vtkCarbonRenderWindowInternal::ChoosePixelFormat(int, int, int, int, int, int, int)in vtkCarbonRenderWindow.o
  "_aglDestroyContext", referenced from:
      vtkCarbonRenderWindow::DestroyWindow()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::DestroyOffScreenWindow()       in vtkCarbonRenderWindow.o
  "_aglUpdateContext", referenced from:
      vtkCarbonRenderWindow::UpdateGLRegion()       in vtkCarbonRenderWindow.o
  "_aglGetError", referenced from:
      aglReportError()     in vtkCarbonRenderWindow.o
  "_aglSetDrawable", referenced from:
      vtkCarbonRenderWindow::UpdateGLRegion()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::CreateAWindow()       in vtkCarbonRenderWindow.o
  "_aglSetCurrentContext", referenced from:
      vtkCarbonRenderWindow::DestroyWindow()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::MakeCurrent()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::MakeCurrent()       in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::CreateOffScreenWindow(int, int)in vtkCarbonRenderWindow.o
      vtkCarbonRenderWindow::CreateAWindow()       in vtkCarbonRenderWindow.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [bin/libvtkRendering.5.2.1.dylib] Error 1
make[1]: *** [Rendering/CMakeFiles/vtkRendering.dir/all] Error 2
make: *** [all] Error 2

Error: Status 1 encountered during processing.

Any ideas?

comment:3 Changed 16 years ago by dweber@…

Cc: dweber@… added

Cc Me!

comment:4 Changed 16 years ago by tgamblin@…

I think this is because you did not put -carbon in your build line. I can build +python +x11 -carbon fine on my system. I do not believe that you can't build VTK with more than one of carbon, cocoa, or x11 -- is there a way to express that in the Portfile so it warns you about the variants you selected being incompatible?

Also, do you think the default variants should be changed? I mentioned above that the current port of vtk5 builds, by default, with:

+python +x11 +tcltk

In the portfile I submitted (which has apparently confused you) the defaults are:

+carbon +python

The question is whether the current set is the right set of defaults for MacPorts, since other Ports (like Qt4) default to prefer native guis like cocoa/carbon instead of X. I think mac users trying vtk for the first time might expect that it use a native GUI. The problem with that is that I think most VTK users are going to expect tcl/tk support (since that was the first scripting language VTK supported), but I can't seem to get carbon and tk to build together properly. I *did* successfully build with cocoa, python, and tcl/tk, but VTK 5.2 won't embed properly in Qt unless you build with Carbon (b/c there are some unimplemented methods in the cocoa render window). Sigh.

If that was way too many configurations, here's a summary:

+tcltk -carbon +x11 Builds, works, no embedding in qt4-mac, but embeds in qt4-x11 (and need to disable carbon) -tcktk +carbon -x11 Builds fine, embeds in qt4-mac, no tcl/tk support

+tcltk works unless combined with carbon +python seems to build with whatever. Anything -carbon -x11 works fine (uses Cocoa), but doesn't embed in qt4-mac or qt4-x11

Problem configurations: Anything +carbon +tcltk Doesn't build. Build error somewhere in the X libraries that I could not figure out. Anything +carbon +x11 Doesn't build. VTK doesn't support carbon + x11

Thoughts?

comment:5 Changed 16 years ago by tgamblin@…

The formatting didn't come out quite right on that. Here's a properly formatted summary:

+tcltk -carbon +x11 Builds, works, no embedding in qt4-mac, but embeds in qt4-x11 (and need to disable carbon)
-tcktk +carbon -x11 Builds fine, embeds in qt4-mac, no tcl/tk support

+tcltk works unless combined with carbon
+python seems to build with whatever.
Anything -carbon -x11 works fine (uses Cocoa), but doesn't embed in qt4-mac or qt4-x11

Problem configurations:
Anything +carbon +tcltk Doesn't build. Build error somewhere in the X libraries that I could not figure out.
Anything +carbon +x11 Doesn't build. VTK doesn't support carbon + x11

comment:6 in reply to:  4 Changed 16 years ago by dweber@…

Replying to tgamblin@…:

I think this is because you did not put -carbon in your build line. I can build +python +x11 -carbon fine on my system. I do not believe that you can't build VTK with more than one of carbon, cocoa, or x11 -- is there a way to express that in the Portfile so it warns you about the variants you selected being incompatible?

See http://guide.macports.org/#reference.variants, ie: variant name [requires variant] [conflicts variant] [description description]

Also, do you think the default variants should be changed? I mentioned above that the current port of vtk5 builds, by default, with:

+python +x11 +tcltk

In the portfile I submitted (which has apparently confused you) the defaults are:

+carbon +python

The question is whether the current set is the right set of defaults for MacPorts, since other Ports (like Qt4) default to prefer native guis like cocoa/carbon instead of X. I think mac users trying vtk for the first time might expect that it use a native GUI. The problem with that is that I think most VTK users are going to expect tcl/tk support (since that was the first scripting language VTK supported), but I can't seem to get carbon and tk to build together properly. I *did* successfully build with cocoa, python, and tcl/tk, but VTK 5.2 won't embed properly in Qt unless you build with Carbon (b/c there are some unimplemented methods in the cocoa render window). Sigh.

If that was way too many configurations, here's a summary:

+tcltk -carbon +x11 Builds, works, no embedding in qt4-mac, but embeds in qt4-x11 (and need to disable carbon) -tcktk +carbon -x11 Builds fine, embeds in qt4-mac, no tcl/tk support

+tcltk works unless combined with carbon +python seems to build with whatever. Anything -carbon -x11 works fine (uses Cocoa), but doesn't embed in qt4-mac or qt4-x11

Problem configurations: Anything +carbon +tcltk Doesn't build. Build error somewhere in the X libraries that I could not figure out. Anything +carbon +x11 Doesn't build. VTK doesn't support carbon + x11

Thoughts?

Whatever you decide, do try configure to configure the variants using the 'requires' and 'conflicts' phrases to get all these configuration dependencies resolved.

Best, Darren

Changed 16 years ago by tgamblin@…

Attachment: Portfile.2 added

comment:7 Changed 16 years ago by tgamblin@…

Ok, I've added a new Portfile with known conflicts:

carbon conflicts with tcltk and x11 x11 conflicts with carbon tcltk conflicts with carbon

I've also set the default variants to +x11 +tcltk +python, to match the previous version.

I think this is the best thing for now since tcl/tk + x11 is more typical than carbon + python with no tcl/tk. I do think mac GUI support should be improved and made default at some later date, but I don't have time to fix this right now. I might be able to look at this in May sometime.

See if this one passes muster. Thanks!

comment:8 in reply to:  7 Changed 16 years ago by dweber@…

Replying to tgamblin@…:

Ok, I've added a new Portfile with known conflicts:

carbon conflicts with tcltk and x11 x11 conflicts with carbon tcltk conflicts with carbon

I've also set the default variants to +x11 +tcltk +python, to match the previous version.

I think this is the best thing for now since tcl/tk + x11 is more typical than carbon + python with no tcl/tk. I do think mac GUI support should be improved and made default at some later date, but I don't have time to fix this right now. I might be able to look at this in May sometime.

See if this one passes muster. Thanks!

I've started to muck around with a port for the latest release of vtk (5-4-0). Maybe this effort could be translated to the latest release? To my knowledge, vtk5 is currently at release 5-2-1.

Best, Darren

comment:9 Changed 16 years ago by dweber@…

See my issues on VTK-5-4-0 in ticket http://trac.macports.org/ticket/19000

I should take more time to look at vtk5, but I didn't want to tamper with it, so I created vtk54 in the svn trunk.

Best, Darren

comment:10 Changed 16 years ago by mf2k (Frank Schima)

Your modified portfile works with +tcltk +x11 +python variants. I've committed the changes in r49649. Thanks! Does this ticket need to remain open any longer?

comment:11 Changed 16 years ago by tgamblin@…

Nope, thanks!

comment:12 Changed 16 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed

comment:13 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.