Optional packages in conda

109 views
Skip to first unread message

mmarco

unread,
Jun 26, 2026, 8:28:37 AM (3 days ago) Jun 26
to sage-devel
Now that the recommended way to install sage is through conda (which makes it way easy that compiling from source), I am having the problem with installing optional packages.

Some (like sirocco)  are already in conda-forge, so it is easy to install them, but in particular, I am being unable to install Tides and Kenzo.

Which should be the way to install them? Should we create packages in conda forge for them?

Isuru Fernando

unread,
Jun 26, 2026, 10:42:55 AM (3 days ago) Jun 26
to sage-...@googlegroups.com
Yes, having them in conda-forge is the recommended way.

Isuru

--
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 view this discussion visit https://groups.google.com/d/msgid/sage-devel/b653a3f9-3da4-4d19-b3cb-98b49b75a8e8n%40googlegroups.com.

mmarco

unread,
Jun 26, 2026, 10:57:51 AM (3 days ago) Jun 26
to sage-devel
How is the process to add a package to conda-forge?

mmarco

unread,
Jun 26, 2026, 11:01:40 AM (3 days ago) Jun 26
to sage-devel
Also, it might require changes in sage, to look for the corresponding files in the right place

Isuru Fernando

unread,
Jun 26, 2026, 11:08:47 AM (3 days ago) Jun 26
to sage-...@googlegroups.com
You can also ask your favourite AI model to give you the code for it.

Isuru

Dima Pasechnik

unread,
Jun 26, 2026, 11:41:25 AM (3 days ago) Jun 26
to sage-...@googlegroups.com, Miguel Angel Marco
On Fri, Jun 26, 2026 at 10:01 AM mmarco <miguel....@gmail.com> wrote:
>
> Also, it might require changes in sage, to look for the corresponding files in the right place

if one uses sage the distro, it will also need adding spkg-configure.m4 files.
But that's the only needed change, as these packages are not requiring
any extension modules,
and are loaded anyway, with runtime detection of their availability.
> To view this discussion visit https://groups.google.com/d/msgid/sage-devel/31bcb372-a978-444f-9c92-674057778fc3n%40googlegroups.com.

mmarco

unread,
Jun 26, 2026, 12:17:22 PM (3 days ago) Jun 26
to sage-devel
I meant that, for example, kenzo looks at the variable KENZO_FAS, which I think is not properly set when you install sage in conda-forge.  Tides depends on SAGE_LOCAL, which again, is not set in the conda-forge install. Would adding skpg-configure.m4 be enough to handle this?

Dima Pasechnik

unread,
Jun 26, 2026, 11:53:19 PM (2 days ago) Jun 26
to sage-...@googlegroups.com
On Fri, Jun 26, 2026 at 11:17 AM mmarco <miguel....@gmail.com> wrote:
>
> I meant that, for example, kenzo looks at the variable KENZO_FAS, which I think is not properly set when you install sage in conda-forge. Tides depends on SAGE_LOCAL, which again, is not set in the conda-forge install. Would adding skpg-configure.m4 be enough to handle this?

That's sort of a typical sage-distro insanity - doing settings for
Kenzo in the config of ecl
(sorry, Michael O. :-))
build/pkgs/ecl/spkg-configure.m4: AC_SUBST(SAGE_KENZO_FAS,
['${prefix}'/lib/ecl/kenzo.fas])

By right in should be in `build/pkgs/kenzo/spkg-configure.m4`

A quick hack is to get rid of all that KENZO_FAS spaghetti:
--- a/src/sage/features/kenzo.py
+++ b/src/sage/features/kenzo.py
@@ -62,11 +62,7 @@ class Kenzo(Feature):
ecl_eval("(setf *standard-output* *dev-null*)")

try:
- from sage.env import KENZO_FAS
- if KENZO_FAS:
- ecl_eval("(require :kenzo \"{}\")".format(KENZO_FAS))
- else:
- ecl_eval("(require :kenzo)")
+ ecl_eval("(require :kenzo)")

except RuntimeError:
return FeatureTestResult(self, False, reason="Unable to
make ECL require kenzo")
diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py
index 8a90f0c424b..e1b3afde5d6 100644
--- a/src/sage/interfaces/kenzo.py
+++ b/src/sage/interfaces/kenzo.py
@@ -104,11 +104,7 @@ kenzo_names = ['add',
# example __sphere__ is defined as EclObject("sphere"). Hyphens
# are replaced with underscores to get valid Python identifiers.
if Kenzo().is_present():
- from sage.env import KENZO_FAS
- if KENZO_FAS:
- ecl_eval("(require :kenzo \"{}\")".format(KENZO_FAS))
- else:
- ecl_eval("(require :kenzo)")
+ ecl_eval("(require :kenzo)")

ecl_eval("(in-package :cat)")
ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)")

and symlink kenzo.fas to where ecl finds its .fas files, namely, to
what's being output by

./sage --ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"

That is,

ln -s `pwd`/local/lib/ecl/kenzo.fas $(./sage --ecl -eval "(princ
(SI:GET-LIBRARY-PATHNAME))" -eval "(quit)")


------------------

As a matter of fact, ecl can be configured to search for .fas files in
particular directories.
This something we discussed (and discussed, and discussed... :-)) with upstream
on https://gitlab.com/embeddable-common-lisp/ecl/-/work_items/846
I just submitted a fix along these lines to Homebrew.
https://github.com/Homebrew/homebrew-core/pull/290044
Once it's in, Homebrew tap "dimpase/tap/maxima-ecl" will work together with ecl,
(so that "(require :maxima)" works out of the box)

I'll write a Kenzo Homebrew formula, it's shouldn't be hard, modelling
after dimpase/tap/maxima-ecl
(i.e. https://github.com/dimpase/homebrew-tap/blob/main/Formula/m/maxima-ecl.rb)


HTH
Dima


Dima
> To view this discussion visit https://groups.google.com/d/msgid/sage-devel/35f5f564-f36e-4f59-84c7-c4b7570ab17an%40googlegroups.com.

mmarco

unread,
Jun 28, 2026, 1:41:20 PM (16 hours ago) Jun 28
to sage-devel
The KENZO_FAS code is in fact broken:

```
sage: from sage.env import KENZO_FAS
sage: KENZO_FAS
"'/home/mmarco/sage/local/var/lib/sage/venv-python3.14'/lib/ecl/kenzo.fas"
```

Trying to load it in ecl fails because of the inserted '

```
sage: from sage.libs.ecl import ecl_eval
sage: ecl_eval("(require :kenzo \"{}\")".format(KENZO_FAS))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[4], line 1
----> 1 ecl_eval("(require :kenzo \"{}\")".format(KENZO_FAS))

File sage/libs/ecl.pyx:1334, in sage.libs.ecl.ecl_eval()
-> 1334 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:1361, in sage.libs.ecl.ecl_eval()
-> 1361 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:1357, in sage.libs.ecl.ecl_eval()
-> 1357 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:324, in sage.libs.ecl.ecl_safe_eval()
--> 324 'Could not get source, probably due dynamically evaluated source code.'

RuntimeError: ECL says: Cannot open #P"/home/mmarco/sage/'/home/mmarco/sage/local/var/lib/sage/venv-python3.14'/lib/ecl/kenzo.fas".
C library error: No such file or directory
while evaluating (require :kenzo "'/home/mmarco/sage/local/var/lib/sage/venv-python3.14'/lib/ecl/kenzo.fas")

```

But loading directly kenzo fails too:

```

sage: ecl_eval("(require :kenzo)")
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[5], line 1
----> 1 ecl_eval("(require :kenzo)")

File sage/libs/ecl.pyx:1334, in sage.libs.ecl.ecl_eval()
-> 1334 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:1361, in sage.libs.ecl.ecl_eval()
-> 1361 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:1357, in sage.libs.ecl.ecl_eval()
-> 1357 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:324, in sage.libs.ecl.ecl_safe_eval()
--> 324 'Could not get source, probably due dynamically evaluated source code.'

RuntimeError: ECL says: Module error: Don't know how to REQUIRE KENZO.
while evaluating (require :kenzo)
```

But it is even worse: the directory that is supposed to look at dosn't even exist:

````
sage: ecl_eval("(require :kenzo \"{}\")".format(KENZO_FAS.replace("'","")))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[6], line 1
----> 1 ecl_eval("(require :kenzo \"{}\")".format(KENZO_FAS.replace("'","")))

File sage/libs/ecl.pyx:1334, in sage.libs.ecl.ecl_eval()
-> 1334 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:1361, in sage.libs.ecl.ecl_eval()
-> 1361 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:1357, in sage.libs.ecl.ecl_eval()
-> 1357 'Could not get source, probably due dynamically evaluated source code.'

File sage/libs/ecl.pyx:324, in sage.libs.ecl.ecl_safe_eval()
--> 324 'Could not get source, probably due dynamically evaluated source code.'

RuntimeError: ECL says: Cannot open #P"/home/mmarco/sage/local/var/lib/sage/venv-python3.14/lib/ecl/kenzo.fas".
C library error: No such file or directory
while evaluating (require :kenzo "/home/mmarco/sage/local/var/lib/sage/venv-python3.14/lib/ecl/kenzo.fas")```
```

The right one is just `local/lib/ecl` (not geting in the venv).

```
sage: ecl_eval('(require :kenzo "/home/mmarco/sage/local/lib/ecl/kenzo.fas")')
;;; Loading #P"/home/mmarco/sage/local/lib/ecl/kenzo.fas"
<ECL: ("finite-spaces-point-reductions" "finite-spaces-facets" "finite-spaces-hregularization" "finite-spaces-homology-dvf" "finite-spaces-homology" "finite-spaces-changes" "finite-spaces-subdivisions" "finite-
spaces-class" "pushout" "suspension2" ...)>

```

Dima Pasechnik

unread,
12:29 AM (6 hours ago) 12:29 AM
to sage-...@googlegroups.com

> C library error: No such file or directory
> while evaluating (require :kenzo "'/home/mmarco/sage/local/var/lib/sage/venv-python3.14'/lib/ecl/kenzo.fas")

it's a malformed path, a spurious pair of "'"'s



Nils Bruin

unread,
12:34 AM (6 hours ago) 12:34 AM
to sage-devel
Perhaps due to


or


There are extra ' ' there that can probably be removed (I'm not an expert in m4 or meson though, so someone more informed should check)

Dima Pasechnik

unread,
3:01 AM (3 hours ago) 3:01 AM
to sage-...@googlegroups.com
On Sun, Jun 28, 2026 at 11:34 PM Nils Bruin <nbr...@sfu.ca> wrote:
>
> Perhaps due to
>
> https://github.com/sagemath/sage/blob/81bbb448a101400d3ac58ffe536dbbb2cac3f950/src/sage/meson.build#L21
>
> or
>
> https://github.com/sagemath/sage/blob/81bbb448a101400d3ac58ffe536dbbb2cac3f950/build/pkgs/ecl/spkg-configure.m4#L40
>
> There are extra ' ' there that can probably be removed (I'm not an expert in m4 or meson though, so someone more informed should check)

try

--- a/src/sage/meson.build
+++ b/src/sage/meson.build
@@ -18,7 +18,7 @@ if not fs.exists(datadir / 'cremona')
)
endif
# Kenzo cannot yet be provided by the system, so we always use the
SAGE_LOCAL path for now.
-conf_data.set('SAGE_KENZO_FAS', '\'${prefix}\'/lib/ecl/kenzo.fas')
+conf_data.set('SAGE_KENZO_FAS', '${prefix}/lib/ecl/kenzo.fas')
# It can be found, so we don't have to set anything here:
conf_data.set('NTL_INCDIR', '')
conf_data.set('NTL_LIBDIR', '')


I don't think SAGE_KENZO_FAS settings in
build/pkgs/ecl/spkg-configure.m4 actually have any effect.

Dima
> To view this discussion visit https://groups.google.com/d/msgid/sage-devel/f38aef32-c98b-41d9-8c97-5b8b47118a9an%40googlegroups.com.

mmarco

unread,
5:27 AM (1 hour ago) 5:27 AM
to sage-devel
${prefix} will be the directory inside the venv, right? That is not where the kenzo.fas file is copied when installing the kenzo package
Reply all
Reply to author
Forward
0 new messages