petsc, py-petsc4py: add v3.18.4, v3.18.5#36406
Conversation
|
|
||
| depends_on("py-cython", type="build", when="@main") | ||
| depends_on("py-cython@0.29.32:", when="^python@3.11: @3.19:", type="build") | ||
| depends_on("py-cython@0.24:", when="@3.19:", type="build") |
There was a problem hiding this comment.
As is, this says that only main depends on cython.
There was a problem hiding this comment.
Yes.
So I can add this change now - or later with the 3.19 release. [as it won't affect current 3.18 releases..]
There was a problem hiding this comment.
What I'm saying is that the 3.18 release already contains this constraint in setup.py, but we need to add it to the Spack package too.
There was a problem hiding this comment.
3.18 tarballs are prebuilt with cython - so there is no dependency on cython here [when spack builds petsc4py].
As noted - it was only required for @main
With petsc-3.19 - we are not including the prebuilt cython sources in the tarball - hence need this dependency for 3.19 and newer
So I would think that part of setup.py will be skipped in a spack build with petsc4py-3.18 tarballs
cc: @dalcinl to confirm.
Ref: (v3.18) setup.py:
# python-3.11+ requires cython 0.29.32+
if pyver >= (3, 11):
CYTHON = '0.29.32'
else:
CYTHON = '0.24'
There was a problem hiding this comment.
We should probably rebuild cython sources even in older versions. This will be done automatically by adding a dependency on cython thanks to #35995. This maximizes the chances that the package will build for all versions of Python.
There was a problem hiding this comment.
Why don't you just use the latest Cython release 0.29.33 ?
There was a problem hiding this comment.
This is a lower bound, so if a newer version is available it will use that. We want to keep the range of supported versions as wide as possible in case a different package in the DAG has different constraints.
There was a problem hiding this comment.
@dalcinl thanks!
the suggested change is pushed
There was a problem hiding this comment.
But I don't see cython source generated - even though CYTHON_FORCE_REGEN=1 is set
spack-build-out.txt
spack-build-env.txt
With cython - I would see:
running build_src
using Cython 0.29.32
cythonizing 'petsc4py/PETSc.pyx' -> 'petsc4py/PETSc.c'
running build_py
creating build
Here I'm seeing:
running build
running build_src
running build_py
creating build
6ded227 to
374df89
Compare
tldahlgren
left a comment
There was a problem hiding this comment.
Confirmed the four version sha256.
770bc6b to
2bb7f7b
Compare
|
Sorry, guys... Are you aware that regenerating Cython sources in old petsc4py releases will require "manual" step? See how it is done for mpi4py in conda-forge. Running that exact same line on petsc4py sources is the way to go. PS: Sorry if you are aware of this, but looking at Spack's |
I'll defer the spack impl code for this to @adamjstewart Perhaps this cython issue should be decoupled from this PR [and #36401 ] - this build change be applied to mpi4py,petsc4py,slepc4y in a separate PR |
|
I'm fine with applying this in a separate PR. The code would look like: python(join_path("conf", "cythonize.py")) |
Does it go into What is the current default build command that it invokes? presumably I would have to replicate it in build()? |
|
Ah - ok - I see it should be install(). Perhaps? I now get: Presumably its working? |
2bb7f7b to
746aca5
Compare
|
pushed this change |
| else: | ||
| return self.stage.source_path | ||
|
|
||
| def install(self, spec, prefix): |
There was a problem hiding this comment.
I would probably do this as:
@run_before("install")
def cythonize(self):
python(join_path("conf", "cythonize.py"))746aca5 to
9c9bddd
Compare
* py-petsc4py: update ldshared-dev.patch [to work with current @main] * petsc4py: always force rebuild cython sources
No description provided.