xmr-stak won't compile on 32-bit Linux

For anyone wondering if xmr-stak will compile on 32-bit Linux for Monero/Aeon CPU mining, the short answer is no. I spent considerable time trying to force it to work on an old Ubuntu 14.04 laptop as well as on a VPS. Two earlier hurdles were getting CMake 3+ and gcc-5/g++5 installed. Those can be added via Debian/Ubuntu ppa's (for those of you on 64-bit, check out Upgrading Ubuntu 14.04 / Debian 8 "jessie" with CMake 3.x, gcc-5, and g++-5), but then when you go to actually build xmr-stak, there's a funny Easter egg in the make output:


In file included from /home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:24:0:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:36:2: error: #error You are trying to do a 32-bit build. This will all end in tears. I know it.
 #error You are trying to do a 32-bit build. This will all end in tears. I know it.

There's somewhat of an alternative for those of you who still want to do some low-power CPU mining. You can mine MAGI coin using pre-built binaries that work on older 32-bit Linux distros. Check out CPU miner for Magi (m-minerd).

Here are all the gory details (truncated) from the 32-bit xmr-stak build attempt:


user@ubuntu14 ~/xmr-stak/build $ cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF ..
-- The C compiler identification is GNU 5.4.1
-- The CXX compiler identification is GNU 5.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Set miner currency to 'monero' and 'aeon'
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenSSL: /usr/lib/i386-linux-gnu/libssl.so;/usr/lib/i386-linux-gnu/libcrypto.so (found version "1.0.1f") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/xmr-stak/build
user@ubuntu14 ~/xmr-stak/build $ ll
total 68
drwxr-xr-x 4 user user  4096 Feb 22 14:44 .
drwxr-xr-x 9 user user  4096 Feb 22 14:44 ..
drwxr-xr-x 2 user user  4096 Feb 22 14:44 bin
-rw-r--r-- 1 user user 15612 Feb 22 14:44 CMakeCache.txt
drwxr-xr-x 7 user user  4096 Feb 22 14:44 CMakeFiles
-rw-r--r-- 1 user user  1521 Feb 22 14:44 cmake_install.cmake
-rw-r--r-- 1 user user 31202 Feb 22 14:44 Makefile
user@ubuntu14 ~/xmr-stak/build $ make install
Scanning dependencies of target xmr-stak-c
[  4%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o
[  9%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o
[ 13%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o
[ 18%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o
[ 22%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o
Linking C static library bin/libxmr-stak-c.a
[ 22%] Built target xmr-stak-c
Scanning dependencies of target xmr-stak-backend
[ 27%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o
[ 31%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o
[ 36%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o
[ 40%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
In file included from /home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:24:0:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:36:2: error: #error You are trying to do a 32-bit build. This will all end in tears. I know it.
 #error You are trying to do a 32-bit build. This will all end in tears. I know it.
  ^
In file included from /home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:24:0:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In function ‘uint64_t _umul128(uint64_t, uint64_t, uint64_t*)’:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:26:11: error: expected unqualified-id before ‘__int128’
  unsigned __int128 r = (unsigned __int128)a * (unsigned __int128)b;
           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:27:8: error: ‘r’ was not declared in this scope
  *hi = r >> 64;
        ^
In file included from /home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:24:0:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In function ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*)’:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:30: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
   idx0 = _mm_cvtsi128_si64(cx);
                              ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:30: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In function ‘void cryptonight_double_hash(const void*, size_t, void*, cryptonight_ctx**)’:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:392:30: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
   idx0 = _mm_cvtsi128_si64(cx);
                              ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:406:30: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
   idx1 = _mm_cvtsi128_si64(cx);
                              ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In function ‘void cryptonight_triple_hash(const void*, size_t, void*, cryptonight_ctx**)’:
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:460:27: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  idx = _mm_cvtsi128_si64(a);    \
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:519:3: note: in expansion of macro ‘CN_STEP1’
   CN_STEP1(ax0, bx0, cx0, l0, ptr0, idx0);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:460:27: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  idx = _mm_cvtsi128_si64(a);    \
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:520:3: note: in expansion of macro ‘CN_STEP1’
   CN_STEP1(ax1, bx1, cx1, l1, ptr1, idx1);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:460:27: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  idx = _mm_cvtsi128_si64(a);    \
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:521:3: note: in expansion of macro ‘CN_STEP1’
   CN_STEP1(ax2, bx2, cx2, l2, ptr2, idx2);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:475:27: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  idx = _mm_cvtsi128_si64(c);    \
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:527:3: note: in expansion of macro ‘CN_STEP3’
   CN_STEP3(ax0, bx0, cx0, l0, ptr0, idx0);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:475:27: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  idx = _mm_cvtsi128_si64(c);    \
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:528:3: note: in expansion of macro ‘CN_STEP3’
   CN_STEP3(ax1, bx1, cx1, l1, ptr1, idx1);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:475:27: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  idx = _mm_cvtsi128_si64(c);    \
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:529:3: note: in expansion of macro ‘CN_STEP3’
   CN_STEP3(ax2, bx2, cx2, l2, ptr2, idx2);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:482:40: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  lo = _umul128(idx, _mm_cvtsi128_si64(b), &hi);  \
                                        ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:531:3: note: in expansion of macro ‘CN_STEP4’
   CN_STEP4(ax0, bx0, cx0, l0, ptr0, idx0);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:482:40: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  lo = _umul128(idx, _mm_cvtsi128_si64(b), &hi);  \
                                        ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:532:3: note: in expansion of macro ‘CN_STEP4’
   CN_STEP4(ax1, bx1, cx1, l1, ptr1, idx1);
   ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:482:40: error: there are no arguments to ‘_mm_cvtsi128_si64’ that depend on a template parameter, so a declaration of ‘_mm_cvtsi128_si64’ must be available [-fpermissive]
  lo = _umul128(idx, _mm_cvtsi128_si64(b), &hi);  \

...

/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 2097136u; unsigned int ITERATIONS = 524288u; unsigned int MEM = 2097152u; bool SOFT_AES = false; bool PREFETCH = false; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:27: error: ‘_mm_cvtsi128_si64’ was not declared in this scope
   idx0 = _mm_cvtsi128_si64(cx);
                           ^
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 2097136u; unsigned int ITERATIONS = 524288u; unsigned int MEM = 2097152u; bool SOFT_AES = false; bool PREFETCH = true; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:27: error: ‘_mm_cvtsi128_si64’ was not declared in this scope
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 2097136u; unsigned int ITERATIONS = 524288u; unsigned int MEM = 2097152u; bool SOFT_AES = true; bool PREFETCH = false; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:27: error: ‘_mm_cvtsi128_si64’ was not declared in this scope
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 2097136u; unsigned int ITERATIONS = 524288u; unsigned int MEM = 2097152u; bool SOFT_AES = true; bool PREFETCH = true; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:27: error: ‘_mm_cvtsi128_si64’ was not declared in this scope
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 1048560u; unsigned int ITERATIONS = 262144u; unsigned int MEM = 1048576u; bool SOFT_AES = false; bool PREFETCH = false; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:27: error: ‘_mm_cvtsi128_si64’ was not declared in this scope
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 1048560u; unsigned int ITERATIONS = 262144u; unsigned int MEM = 1048576u; bool SOFT_AES = false; bool PREFETCH = true; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:319:27: error: ‘_mm_cvtsi128_si64’ was not declared in this scope
/home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h: In instantiation of ‘void cryptonight_hash(const void*, size_t, void*, cryptonight_ctx*) [with unsigned int MASK = 1048560u; unsigned int ITERATIONS = 262144u; unsigned int MEM = 1048576u; bool SOFT_AES = true; bool PREFETCH = false; size_t = unsigned int]’:
/home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:359:2:   required from here

...

make[2]: *** [CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o] Error 1
make[1]: *** [CMakeFiles/xmr-stak-backend.dir/all] Error 2
make: *** [all] Error 2

Comments

Popular posts from this blog

Domain registrar pricing comparison (2014)

How to block the Admiral anti ad-block detection message

usoclient.exe in Windows 10 wakes up my PC with Wake Source: Unknown