SChernykh / p2pool

Decentralized pool for Monero mining
GNU General Public License v3.0
1.08k stars 128 forks source link

Build failed, cast warning taken as error #186

Closed Acytoo closed 2 years ago

Acytoo commented 2 years ago

Hi, I can't build p2pool after v2.2

system: Linux localhost 5.10.0-10-arm64 1 SMP Debian 5.10.84-1 (2021-12-08) aarch64 GNU/Linux

gcc: (Debian 10.2.1-6) 10.2.1 20210110

Followed the exact build instructions for ubuntu 2004

Checkout both v2.2 and master branch, neither works.

It looks like cast warnings are taken as error.

Here are the logs

[ 90%] Building CXX object CMakeFiles/p2pool.dir/src/stratum_server.cpp.o

In file included from p2pool/src/side_chain.cpp:28:
p2pool/external/src/RandomX/src/intrin_portable.h: In function ‘rx_vec_f128 rx_cvt_packed_int_vec_f128(const void*)’:
p2pool/external/src/RandomX/src/intrin_portable.h:515:47: error: cast from type ‘const void*’ to type ‘uint8_t*’ {aka ‘unsigned char*’} casts away qualifiers [-Werror=cast-qual]
  515 |  double lo = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 0));
      |                                               ^~~~~~~~~~~~~~
p2pool/external/src/RandomX/src/intrin_portable.h:516:47: error: cast from type ‘const void*’ to type ‘uint8_t*’ {aka ‘unsigned char*’} casts away qualifiers [-Werror=cast-qual]
  516 |  double hi = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 4));
      |                                               ^~~~~~~~~~~~~~

[ 92%] Building CXX object CMakeFiles/p2pool.dir/src/util.cpp.o
[ 94%] Building CXX object CMakeFiles/p2pool.dir/src/wallet.cpp.o
[ 96%] Building CXX object CMakeFiles/p2pool.dir/src/zmq_reader.cpp.o
[ 98%] Building CXX object CMakeFiles/p2pool.dir/src/miner.cpp.o
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/p2pool.dir/build.make:316: CMakeFiles/p2pool.dir/src/side_chain.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/p2pool.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
SChernykh commented 2 years ago

You didn't sync submodules properly. Try to

git submodule sync
git submodule update

and then rebuild.

Acytoo commented 2 years ago

You didn't sync submodules properly. Try to

git submodule sync
git submodule update

and then rebuild.

Thank you! After syncing the build was successful.