How to declare dependencies of new-style packages?

78 views
Skip to first unread message

Simon King

unread,
Oct 4, 2015, 1:27:48 PM10/4/15
to sage-devel
Hi!

Meanwhile I try to change my group cohomology spkg into a new style package. But I wonder how dependencies are checked these days.

I see, for example, the file build/pkgs/cvxopt/dependencies:
$(INST)/$(NUMPY) $(INST)/$(ATLAS) $(INST)/$(CEPHES) $(INST)/$(GSL) $(INST)/$(GLPK) | $(INST)/$(MATPLOTLIB)

In the developer manual I couldn't find a syntax definition for the "dependencies" file. Suppose I want that a package depends on meataxe (which awaits review as a new optional package at #12103) and database_gap, do I need to put
$(INST)/$(MEATAXE) $(INST)/$(DATABASE_GAP)
or what?

Best regards,
Simon

Volker Braun

unread,
Oct 4, 2015, 2:54:25 PM10/4/15
to sage-devel
Its makefile syntax since its really just a script that glues everything together into one makefile. The ones after the pipe are order only dependencies.

Simon King

unread,
Oct 4, 2015, 3:21:58 PM10/4/15
to sage-devel
Hi Volker,


Am Sonntag, 4. Oktober 2015 20:54:25 UTC+2 schrieb Volker Braun:
Its makefile syntax since its really just a script that glues everything together into one makefile. The ones after the pipe are order only dependencies.


 I don't see the developer manual mentioning the meaning of $(INST); I can only guess that it is a command that installs another package unless it is installed already. But what package? Do you confirm my guess that $(INST)/$(FOO) does "sage -i foo" unless foo is already installed?

What is an "order only dependency"?

Cheers,
Simon

Simon King

unread,
Oct 4, 2015, 3:23:02 PM10/4/15
to sage-devel
And PS:

Will the user be asked for confirmation if the dependency's license is not GPL compatible (as is the case for database_gap)?

Simon King

unread,
Oct 4, 2015, 3:55:35 PM10/4/15
to sage-devel
Am Sonntag, 4. Oktober 2015 21:21:58 UTC+2 schrieb Simon King:

 I don't see the developer manual mentioning the meaning of $(INST); I can only guess that it is a command that installs another package unless it is installed already. But what package? Do you confirm my guess that $(INST)/$(FOO) does "sage -i foo" unless foo is already installed?

Apparently  not. If I misspell the name of the dependency of my package on purpose, then the package still installs, rather then trying (and failing) to install the dependency.

So, really the meaning of what's written in the build/pkgs/.../dependencies remains totally obscure to me.

Jeroen Demeyer

unread,
Oct 4, 2015, 4:19:34 PM10/4/15
to sage-...@googlegroups.com
On 2015-10-04 21:55, Simon King wrote:
> If I misspell the name of the dependency of my package
> on purpose, then the package still installs
Well, don't misspell :-)

Jeroen Demeyer

unread,
Oct 4, 2015, 4:20:03 PM10/4/15
to sage-...@googlegroups.com
On 2015-10-04 19:27, Simon King wrote:
> In the developer manual I couldn't find a syntax definition for the
> "dependencies" file.
Did you look in the *most recent* version of the developer's manual? I
mean not the one which is online but the one in your local develop branch.

> Suppose I want that a package depends on meataxe
> (which awaits review as a new optional package at #12103) and
> database_gap, do I need to put
> $(INST)/$(MEATAXE) $(INST)/$(DATABASE_GAP)
> or what?
Looks right to me.

Simon King

unread,
Oct 4, 2015, 4:31:19 PM10/4/15
to sage-devel
Hi Jeroen,


Am Sonntag, 4. Oktober 2015 22:20:03 UTC+2 schrieb Jeroen Demeyer:
On 2015-10-04 19:27, Simon King wrote:
> In the developer manual I couldn't find a syntax definition for the
> "dependencies" file.
Did you look in the *most recent* version of the developer's manual? I
mean not the one which is online but the one in your local develop branch.

I read it online. But I am building the latest beta right now.
 
> Suppose I want that a package depends on meataxe
> (which awaits review as a new optional package at #12103) and
> database_gap, do I need to put
> $(INST)/$(MEATAXE) $(INST)/$(DATABASE_GAP)
> or what?
Looks right to me.

OK. But what should happen, if I replace it with $(INST)/$(MEATAE) ? Shouldn't it fail with an error? Well, it didn't (which was a bug, IMHO), at least on a branch that was not very old. Hopefully the latest develop works better.

By the way: Shouldn't there be a way to declare that ALL tests in a file are optional? I am not happy at all with the prospect of adding "optional: modular_resolution" after several hundreds of lines of tests.

Cheers,
Simon

Julien Puydt

unread,
Oct 4, 2015, 4:34:38 PM10/4/15
to sage-...@googlegroups.com
Le dimanche 04 oct. 2015 à 13:31:19 (-0700), Simon King a écrit :
>
> OK. But what should happen, if I replace it with $(INST)/$(MEATAE) ?
> Shouldn't it fail with an error? Well, it didn't (which was a bug, IMHO),
> at least on a branch that was not very old. Hopefully the latest develop
> works better.
>

If MEATAE isn't defined, you add a depend on $(INST)/, which does exist, so
it's an always-satisfied dep and not an error, isn't it?

Snark on #sagemath

Jeroen Demeyer

unread,
Oct 4, 2015, 4:41:22 PM10/4/15
to sage-...@googlegroups.com
On 2015-10-04 22:31, Simon King wrote:
> OK. But what should happen, if I replace it with $(INST)/$(MEATAE) ?
> Shouldn't it fail with an error? Well, it didn't (which was a bug,
> IMHO)
OK, I agree that this is annoying and I am aware of that. But let's live
with it for a moment. There have been a lot of changes in the build
system in the 6.9 release and fixing this wasn't a priority. In any
case, let's wait until things have settled down.

Jeroen.

Simon King

unread,
Oct 4, 2015, 5:00:04 PM10/4/15
to sage-devel
Hi!


Am Sonntag, 4. Oktober 2015 22:34:38 UTC+2 schrieb Snark:
If MEATAE isn't defined, you add a depend on $(INST)/, which does exist, so
it's an always-satisfied dep and not an error, isn't it?

I am confused. Do you say that FOO is defined regardless whether the optional package foo is installed or not? Where does it come from? Perhaps from running ./configure in SAGE_ROOT, which checks the content of build/pkgs/?

And why is there such an indirection? If the dependency is called foo, shouldn't it be possible to name it foo rather than FOO?

And why does it need to be *manually* decorated with $(INST)/? Shouldn't it be enough to give a list of unmodified package names, optionally modified by prescribing a range of acceptable version numbers?

Thus, why "$(INST)/MEATAXE $(INST)/DATABASE_GAP" rather than "meataxe database_gap"?

By the way, concerning docs: Building the docs has never been a very pleasant experience for me, but it became a nightmare recently. It takes more ages on my laptop, because of swapping. And that used not to happen in the not so distant past.

Cheers,
Simon
 

Simon King

unread,
Oct 4, 2015, 5:00:39 PM10/4/15
to sage-devel
Hi!

Am Sonntag, 4. Oktober 2015 22:34:38 UTC+2 schrieb Snark:
If MEATAE isn't defined, you add a depend on $(INST)/, which does exist, so
it's an always-satisfied dep and not an error, isn't it?

John Cremona

unread,
Oct 4, 2015, 5:26:32 PM10/4/15
to SAGE devel
On 4 October 2015 at 17:00, Simon King <simon...@uni-jena.de> wrote:
> Hi!
>
> Am Sonntag, 4. Oktober 2015 22:34:38 UTC+2 schrieb Snark:
>>
>> If MEATAE isn't defined, you add a depend on $(INST)/, which does exist,
>> so
>> it's an always-satisfied dep and not an error, isn't it?
>
>
> I am confused. Do you say that FOO is defined regardless whether the
> optional package foo is installed or not? Where does it come from? Perhaps

In makefiles, as in the shell, any undefined variable evaluates to the
null string.

A more robust version (perhaps what Jeroen was alluding to as a job
for later) would be to test all such variables and file somehow if any
are null.

> from running ./configure in SAGE_ROOT, which checks the content of
> build/pkgs/?
>
> And why is there such an indirection? If the dependency is called foo,
> shouldn't it be possible to name it foo rather than FOO?
>
> And why does it need to be *manually* decorated with $(INST)/? Shouldn't it
> be enough to give a list of unmodified package names, optionally modified by
> prescribing a range of acceptable version numbers?
>
> Thus, why "$(INST)/MEATAXE $(INST)/DATABASE_GAP" rather than "meataxe
> database_gap"?

The upper case variables are set in the Makefile (build/make/Makefile)
to include the full package name including the version number.

I expect that this somehow happens during the ./configure stage (which
creates that Makefile) but I have never looked into build/make before
now!

John

>
> By the way, concerning docs: Building the docs has never been a very
> pleasant experience for me, but it became a nightmare recently. It takes
> more ages on my laptop, because of swapping. And that used not to happen in
> the not so distant past.
>
> Cheers,
> Simon
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

Jeroen Demeyer

unread,
Mar 1, 2016, 5:46:22 AM3/1/16
to sage-...@googlegroups.com
On 2015-10-04 23:00, Simon King wrote:
> And why does it need to be *manually* decorated with $(INST)/? Shouldn't
> it be enough to give a list of unmodified package names, optionally
> modified by prescribing a range of acceptable version numbers?
>
> Thus, why "$(INST)/MEATAXE $(INST)/DATABASE_GAP" rather than "meataxe
> database_gap"?

Fixed in http://trac.sagemath.org/ticket/20140 (needs review...)
Reply all
Reply to author
Forward
0 new messages