MoneroOcean / xmrig

Monero (rx/0, rx/wow, rx/loki, defyx, rx/arq, rx/sfx, rx/keva, cn/0, cn/1, cn/2, cn/r, cn/fast, cn/half, cn/xao, cn/rto, cn/rwz, cn/zls, cn/double, cn/gpu, cn-lite/0, cn-lite/1, cn-heavy/0, cn-heavy/tube, cn-heavy/xhv, cn-pico, cn-pico/tlo, argon2/chukwa, argon2/wrkz, astrobwt) CPU/GPU miner
https://moneroocean.stream
GNU General Public License v3.0
273 stars 86 forks source link

Problem compiling 6.3.5-mo1 on ARM64 #32

Closed jfikar closed 4 years ago

jfikar commented 4 years ago

The building of 6.3.5-mo1 fails on ARM64 with:

...
[ 93%] Building CXX object CMakeFiles/xmrig.dir/src/crypto/randomx/jit_compiler_a64.cpp.o
[ 93%] Building CXX object CMakeFiles/xmrig.dir/src/crypto/rx/RxNUMAStorage.cpp.o
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp: In function ‘size_t randomx::CalcDatasetItemSize()’:
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp:78:29: error: invalid use of non-static data member ‘RandomX_ConfigurationBase::CacheAccesses’
  RandomX_ConfigurationBase::CacheAccesses * (
                             ^~~~~~~~~~~~~
In file included from /home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/common.hpp:36,
                 from /home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.hpp:35,
                 from /home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp:30:
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/randomx.h:80:18: note: declared here
         uint32_t CacheAccesses;
                  ^~~~~~~~~~~~~
[ 94%] Building CXX object CMakeFiles/xmrig.dir/src/crypto/argon2/Impl.cpp.o
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp: In instantiation of ‘void randomx::JitCompilerA64::generateSuperscalarHash(randomx::SuperscalarProgram (&)[N], std::vector<long unsigned int>&) [with long unsigned int N = 16]’:
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp:341:152:   required from here
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp:238:25: error: invalid use of non-static data member ‘RandomX_ConfigurationBase::CacheAccesses’
  for (size_t i = 0; i < RandomX_ConfigurationBase::CacheAccesses; ++i)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/common.hpp:36,
                 from /home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.hpp:35,
                 from /home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/jit_compiler_a64.cpp:30:
/home/pi/xmrig-6.3.5-mo1/src/crypto/randomx/randomx.h:80:18: note: declared here
         uint32_t CacheAccesses;
                  ^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/xmrig.dir/build.make:2377: CMakeFiles/xmrig.dir/src/crypto/randomx/jit_compiler_a64.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:74: CMakeFiles/xmrig.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

The problem seems to be that src/crypto/randomx/randomx.h does not play correctly with src/crypto/randomx/jit_compiler_a64.cpp.

v6.3.3-mo1 and original xmrig-6.3.5 work as expected.

turtleminor13 commented 4 years ago

I also have the same issues with recent versions on my arm64 Jetson TX2 with gcc 7.5 on ubuntu 18.04.5. Still a problem with version v6.4.0-mo2, while base xmrig v6.4.0 successfully compiles.

... [ 91%] Building C object CMakeFiles/xmrig.dir/src/crypto/randomx/defyx/yescrypt-best.c.o [ 92%] Building C object CMakeFiles/xmrig.dir/src/crypto/randomx/panthera/sha256.c.o [ 92%] Building C object CMakeFiles/xmrig.dir/src/crypto/randomx/panthera/yespower-opt.c.o /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/panthera/yespower-opt.c:61:2: warning: #warning "Note: building generic code for non-x86. That's OK." [-Wcpp]

warning "Note: building generic code for non-x86. That's OK."

^~~ [ 93%] Building C object CMakeFiles/xmrig.dir/src/crypto/randomx/jit_compiler_a64_static.S.o [ 93%] Building CXX object CMakeFiles/xmrig.dir/src/crypto/randomx/jit_compiler_a64.cpp.o /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp: In function âsize_t randomx::CalcDatasetItemSize()â: /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp:85:29: error: invalid use of non-static data member âRandomX_ConfigurationBase::CacheAccessesâ RandomX_ConfigurationBase::CacheAccesses * ( ^~~~~ In file included from /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/common.hpp:36:0, from /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.hpp:35, from /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp:30: /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/randomx.h:80:18: note: declared here uint32_t CacheAccesses; ^~~~~ /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp: In instantiation of âvoid randomx::JitCompilerA64::generateSuperscalarHash(randomx::SuperscalarProgram (&)[N], std::vector&) [with long unsigned int N = 16]â: /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp:348:152: required from here /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp:245:25: error: invalid use of non-static data member âRandomX_ConfigurationBase::CacheAccessesâ for (size_t i = 0; i < RandomX_ConfigurationBase::CacheAccesses; ++i) ^~~~~~~~~ In file included from /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/common.hpp:36:0, from /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.hpp:35, from /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/jit_compiler_a64.cpp:30: /home/turtlejas/mining/xmrigmo640/src/crypto/randomx/randomx.h:80:18: note: declared here uint32_t CacheAccesses; ^~~~~ At global scope: cc1plus: warning: unrecognized command line option â-Wno-class-memaccessâ CMakeFiles/xmrig.dir/build.make:4766: recipe for target 'CMakeFiles/xmrig.dir/src/crypto/randomx/jit_compiler_a64.cpp.o' failed make[2]: *** [CMakeFiles/xmrig.dir/src/crypto/randomx/jit_compiler_a64.cpp.o] Error 1 CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/xmrig.dir/all' failed

MoneroOcean commented 4 years ago

This should be fixed in v6.4.0-mo3 release.

MoneroOcean commented 4 years ago

Thank you for report!

turtleminor13 commented 4 years ago

Fixed for me, thanks!

jfikar commented 4 years ago

I can confirm, it works now. Good job!