Menu

Distributing PLPlot and "absolute paths"

DrO
2015-05-13
2015-11-01
  • DrO

    DrO - 2015-05-13

    I've installed PLPlot 5.11 in WinXP64, using MingW/MSys (32), and also use
    it with GTK3.

    All the tests work fine on the dev machine.

    However, when I distribute my (PLPlot) apps to another machine (along with
    all necessary dll's), it still fails since it can't find "drivers".

    Apparently, the build/make/install of PLPLot creates PLPlot libs which have
    "absolute paths" "hard wired" into the libs.

    Thus, apparently, the only way to get the distributed PLPLot apps to work is
    to create an identical disk partition/dir structure as on the dev machine,
    and copy all the drivers etc to that location. At least that is the only
    way I got it to work.

    Is there any possibility of creating config/make etc files so that on
    build/make/install of PLPLot, it does NOT "hardwire absolute paths" into the
    libs? Or is there some trick to re-map the PLPLot lib's locations
    expectations?

    Somewhat related to this is question, is that of static libs, instead of
    dll's. I've tried compiling my PLPlot codes linked against (what I thought)
    was the static libs (e.g. so that there should be no need to distribute all
    the dll's with the app), but I have not managed to succeed. Any thoughts
    would be greatly appreciated.

    Many thanks

    DrO

     
    • GregJung

      GregJung - 2015-11-01

      You need to override the built-in search directory for the "drivers" - meaning, the .info files that are found in lib/plplot-5.11.1/drivers. The environment variable PLPLOT_DRV_DIR will do that for you. This will locate the .info files but the associated .dll's will only be found if in the %PATH%.

      PLPLOT_DRV_DIR is found in plCore.c

      The other auxilliary data can be pointed to as discussed in this plplotP.h comment:

      ~~~~
      //--------------------------------------------------------------------------
      // The following environment variables are defined:
      //
      // PLPLOT_BIN # where to find executables
      // PLPLOT_LIB # where to find library files (fonts, maps, etc)
      // PLPLOT_TCL # where to find tcl scripts
      //
      // PLPLOT_HOME # basename of plplot hierarchy
      //
      // search order:
      // 1) the most specific possible locators, one of
      // $(PLPLOT_BIN)
      // $(PLPLOT_LIB)
      // $(PLPLOT_TCL)
      // as appropriate
      // comment: comment:
      // 2) the current directory
      //
      // 3) one of $(PLPLOT_HOME)/bin
      // $(PLPLOT_HOME)/lib
      // $(PLPLOT_HOME)/tcl
      // as appropriate
      //
      // 4) as appropriate, the compile-time (Makefile)
      // BIN_DIR, LIB_DIR, TCL_DIR
      //
      // 8 Jun 1994 mj olesen (olesen@weber.me.queensu.ca)
      //

      define PLPLOT_BIN_ENV "PLPLOT_BIN"

      define PLPLOT_LIB_ENV "PLPLOT_LIB"

      define PLPLOT_TCL_ENV "PLPLOT_TCL"

      define PLPLOT_HOME_ENV "PLPLOT_HOME"

      ~~~~

      Static libs:
      I've succeeded with static libs when I compile with ENABLE_DYNDRIVERS=OFF
      and BUILD_SHARED=OFF, using only a few of the devices; I then make a new libplplot.a with the 'ar' tool to add in libqhull.a, shaplib.a, libcsi---.a, etc.
      Then the question is about the remaining shared libs that the drivers themselves might call on.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.