Or maybe once the modularization has processed (https://trac.sagemath.org/ticket/29705) this really boils down to a tiny ticket?
--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/6u1VuXJE7wE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/27836ec2-c5ce-412d-95e5-73363be65c71n%40googlegroups.com.
Why make it part of cysignals? The purpose of the memory allocator
is quite distinct from cysignals. Merging them look artificial to me.
I agree that this would be nice. However, I don't know how to achieve this. One thing that one could try, is to add python functions to cysignals that typecast the addresses of sig_block/sig_unblock to a python int. It's definitely not clean, but it might work. E.g. you can check for the presence of cysignals in __init__.pxd with try … except this way.
>
> I thought cysignals would be Windows compatible after
>
> https://github.com/sagemath/cysignals/pull/104
>
> Though the project seems to be abandoned. What a shame.
I've seen it, but I haven't taken the time to understand this. I agree that it would be best to have cysignals installable on windows without cygwin.
However, if you want the memory allocator and don't have cysignals installed already, you probably don't have a use case for it.
> You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/6u1VuXJE7wE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/2d7f6a4e-59cf-5c25-4cc3-ae55280d09e6%40gmail.com.
I think it is desirable to have the possibility to enable or disable
cysignals manually. In other words
enable + "no cysignals present" -> error
enable + "cysignals present" -> compilation with sigs
disable + "whatever" -> compilation without sigs
On Mar 29, 2021 5:26 PM, Matthias Koeppe <matthia...@gmail.com> wrote:
>
> On Monday, March 29, 2021 at 6:25:28 AM UTC-7 vdelecroix wrote:
>>
>> I think it is desirable to have the possibility to enable or disable
>> cysignals manually. In other words
>> enable + "no cysignals present" -> error
>> enable + "cysignals present" -> compilation with sigs
>> disable + "whatever" -> compilation without sigs
I misunderstood this.
>
>
> This suggestion is not compatible with modern Python packaging (PEP-517/518). There is no such thing as an "optional build dependency".
>
Is it acceptable to build different versions depending on whether a package is found?
In the end the sig_block/sig_unblock is a bit of overkill anyway for MemoryAllocator. I wouldn't consider it clean to allocate memory with it inside of sig_on / sig_off.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/6u1VuXJE7wE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/c8cff2c8-6c9c-46e7-a9e8-9d5cf390aac8n%40googlegroups.com.
On Mar 29, 2021 5:26 PM, Matthias Koeppe <matthia...@gmail.com> wrote:
> This suggestion is not compatible with modern Python packaging (PEP-517/518). There is no such thing as an "optional build dependency".
Is it acceptable to build different versions depending on whether a package is found?
Thank you for providing the reference.
I think in case of a pxd files things are a bit different. If someone uses cysignals and memory_allocator in the same place, e.g.
cdef MemoryAllocator mem = MemoryAllocator()
sig_on()
foo = mem.malloc(1000)
sig_off()
this would have to recompile the corresponding pxd file. So one
could check in that pxd file, whether cysignals is present or not.
So I think this could be set up, such that any project cimporting
from memory_allocator that requires cysignals has memory_allocator
with cysignals support. As noted above, I would vote for dropping
the sig_block / sig_unblock in MemoryAllocator alltogether.
--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/6u1VuXJE7wE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/c3abeea5-8413-479b-8303-74c5cbf0159cn%40googlegroups.com.
I think in case of a pxd files things are a bit different. If someone uses cysignals and memory_allocator in the same place, e.g.cdef MemoryAllocator mem = MemoryAllocator()
sig_on()
foo = mem.malloc(1000)
sig_off()this would have to recompile the corresponding pxd file. So one could check in that pxd file, whether cysignals is present or not. So I think this could be set up, such that any project cimporting from memory_allocator that requires cysignals has memory_allocator with cysignals support.
I didn't figure this out until after you showed me the reference.
conditionalization based on cython_compile_time_env might be hard though. There is no such thing as
try:
from cysignals.signals cimport sig_on, sig_off
except:
from .signals_backup cimport sig_on, sig_off
One thing that one may try is basically the following:
cdef void (*sig_block_pt)()
cdef void (*sig_unblock_pt)()
if has_cysignals:
# replace sig_block, sig_unblock properly
else:
# replace by pass-functions
However, this probably needs an update of cysignals, as we need a way to access the addresses of sig_block/sig_unblock on runtime (which is the cython_compile_time_env).
The question remains, is it worth it? Do we need/want
sig_block/sig_unblock for MemoryAllocator?
--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/6u1VuXJE7wE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f619d534-43b8-4fc9-aaaf-91d2db52a4b6n%40googlegroups.com.
Are there objections of adding this new standard package, which consists of the code from `ext/memory_allocator.*`?This is now https://trac.sagemath.org/ticket/31591.I would like to put it on `github.com/sagemath` but need either help or permissions to do so.
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 on the web visit https://groups.google.com/d/msgid/sage-devel/eca09c24-6d63-494f-8f4f-0529d5db7974n%40googlegroups.com.