meson build doesn't find cysignals?

67 views
Skip to first unread message

Gareth Ma

unread,
Jan 1, 2025, 5:08:04 AMJan 1
to 'Martin R' via sage-devel
I am trying to use the `meson` build method instead of conda-forge for
dependencies. I installed the build dependencies following
[prerequisites](https://doc.sagemath.org/html/en/installation/source.html#section-prereqs),
then run these commands

```sh
conda remove -n sage-dev --all # remove the entire conda environment

./bootstrap # docs tell me to run ./bootstrap-conda but it's removed in #37447
mamba env create --file environment-3.11-linux.yml --name sage-dev # same as above
conda activate sage-dev

pip install --no-build-isolation --editable . -v 2>&1 | tee build.log
```

https://gist.github.com/grhkm21/26584abf9ae7faa83c376535ad8dc10d

All of the errors seem to be related to cysignals missing somehow, even though
it's clearly installed in my Conda environment:

Also I have the required `cysignals/signals.pxd` somewhere on my system...
```sh
$ fd signals.pxd /
/home/grhkm/miniforge3/envs/sage-dev/lib/python3.11/site-packages/memory_allocator/signals.pxd
/home/grhkm/miniforge3/envs/sage-dev/lib/python3.11/site-packages/cysignals/signals.pxd
/home/grhkm/miniforge3/envs/sage-dev/lib/python3.11/site-packages/cysignals/pysignals.pxd
/home/grhkm/miniforge3/pkgs/memory-allocator-0.1.3-py311h9ecbd09_1/lib/python3.11/site-packages/memory_allocator/signals.pxd
/home/grhkm/miniforge3/pkgs/memory-allocator-0.1.3-py311h459d7ec_0/lib/python3.11/site-packages/memory_allocator/signals.pxd
/home/grhkm/miniforge3/pkgs/cysignals-1.11.2-py311h82528dc_3/lib/python3.11/site-packages/cysignals/signals.pxd
/home/grhkm/miniforge3/pkgs/cysignals-1.11.2-py311h82528dc_3/lib/python3.11/site-packages/cysignals/pysignals.pxd
```

I am on Linux Fedora.

Tobia...@gmx.de

unread,
Jan 1, 2025, 6:29:11 AMJan 1
to sage-devel
Can you please also post the output of /home/grhkm/git/sage/build/cp311/meson-logs

Does `import cysignals.signals` from python in the activated conda env work?

Gareth Ma

unread,
Jan 1, 2025, 8:33:12 AMJan 1
to 'Tobia...@gmx.de' via sage-devel
Content of /home/grhkm/git/sage/build/cp311/meson-logs/meson-log.txt:

https://gist.github.com/grhkm21/21dea0c9b2f3b712f91f926757863045

(The conda environment is now called `sage-dev-2`)

Yes, importing `cysignals.signals` works in the conda python. I guess because
it's installed in `$CONDA_PREFIX/lib/python3.11/site-packages`.

On 1/1/25 7:29 PM, 'Tobia...@gmx.de' via sage-devel wrote:
> Can you please also post the output of /home/grhkm/git/sage/build/cp311/meson-logs
>
> Does `import cysignals.signals` from python in the activated conda env work?
>
> On Wednesday, January 1, 2025 at 6:08:04 PM UTC+8 grh...@gmail.com wrote:
>
> I am trying to use the `meson` build method instead of conda-forge for
> dependencies. I installed the build dependencies following
> [prerequisites](https://doc.sagemath.org/html/en/installation/
> source.html#section-prereqs <https://doc.sagemath.org/html/en/installation/
> source.html#section-prereqs>),
> then run these commands
>
> ```sh
> conda remove -n sage-dev --all # remove the entire conda environment
>
> ./bootstrap # docs tell me to run ./bootstrap-conda but it's removed in #37447
> mamba env create --file environment-3.11-linux.yml --name sage-dev # same as
> above
> conda activate sage-dev
>
> pip install --no-build-isolation --editable . -v 2>&1 | tee build.log
> ```
>
> https://gist.github.com/grhkm21/26584abf9ae7faa83c376535ad8dc10d <https://
> gist.github.com/grhkm21/26584abf9ae7faa83c376535ad8dc10d>
>
> All of the errors seem to be related to cysignals missing somehow, even though
> it's clearly installed in my Conda environment:
>
> Also I have the required `cysignals/signals.pxd` somewhere on my system...
> ```sh
> $ fd signals.pxd /
> /home/grhkm/miniforge3/envs/sage-dev/lib/python3.11/site-packages/
> memory_allocator/signals.pxd
> /home/grhkm/miniforge3/envs/sage-dev/lib/python3.11/site-packages/cysignals/
> signals.pxd
> /home/grhkm/miniforge3/envs/sage-dev/lib/python3.11/site-packages/cysignals/
> pysignals.pxd
> /home/grhkm/miniforge3/pkgs/memory-allocator-0.1.3-py311h9ecbd09_1/lib/
> python3.11/site-packages/memory_allocator/signals.pxd
> /home/grhkm/miniforge3/pkgs/memory-allocator-0.1.3-py311h459d7ec_0/lib/
> python3.11/site-packages/memory_allocator/signals.pxd
> /home/grhkm/miniforge3/pkgs/cysignals-1.11.2-py311h82528dc_3/lib/python3.11/
> site-packages/cysignals/signals.pxd
> /home/grhkm/miniforge3/pkgs/cysignals-1.11.2-py311h82528dc_3/lib/python3.11/
> site-packages/cysignals/pysignals.pxd
> ```
>
> I am on Linux Fedora.
>
> --
> 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 <mailto:sage-
> devel+un...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/sage-
> devel/340879d6-7f86-47b7-81f4-4eafed4e3b7an%40googlegroups.com <https://
> groups.google.com/d/msgid/sage-
> devel/340879d6-7f86-47b7-81f4-4eafed4e3b7an%40googlegroups.com?
> utm_medium=email&utm_source=footer>.

Tobia...@gmx.de

unread,
Jan 5, 2025, 3:36:59 AMJan 5
to sage-devel
This is really strange. It actually reports that cysignals is found:


Running command: /home/grhkm/miniforge3/envs/sage-dev-2/bin/python3.11 -c 'import cysignals

print(cysignals.__file__.replace('"'"'__init__.py'"'"', '"'"''"'"'))'

--- stdout ---

/home/grhkm/miniforge3/envs/sage-dev-2/lib/python3.11/site-packages/cysignals/

--- stderr ---

Can you please verify that this folder does contain a "memory.pxd" file. 

Another possible solution: try to change the python code around line 25 in src/meson.build to find cysignals to the following (which should give you /home/grhkm/miniforge3/envs/sage-dev-2/lib/python3.11/site-packages in the log file)

import cysignals
import os
print(os.path.dirname(os.path.dirname(cysignals.__file__)))
Reply all
Reply to author
Forward
0 new messages