Search code examples
configurationconfigconfiguration-filesaplgnu-apl

Specifying Non-Absolute Paths to Libraries in GNU APL


I want to be able to use the same config file across all of my machines, and my username is unfortunately different at work, so absolute paths are difficult for me to use.

Is there a common way to specify non-absolute directories for LIBREF-* variables in the GNU APL preferences file? It seems like tilde expansion and environment variables are not interpreted. But I can't find any info on this through Google.

Thank You for Your time.

EDIT 1:

To be clear, I have tried the following:

LIBREF-0 = $HOME/Documents/apl-libs/lib0

But it seems to show up inside of )LIBS with $HOME intact.


Solution

  • In my search through the documentation, I came across a reference to the $APL_LIB_ROOT environment variable.

    If this is set and there are no other definitions for library directories in both the system and user preferences files, then GNU APL will use the following directory structure to populate these values:

    LIBREF-0 = $APL_LIB_ROOT/workspaces
    LIBREF-1 = $APL_LIB_ROOT/wslib1
    LIBREF-2 = $APL_LIB_ROOT/wslib2
    LIBREF-3 = $APL_LIB_ROOT/wslib3
    LIBREF-4 = $APL_LIB_ROOT/wslib4
    LIBREF-5 = $APL_LIB_ROOT/wslib5
    LIBREF-6 = $APL_LIB_ROOT/wslib6
    LIBREF-7 = $APL_LIB_ROOT/wslib7
    LIBREF-8 = $APL_LIB_ROOT/wslib8
    LIBREF-9 = $APL_LIB_ROOT/wslib9
    

    However, at least on the system I am using (GNU Guix), there are entries in the system-wide configuration file for the included libraries for 3, 4, and 5 (which is what is intended by upstream).

    This works around my problem, but was not clearly documented anywhere I could find, so I figured it would do well to be an answer. Below are some links I found helpful while discovering this.