Hi there,

the upgrade of M4RI to the most recent upstream version 

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

exposed the following bug: M4RI uses SSE2 instructions (XORs btw.) and hence 
tests whether the machine it is built on supports these. If this is the case 
it defines __M4RI_HAVE_SSE2 as 1 otherwise as 0. It also passes -msse2 to the 
compiler. So far so good.

Now, Sage links against M4RI. It also includes some header files such as 
m4ri.h. Those in turn import the appropriate SSE2 include file if 
__M4RI_HAVE_SSE2. This is fine because we already checked that SSE2 is 
available on the machine.

However, Sage's build scripts will not pass -msse2 to the compiler since they 
don't know about such things. On some machines this means that the build of 
Sage fails as including a SSE2 header file without passing -msse2 bombs out.

/usr/lib/gcc/i686-pc-linux-gnu/4.4.3/include/emmintrin.h:32:3: error: #error 
"SSE2 instruction set not enabled"

It seems the cleanest way to deal with this is to write a pkg-config file for 
M4RI which specifies what includes and flags are needed to link against the 
library.

cf.
    
http://www.openismus.com/documents/linux/building_libraries/building_libraries

Hence my question: is it save to assume pkg-config is available on the system 
we build Sage on? As far as I can tell it's part of the freedesktops standard 
and not something more fundamental as POSIX.

If not, I guess we'll have to patch PolyBoRi and Sage to search m4ri_config.h 
for __M4RI_HAVE_SSE = 1 and to include -msse2 manually in case it is found. 
Not a big deal, just not as pretty as doing the standard (TM) thing.

Thoughts?
Martin


--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_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