Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
347 stars 231 forks source link

Wishlist: Use external programs if present #407

Closed d-torrance closed 4 years ago

d-torrance commented 8 years ago

Currently, packages which use external programs optionally built by M2 use

prefixDirectory | currentLayout#"programs"

as their path. Some packages allow the user to specify a different path using init scripts.

It would be great if M2 could detect which of these programs already exist on the system and store that information somewhere for use by these packages.

Note that this is further complicated in Debian by the fact that some of the programs used by M2 packages don't have standard names, e.g., the 4ti2 binaries are prepended with "4ti2-" and the nauty binaries with "nauty-".

DanGrayson commented 8 years ago

In addition, the packages containing the files so detected have to be added to the list of dependencies of the Macaulay2 package.

DanGrayson commented 8 years ago

Consider 4ti2, for example. The script M2/configure.ac should check for the presence of 4ti2 in the system on PATH and not build it. Then it should inform the package FourTiTwo somehow, which currently always looks for it in prefixDirectory | currentLayout#"programs".

One idea would be to have FourTiTwo look on the PATH for 4ti2 by default, and to have the directory prefixDirectory | currentLayout#"programs" added to the front of the PATH. That's probably okay -- we won't be installing programs in there with names that conflict with system programs.

When Macaulay2 is installed by the package manager, we need to list the package containing the program 4ti2 as a prerequisite. The construction of lists of prerequisites is done differently by each entry in M2/distributions, since finding the name of that package depends on the type of OS distribution we are running under.

The packages could look for the programs under all popular names, e.g., dreadnaut and nauty-dreadnaut.

d-torrance commented 4 years ago

I've started working on a solution to this issue in the branch https://github.com/d-torrance/M2/tree/programs.

The first few commits basically involve moving and generalizing code from gfanInterface to Core, but there's still lots of more work to do. In particular:

d-torrance commented 4 years ago

With the merging of #1513, all programs required for building Macaulay2 are supported. Closing this issue.