[Paraview] Compiling without X11 libraries
Dave Partyka
dave.partyka at kitware.com
Thu Feb 25 11:35:13 EST 2010
Probably a good idea considering several have had to reinvent this wheel
more than once.
On Thu, Feb 25, 2010 at 11:16 AM, Moreland, Kenneth <kmorel at sandia.gov>wrote:
> Thanks everyone for your help. I’m pretty sure I got past this issue.
>
> I did have to “hack” VTK/CMake/vtkUseX.cmake as you mentioned. That said,
> is there a reason not to check in a change that allows you to set VTK_USE_X
> (that is, set VTK_USE_X_OPTIONAL) in the case that VTK_OPENGL_HAS_OSMESA is
> ON? The system would by default behave the same but would allow you to turn
> of X in this case when you have OSMesa but no X.
>
> -Ken
>
>
>
> On 2/25/10 8:08 AM, "pat marion" <pat.marion at kitware.com> wrote:
>
> I think the latest release of MesaLib using a configure script, but older
> versions just provided makefiles. I still use the older releases and run
> 'make linux-osmesa' to get libOSMesa.so and libGLU.so without any
> dependencies on Xlib.
>
> Unfortunately you can't just set libOSMesa.so in place of libGL.so (setting
> OPENGL_gl_LIBRARY in cmake) because cmake uses the OPENGL_gl_LIBRARY
> variable to check for the existance of real opengl versus osmesa. So that's
> why I said to set OPENGL_gl_LIBRARY to the empty string.
>
> I ran a new build and didn't get any of the link errors I described
> previously, so you probably don't have to worry about the other hacks I
> mentioned. The steps should just be:
>
> Edit VTK/CMake/vtkUseX.cmake and set VTK_USE_X_OPTIONAL to 1 instead of 0
> (then VTK_USE_X will automatically default to OFF). Create a new build
> folder and configure with -DOPENGL_gl_LIBRARY="". Set OSMESA_LIBRARY and
> OSMESA_INCLUDE_DIR. Now you should be able to build a pvserver that has no
> dependencies on X11 or libGL.
>
> Pat
>
> On Thu, Feb 25, 2010 at 8:39 AM, Biddiscombe, John A. <biddisco at cscs.ch>
> wrote:
>
> Ken
>
> From the Mesa web pages ...(snip below), there are 3 driver options for
> building Mesa,, both Xlib and DRI make use of the X11 libraries, but it is
> my understanding that if you build mesa with the
> --with-driver=osmesa
>
> Then the offending glx* linkage will not be necessary. You will get a
> libOSMesa instead of libGL – but you simply tell VTK to use that one instead
> of libGL. (Pat’s tweaks may also be required to stop vtkXRenderwindow stuff
> being pulled in).
>
> I haven’t actually tried this, but I’d like to be proved right or wrong so
> that I know for future reference.
>
> JB
>
> - *Xlib* - This is the default mode for building Mesa. It uses Xlib as
> a software renderer to do all rendering. It corresponds to the option
> --with-driver=xlib. The libX11 and libXext libraries, as well as the
> X11 development headers, will be need to support the Xlib driver.
> - *DRI* - This mode uses the DRI hardware drivers for accelerated
> OpenGL rendering. Enable the DRI drivers with the option
> --with-driver=dri. See the basic installation instructions <
> http://www.mesa3d.org/install.html> for details on prerequisites for
> the DRI drivers.
> - *OSMesa* - No libGL is built in this mode. Instead, the driver code
> is built into the Off-Screen Mesa (OSMesa) library. See the Off-Screen
> Rendering <http://www.mesa3d.org/osmesa.html> page for more details.
>
>
>
>
>
> *From:* paraview-bounces at paraview.org [
> mailto:paraview-bounces at paraview.org <paraview-bounces at paraview.org>] *On
> Behalf Of *pat marion
> *Sent:* 24 February 2010 21:33
> *To:* Moreland, Kenneth
> *Cc:* ParaView
> *Subject:* Re: [Paraview] Compiling without X11 libraries
>
>
> Sorry I misread your email, you don't want to create X11 windows at all.
> You want to do pure osmesa. So then you'll be all set if you follow the
> hacks I describe. By the way, when I compile osmesa, for pure offscreen, I
> just run 'make linux-osmesa' and the result is libOSMesa.so and libGLU.so.
>
> Pat
>
> On Wed, Feb 24, 2010 at 3:29 PM, pat marion <pat.marion at kitware.com>
> wrote:
> Hi Ken,
>
> Below is copy and paste from a previous email where I answered a similar
> question off-list (your question is a little different because you want to
> use Mesa3D to create windows). Unfortunately you can't do this without some
> small hacks to the cmakelists. I think the important part for you is in the
> last paragraph.
>
> ----------
>
> Using true offscreen means using vtkOSOpenGLRenderWindow and not
> vtkXOpenGLRenderWindow. Which one is used depends on whether or not
> VTK_USE_OSMESA is defined in $build_dir/VTK/vtkToolkits.h.
>
> VTK_USE_OSMESA is defined when:
>
> * OPENGL_gl_LIBRARY is set to the empty string
> * VTK_USE_X is OFF
> * VTK_OPENGL_HAS_OSMESA is true
>
> If the platform is Linux, and cmake is able to locate X11 libraries &
> headers, then cmake will force VTK_USE_X to ON. You must hack
> VTK/CMake/vtkUseX.cmake to set it to OFF.
>
> Look at the bottom of $build_dir/VTK/vtkToolkits.h to make sure that you
> have successfully defined VTK_USE_OSMESA.
>
> If you are doing a shared build, and OPENGL_gl_LIBRARY is the empty string,
> then you will get link errors because of some changes that were introduced
> after the transitive linking patch last June. To avoid that, you need to
> change all instances of ${OPENGL_gl_LIBRARY} to ${OSMESA_LIBRARY} in all
> CMakeLists.txt except for VTK/Rendering/CMakeLists.txt or
> VTK/CMakeLists.txt.
>
>
> Pat
>
> On Wed, Feb 24, 2010 at 3:10 PM, Moreland, Kenneth <kmorel at sandia.gov>
> wrote:
>
>
> I do have PARAVIEW_BUILD_GT_GUI off, but I still need rendering. I still
> need to create OpenGL windows, but I will only ever do it through OSMesa,
> never through X11.
>
> -Ken
>
>
>
>
> On 2/24/10 1:02 PM, "Dave Partyka" <dave.partyka at kitware.com <
> http://dave.partyka@kitware.com> > wrote:
>
>
> I am not sure about ParaView but in VTK if you turn rendering off you
> should be able to do this. Have you tried turning PARAVIEW_BUILD_QT_GUI off?
> I do that when I generate the command line tools package on Mac OSX.
>
> On Wed, Feb 24, 2010 at 2:40 PM, Moreland, Kenneth <kmorel at sandia.gov <
> http://kmorel@sandia.gov> > wrote:
>
>
> Is there any way to compile ParaView without any X11 libraries at all? I
> compiled OSMesa support for Mesa 3D and tried to link that, but when I link
> I am missing a bunch of glX* symbols. I think that in order to build these
> functions for Mesa, I need an X11 library, which gets me back to the dilemma
> of what if you have no libraries?
>
> -Ken
>
>
> **** Kenneth Moreland
> *** Sandia National Laboratories
> ***********
> *** *** *** email: kmorel at sandia.gov <http://kmorel@sandia.gov> <
> http://kmorel@sandia.gov>
>
> ** *** ** phone: (505) 844-8919
> *** web: http://www.cs.unm.edu/~kmorel <
> http://www.cs.unm.edu/%7Ekmorel>
>
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com> <
> http://www.kitware.com>
>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
>
>
>
>
> **** Kenneth Moreland
> *** Sandia National Laboratories
> ***********
> *** *** *** email: kmorel at sandia.gov <http://kmorel@sandia.gov>
> ** *** ** phone: (505) 844-8919
> *** web: http://www.cs.unm.edu/~kmorel <
> http://www.cs.unm.edu/%7Ekmorel>
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
>
>
>
> **** Kenneth Moreland
> *** Sandia National Laboratories
> ***********
> *** *** *** email: kmorel at sandia.gov
> ** *** ** phone: (505) 844-8919
> *** web: http://www.cs.unm.edu/~kmorel
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100225/4f438153/attachment-0001.htm>
More information about the ParaView
mailing list