Macaulay2 / M2

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

installPackage before ~/.Macaulay2 exists #1396

Closed mahrud closed 4 years ago

mahrud commented 4 years ago

On a clean install, where .Macaulay2 doesn't exist yet, this seems to fail:

[root@noether clang]# M2 --stop -q -e 'installPackage "FirstPackage"'
Macaulay2, version 1.16.0.1
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, LLLBases, MinimalPrimes, PrimaryDecomposition,
               ReesAlgebra, TangentCone, Truncations
/usr/local/share/Macaulay2/Core/installPackage.m2:52:22:(1):[9]: error: realpath failed: Bad address
/usr/local/share/Macaulay2/Core/installPackage.m2:483:6:(1):[8]: --back trace--
/usr/local/share/Macaulay2/Core/methods.m2:119:80:(1):[7]: --back trace--
/usr/local/share/Macaulay2/Core/option.m2:16:8:(1):[6]: --back trace--
/usr/local/share/Macaulay2/Core/installPackage.m2:431:6:(1):[5]: --back trace--
/usr/local/share/Macaulay2/Core/methods.m2:119:80:(1):[4]: --back trace--
currentString:1:1:(3):[2]: --back trace--
Macaulay2/Core/startup.m2.in:557:33:(0):[1]: --back trace--
Macaulay2/Core/startup.m2.in:668:6:(0): --back trace--

I'd imagine that since -q is set, installPackage would not install in the user directory. Is there another option for just running the examples?

DanGrayson commented 4 years ago

Good catch. The flag "-q" just means not to read from the user's application directory, so the code for installPackage should make the directory it needs.

For now, though, you might prefer to use something like InstallPrefix => "/tmp" as an option to installPackage. That might also help with any later creation of artifacts, since the user application directory depends on the OS.

mahrud commented 4 years ago

Is there an option to just run the examples and documentation checks without actually installing them? For instance so you wouldn't need to run uninstallPackage before installPackage when developing a package.

DanGrayson commented 4 years ago

No, and that wouldn't be a complete test, since there could be errors in the documentation.