[Paraview-developers] Mac OSX and "make install"

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Aug 16 17:59:57 EDT 2012


Folks,

ParaView cmake/install rules are being revamped. Hopefully this is no
surprise to the development community. A while ago I had posted an
email about the strategy for updating install rules which elucidated a
new install manta "we install what we build". Gone are they days where
you can set some esoteric *_INSTALL_THIRD_PARTY_LIBRARIES or something
like that expect ParaView "make install" or cpack to install those
miscellaneous libraries. ParaView Superbuild provides a mechanism to
build almost everything ParaView needs and then create packages from
it that are "complete", so to speak.

To summarize:
- "make install" -- is not to be used to generate redistributables,
but to install the runtimes a location on the build machine so that
users can use it. The root-dir can be moved anywhere on the build
machine and it will continue to work.
- to generate redistributable packages for sharing with other users,
one uses superbuilds.

With that in mind, I was revamping ParaView's install rules (that
affect "make install") for Macs. I ran into a conceptual problem. On
mac, ParaView should be creating a paraview.app bundle and
technically, "make install" should place that bundle at the given
location. However, in past, "make install" did a unix style "make
install" resulting all executables and libraries being placed under
<INSTALL_PREFIX>/bin, <INSTALL_PREFIX>/lib, etc. Then a magic script
kicked in that would generate an app as well that included *all*
dependencies including Qt, for example. There are several things bad
here: for one, installing stuff under .../bin .../lib was not what the
user expected. Also the app bundle is redistributable which is not
consistent with our new philosophy.

I've just pushed a change to stage that addresses these issues as
follows. The short version of the log is that users set a
MACOSX_APP_INSTALL_PREFIX (instead of CMAKE_INSTALL_PREFIX -- which is
hidden) to point to the location where they want to put the app
bundle. We under the covers let cmake install the files in a temporary
location and then run a tiny script that puts the libraries under the
app bundle and finally place the  bundle at MACOSX_APP_INSTALL_PREFIX.

Please feel free to raise any objections/concerns. I'm all ears.

-------------------------------------

commit a67c39f6044474967e7ae6fa530dede66fe53512
Author: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
Date:   Thu Aug 16 17:27:53 2012 -0400

    Fixing install rules on Mac to build ParaView.app.

    If building on apple, we will set cmake rules for ParaView such that "make
    install" will result in creation of an application bundle by default.

    The trick we play is as such:
    1. We hide the CMAKE_INSTALL_PREFIX variable at force it to a
       internal/temporary location. All generic VTK/ParaView install rules
       happily go about installing under this CMAKE_INSTALL_PREFIX location.
    2. We provide a new vairable MACOSX_APP_INSTALL_PREFIX that user can set to
       point where he wants the app bundle to be placed (default is
/Applications).
    3. We set CMAKE_INSTALL_NAME_DIR to point to location of runtime libraries
       in the app bundle. Thus when the libraries are installed, cmake
       automatically cleans up the install_name paths for all shared libs that
       we built to point to a location within the app.
    4. To make packaging of plugins easier, we install plugins under a directory
       named "plugins" in the temporary CMAKE_INSTALL_PREFIX location. This just
       a simple trick to avoid having to keep track of plugins we built.
    5. Every application that builds an app, then uses the
       ParaViewBrandingInstallApp.cmake or something similar to put all the
       libraries, plugins, python files etc. within the app bundle itself.
    6. Finally, the bundle generated under the temporary location is copied over
      to the path specified by MACOSX_APP_INSTALL_PREFIX.

    In keeping with our "WE INSTALL WHAT WE BUILD" rule, this app bundle is not
    distributable to others since it does not include Qt, or other external
    dependencies. For a distributable pacakage, refer to ParaView Super-build
    instructions.

    Change-Id: Id731a00df84c1161f7ec9a13bf2c774de0b4c829

Utkarsh

p.s. if you're actually going to try this commit, manually update the
VTK submodule to point to vtk-master since there's a fix that went
into VTK to resolve Python install rules for VTK which affected
ParaView.


More information about the Paraview-developers mailing list