developing a package

75 views
Skip to first unread message

Doug

unread,
Oct 9, 2021, 2:49:39 PM10/9/21
to Macaulay2
I'm wasting too much time trying to clean up my new package called FunctionFieldDesingularization.

I think it is because I'm clueless on where I should be when making the changes.
I have a directory ~/M2local/M2/M2/Macauly2/packages that contains all the current packages and this new one under development.

If I open a file emacs foo.m2 there I get a message as soon as I use F12, that FunctionFieldDesingularization is a string even before I try loadPackage.
And if I back off to the previous Macauly2 directory then when I try loadPackage I get an error that FunctionFieldDesingularization is not in my path.

So I've messed something up, but am clueless as to what.

Doug

Daniel R. Grayson

unread,
Oct 10, 2021, 6:00:00 PM10/10/21
to Macaulay2
Try putting `-q` on the `M2` command line -- that will suppress its attempt to find out what packages are out there and to make a web page
listing all of them.

Maybe also try the command `uninstallAllPackages()` -- you might have an erroneous half-installed package sitting there.


Douglas Leonard

unread,
Oct 10, 2021, 9:23:09 PM10/10/21
to maca...@googlegroups.com
Well

emacs foo.m2 -q

ignores my .emacs file containing the M2 F11 and F12 commands, so that is bad.

And yet it is F12 that produces all the errors inside the subdirectory  "packages".
But from the Macaulay2 directory itself, there is no FunctionFieldDesingularization.m2 found in the path.

I really need to know where I am supposed to be opening M2 to do my work on the development version of my package, so I have a file to open and know which version of it I am working on?
(I'm assuming that, at the moment, I have to be in ~/M2local/M2/M2/Macaulay2/packages for my development copy to be found at all, as the default is to look in subdirectories of /automnt related to M2.)

Also, maybe I could get some advice on what unistallPackage and installPackage really do,
as uninstallAllPackages() found some to uninstall, but none related to FunctionFieldDesingularization

Sorry I'm so hopeless at this stuff, but I really don't know where to look to learn this stuff myself,
Doug




From: maca...@googlegroups.com <maca...@googlegroups.com> on behalf of Daniel R. Grayson <danielrich...@gmail.com>
Sent: Sunday, October 10, 2021 5:00 PM
To: Macaulay2 <maca...@googlegroups.com>
Subject: [EXT] [Macaulay2] Re: developing a package
 
CAUTION: Email Originated Outside of Auburn.
Try putting `-q` on the `M2` command line -- that will suppress its attempt to find out what packages are out there and to make a web page
listing all of them.

Maybe also try the command `uninstallAllPackages()` -- you might have an erroneous half-installed package sitting there.


--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/c0ac7853-44fc-4445-8d1d-b749f86bdaden%40googlegroups.com.

Daniel R. Grayson

unread,
Oct 11, 2021, 2:55:33 PM10/11/21
to Macaulay2
Put `-q` on the `M2` command line, not on the `emacs` command line.  The way to add something to that command line
is to press C-u just before F12 -- then you are given a chance to edit the line.

It may not work to run M2 in the directory ~/M2local/M2/M2/Macaulay2/packages -- depending on what version of M2 you are running.
The problem is that the packages in that directory might get loaded by your old M2 but require features of the new M2.

Instead, you can work in an arbitrary directory and use the `FileName` option to `installPackage` and `loadPackage`.


Douglas Leonard

unread,
Oct 11, 2021, 3:55:38 PM10/11/21
to maca...@googlegroups.com
I was using M2 -q which doesn't accomplish anything that I can tell except getting command line prompts instead of the emacs windows.

I have no idea how and where to use C-u since the only before F12 is inside the emacs windows.
----------------------------------------------------------------------------------------------------------------------------------


So I seem to get the following when I'm in a directory without a FunctionFieldDesingularization.m2 file.

+ M2 --no-readline --print-width 79
Macaulay2, version 1.18
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems,
               LLLBases, MinimalPrimes, PrimaryDecomposition, ReesAlgebra,
               Saturation, TangentCone

i1 : loadPackage "FunctionFieldDesingularization";
stdio:1:1:(3): error: file not found on path: "FunctionFieldDesingularization.m2"

and I get something such as the following when I'm in a directory that has such a file:

+ M2 --no-readline --print-width 79
Macaulay2, version 1.18
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems,
               LLLBases, MinimalPrimes, PrimaryDecomposition, ReesAlgebra,
               Saturation, TangentCone

i1 : loadPackage "FunctionFieldDesingularization";
FunctionFieldDesingularization.m2:1:1:(3):[7]: error: no method found for applying newPackage to:
     argument 1 :  "FunctionFieldDesingularization" (of class String)
     argument 2 :  null (of class Nothing)
FunctionFieldDesingularization.m2:1:1:(3):[7]: --entering debugger (type help to see debugger commands)
FunctionFieldDesingularization.m2:1:1-6:15: --source code:
newPackage("FunctionFieldDesingularization",
     Version => "1.2",
     Date => "October 11, 2021",
     Authors => {{Name => "Douglas A. Leonard", Email => "leo...@auburn.edu"}},
     Headline => "Strong desingularization of function fields in arbitrary char",
     )


Doug

(My college account has a .emacs-Macaulay2 file that looks in directories under /automnt .)



Sent: Monday, October 11, 2021 1:55 PM
To: Macaulay2 <maca...@googlegroups.com>
Subject: Re: [EXT] [Macaulay2] Re: developing a package
 
--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.

Daniel R. Grayson

unread,
Oct 11, 2021, 4:33:45 PM10/11/21
to Macaulay2
Remove the extra comma:

Screen Shot 2021-10-11 at 3.32.19 PM.png

Douglas Leonard

unread,
Oct 11, 2021, 5:17:58 PM10/11/21
to maca...@googlegroups.com
Oops, that was leftover when I removed the Debugging and Reload lines.
But it doesn't affect my problems.

Can someone who has privileges in the development process try to load this package?
At the rate I'm going, I'm never going to be able to at my end.

Maybe I need to start over completely with GitHub.
Doug

Sent: Monday, October 11, 2021 3:33 PM

To: Macaulay2 <maca...@googlegroups.com>
Subject: Re: [EXT] [Macaulay2] Re: developing a package
Remove the extra comma:

Screen Shot 2021-10-11 at 3.32.19 PM.png

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.

Daniel R. Grayson

unread,
Oct 11, 2021, 7:28:10 PM10/11/21
to Macaulay2
Show us the output from M2 now when you try to run it.

Douglas Leonard

unread,
Oct 11, 2021, 7:51:04 PM10/11/21
to maca...@googlegroups.com

I finally (after a lot of GitHub mistakes) got a version to run again when loaded from
~/M2local/M2/M2/Macaulay2/packages:

i1 : loadPackage "FunctionFieldDesingularization";

i2 : negLexMatrix(2)

o2 = | 0  0  -1 |
     | 0  -1 0  |
     | -1 0  0  |
-----------------------------------------------------------------------------------------------------------------
But from

~/M2local/M2/M2/Macaulay2 and elsewhere:


i1 : loadPackage "FunctionFieldDesingularization";
stdio:1:1:(3): error: file not found on path: "FunctionFieldDesingularization.m2"
--------------------------------------------------------------------------------------------------------------------
I would rather have it the other way around so that I don't keep adding files inside the packages subdirectory.

Doug

Sent: Monday, October 11, 2021 6:28 PM

To: Macaulay2 <maca...@googlegroups.com>
Subject: Re: [EXT] [Macaulay2] Re: developing a package
Show us the output from M2 now when you try to run it.

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.

Daniel R. Grayson

unread,
Oct 11, 2021, 8:58:28 PM10/11/21
to Macaulay2
If you'd rather not add your package the package subdirectory of the repository (yet), then just forget about the repository.
Put your file in some directory, and start M2 in the same directory.  The "path" variable contains "." as an entry, which denotes
the current directory, so it will find your file.

If you are in emacs and you find you have started M2 in the wrong directory, the way to fix that is to delete the buffer M2 is running in
and try again.

Another idea is to take a look at the "path" variable.  On my machine (a Mac), it looks like this:

i1 : VerticalList path

o1 = {./                                                             }
     {../Library/Application Support/Macaulay2/code/                 }
     {../Library/Application Support/Macaulay2/local/share/Macaulay2/}
     {/Applications/Macaulay2-1.18/share/Macaulay2/Core/             }
     {/Applications/Macaulay2-1.18/share/Macaulay2/                  }

o1 : VerticalList

Notice the directory ../Library/Application Support/Macaulay2/code/.  

Under Linux it will have a different path, still ending in "code".  If you put your file in there, then M2 can find it no matter where you
start M2.



Reply all
Reply to author
Forward
0 new messages