Thorns in ExternalLibraries should abort if the old "extras" mechanism has been selected

Issue #216 closed
Ian Hinder created an issue

The old way of specifying the location of external libraries, from Cactus/lib/make/extras, for example setting HDF5 = yes, is not compatible with the new mechanism where you must simply include the appropriate thorn from ExternalThorns. Using both can be confusing.

I propose modifying the thorns in ExternalLibraries to check if the old mechanism has been selected, and to abort with an explanatory error message telling the user not to set, e.g. HDF5 = yes, if they are using ExternalLibraries/HDF5.

I am attaching a completely untested patch for the HDF5 thorn which implements something like this. The code to determine if the user selected HDF5 = yes was taken from the extras directory.

Comments? If this is appropriate, it can be adapted to all the thorns in ExternalLibraries.

Keyword: ExternalLibraries

Comments (6)

  1. Erik Schnetter
    • removed comment

    This patch accesses the configuration variable HDF5, but does not declare it in configuration.ccl. If it is declared there, the patch should work fine.

    I would treat any non-empty value of HDF5 as error, not just "yes". That simplifies the logic, and our goal is to eliminate this variable completely in the long term.

    Someone needs to test this patch before it can be applied.

  2. Ian Hinder reporter
    • removed comment

    I have done both of those things - new patch attached. I have also changed to using the "BEGIN ERROR" / "END ERROR" mechanism that is being used in the rest of the script. Just using "echo" without wrapping it in these led to an "unrecognised line" error from the CST.

  3. Erik Schnetter
    • removed comment

    The patch is fine. I vote to apply it.

    Technically, $HDF5 could expand to a string beginning with a minus sign, which would make the test command "[" fail because it will interpret this as option. The suggested solution is to test whether "x$HDF5" is equal to "x" instead of testing "$HDF5" directly. I don't think this is an issue in practice.

  4. Log in to comment