Hi Leif,

> So I don't really understand what your problem is.

Let me try to explain again :)

> If 'configure' determined the machine supports SSE2, __M4RI_HAVE_SSE2
> is set to 1, but even if that's the case, you should still also test
> __SSE2__ when compiling code later (including code *using* the
> library).

Why? I want that whoever links against M4RI lives in the same world as M4RI.

> Does your trouble reduce to *enabling* SSE2 when compiling later, if
> you *know* that the machine [in theory] supports it and you want to
> use it? If so, in which contexts?

1) M4RI figures out whether SSE2 is supported on the machine
2) M4RI decides whether to set __M4RI_HAVE_SSE2=1
3) Third party code links against M4RI and needs to set -msse2 (or
whatever the compiler expects) if and only if __M4RI_HAVE_SSE=1

The only machine I have access to where this is actually an issue is
cicero on skynet.

> :-) I.e., just passing '-msse2' (without any other processor/
> architecture-specific options) to gcc there solves your problem?

Yep.

> Do you use the *same* functions in both cases, and untagged differing
> matrix layout, without any global "flag" indicating that, such that
> this extends to a compatibility problem between code [even when
> compiled on the same machine], some using "SSE2 mode", some not?

Yes, kind of, although the global flag is __M4RI_HAVE_SSE2 which is
available to both M4RI and third party code. But I realised this is a
more general issue and filed a new bug against the M4RI library:

https://bitbucket.org/malb/m4ri/issue/32/

i.e. functions shouldn't rely on __M4RI_HAVE_SSE2 to decide how the
matrices look like but ask the matrices instead. But that bug is
somewhat independent of the problem at hand.

For now, it seems we should simply patch Sage to pass -msse2 to GCC if
and only if __M4RI_HAVE_SSE2=1 when building matrix_mod2_dense.pyx.
For PolyBoRi the current plan is to do the same.

> Is there a specific ticket (other than the M4RIE one) for this issue?
> If not, you can open one and cc me.

Okay, I've CCed you from

http://trac.sagemath.org/sage_trac/ticket/11574

> I'm also on #sagemath btw., or feel free to mail me off-list.

In the spirit of William's "post more" encouragement shouldn't we keep
this on list? :)

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [email protected]

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to