[Rock-dev] Enable SSE2 typedefs (emmintrin.h)

Jakob Schwendner jakob.schwendner at dfki.de
Thu May 3 09:44:59 CEST 2012


On 05/03/2012 09:37 AM, Matthias Goldhoorn wrote:
> On 03.05.2012 08:50, Jakob Schwendner wrote:
>> On 05/02/2012 07:09 PM, Leif Christensen wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Hi,
>>>
>>> on my 32 bit ubuntu, the compilation of components, that include
>>> libelas/elas.h fails, because the type __m128i is not declared.
>>>
>>> elas.h includes the mmx extension header emmintrin.h, which checks for
>>> the define __SSE2__ and only then declares __m128i and others.
>>>
>>> On my machine (where /proc/cpuinfo has the sse2 flag), __SSE2__ is
>>> only defined if I add -msse2 to my cxx flags.
>>>
>>> I would suggest to use something like FindSSE.cmake (for example from
>>> http://gitorious.org/vc/vc/blobs/master/cmake/FindSSE.cmake) to check
>>> for SSE-extensions and then use SSEx_FOUND in the CMakeList.txt files
>>> of packages that use libelas, e.g.
>>>
>>> IF(SSE2_FOUND)
>>>     ADD_DEFINITIONS(-msse2)
>>> ENDIF(SSE2_FOUND)
>>> [...]
>>>
>>> The only standard CMAKE_MODULE_PATH in rock seems to be
>>> [...]/base/types/cmake, so we could put FindSSE.cmake there. There are
>>> already other .cmake files, even though I don't know what they have to
>>> do with base types.
>>>
>>> Thoughts on that?
>> +1
>>
>> _______________________________________________
>> Rock-dev mailing list
>> Rock-dev at dfki.de
>> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
> Not sure how SSE support is implemented in these packages, if sse2
> support enables additional functions
>
> -1
>
> because it can brak compatibility between the packages and add some
> "magic function enabling" on some machines.
> In this case the user which needs this should manually (e.g. in the
> overrides) take care of this flags.
> But if this flag only enabled optimization (without additional
> extern-accessible-functions)
>
> +1
>
> Matthias
I believe the libelas does not compile without sse2 support. I guess the 
right way would be to give a proper error if sse2 is not found (which 
probably libelas is already doing). The fix in the stereo library is 
required to be able to include the headers of elas properly, which 
already define types which need sse2. Even just adding the 
add_definitions without a check would do (since compilation would 
already fail in elas if no sse2 was present).

cheers,

Jakob






More information about the Rock-dev mailing list