0

I have problems cross compiling some c++ sources that contain sse instruction. I manage to compile them for simulator (with no extra c++ flag), but for armv7 i get the following error:

#error "SSE instruction set not enabled"
( and following other errors such as:
... unknown type name '__m128'
)

I have looked into clang flags for a flag to activate sse instructions, but did not find

( the source file that i'm trying to compile is gdalgrid.cpp in project gdal, http://fossies.org/dox/gdal-1.10.1/gdalgrid_8cpp_source.html )

thx in advance

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227
atrebbi
  • 553
  • 3
  • 20
  • 2
    'Streaming SIMD Extensions (SSE) is an SIMD instruction set extension to the x86 architecture'. Note 'x86', not 'ARM7' – Martin James Nov 02 '13 at 10:11
  • 1
    Maybe this ifdef '#ifdef HAVE_SSE_AT_COMPILE_TIME'? – Martin James Nov 02 '13 at 10:15
  • ARM does have SIMD instructions, called the "Neon" instructions, but they are not SSE instructions, and I'm pretty sure the builtin functions for those instructions are different (although I have never actually tried to use them). – Mats Petersson Nov 02 '13 at 10:20
  • @MatsPetersson - IIRC, ARM7 does not have Neon? – Martin James Nov 02 '13 at 10:32
  • The ARM7 model of processor doesn't (as it is ARM V3 architecture). ARM V7 architecture allows it as an optional component. ARM V7 is what you'd find in the iPhones and other modern phones. Unfortunately, ARM7 is sometimes used to mean ARM V3 model chips, and sometimes ARM V7 architecture, depending on context. – Mats Petersson Nov 02 '13 at 10:48

1 Answers1

0

Similar problem; trying to compile 'make' an altcoin wallet application on ARM7 hardware, the gcc compiler bombs out with

/usr/share/gccxml-0.9/GCC/4.7/xmmintrin.h:32:3: error: #error "SSE instruction 
set not enabled"
src/scrypt_mine.cpp: In function ‘void* scrypt_buffer_alloc()’:
src/scrypt_mine.cpp:66:19: error: ‘SCRYPT_BUFFER_SIZE’ was not declared in this scope
src/scrypt_mine.cpp: In function ‘void scrypt(const void*, size_t, uint32_t*, void*)’:
src/scrypt_mine.cpp:87:21: error: ‘scrypt_core’ was not declared in this scope
Makefile:1909: recipe for target 'build/scrypt_mine.o' failed
make: *** [build/scrypt_mine.o] Error 1

What I think is going on is that some implementations of scrypt got made to be so totally dependent on sse instructions on one brand of cpu that they won't compile for another.

Now the solution requires a better answer from the Litecoin people, as what I got to work is only applicable to bitcoin and other sha256d coins: Ditch any scrypt based coins, as those are limited to a particular brand of cpu which does sse. Compile for sha256d based coins as those are more portable and wallets can work on ARM7 devices including raspberry pi.

  • 2
    FYI, [SSE](https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions) is a group of [SIMD](https://en.wikipedia.org/wiki/SIMD) instructions for x86. I think when you say "sse" here what you really mean is SIMD. SIMD is the general term, SSE is a specific implementation (for x86). It's a small nitpick, but these little details do make a difference. – Cornstalks Aug 05 '15 at 15:42