preda / gpuowl

GPU Mersenne primality test.
GNU General Public License v3.0
127 stars 35 forks source link

Cannot compile version 7.2 on Arch based Linuxes #254

Closed xcom169 closed 1 year ago

xcom169 commented 2 years ago

SHA3 error during compiling with both make and ninja:

n file included from Proof.cpp:5: Sha3Hash.h:18:29: error: return type ‘struct std::array<long unsigned int, 4>’ is incomplete 18 array<u64, 4> finish() && { ^ Proof.cpp: In function ‘std::array<long unsigned int, 4> proof::hashWords(u32, const Words&)’: Proof.cpp:24:66: error: could not convert ‘(& std::move<Hash&>(( & Hash().Hash::update(((const void)(& words)->std::vector::data()), (((E - 1) / 8) + 1)))))->Hash::finish()’ from ‘void’ to ‘std::array<long unsigned int, 4>’ 24 return std::move(SHA3{}.update(words.data(), (E-1)/8+1)).finish(); ~~~~~~~~~~~~^~
void
Proof.cpp: In function ‘std::array<long unsigned int, 4> proof::hashWords(u32, std::array<long unsigned int, 4>, const Words&)’: Proof.cpp:28:81: error: could not convert ‘(& std::move<Hash&>(( &(& Hash().Hash::update<long unsigned int, 4>(prefix))->Hash::update(((const void)(& words)->std::vector::data()), (((E - 1) / 8) + 1)))))->Hash::finish()’ from ‘void’ to ‘std::array<long unsigned int, 4>’ 28 return std::move(SHA3{}.update(prefix).update(words.data(), (E-1)/8+1)).finish(); ~~~~~~~~~~~~~~~^~
void

make: *** [Makefile:33: Proof.o] Error 1

shenzhui007 commented 1 year ago

Same error output on a Kali Linux which is a Debian based Linux.

tdulcet commented 1 year ago

Is this with GCC 12? What is the output from g++ --version?

bjver86 commented 1 year ago

SHA3 error during compiling with both make and ninja:

n file included from Proof.cpp:5: Sha3Hash.h:18:29: error: return type ‘struct std::array<long unsigned int, 4>’ is incomplete 18 | array<u64, 4> finish() && { | ^ Proof.cpp: In function ‘std::array<long unsigned int, 4> proof::hashWords(u32, const Words&)’: Proof.cpp:24:66: error: could not convert ‘(& std::move<Hash&>(( & Hash().Hash::update(((const void)(& words)->std::vector::data()), (((E - 1) / 8) + 1)))))->Hash::finish()’ from ‘void’ to ‘std::array<long unsigned int, 4>’ 24 | return std::move(SHA3{}.update(words.data(), (E-1)/8+1)).finish(); | ~~~~~~~~~~~~^~ | | | void Proof.cpp: In function ‘std::array<long unsigned int, 4> proof::hashWords(u32, std::array<long unsigned int, 4>, const Words&)’: Proof.cpp:28:81: error: could not convert ‘(& std::move<Hash&>(( &(& Hash().Hash::update<long unsigned int, 4>(prefix))->Hash::update(((const void)(& words)->std::vector::data()), (((E - 1) / 8) + 1)))))->Hash::finish()’ from ‘void’ to ‘std::array<long unsigned int, 4>’ 28 | return std::move(SHA3{}.update(prefix).update(words.data(), (E-1)/8+1)).finish(); | ~~~~~~~~~~~~~~~^~ | | | void make: *** [Makefile:33: Proof.o] Error 1

Trying to compile for Windows (x64) I encountered the same "Sha3Hash.h:18:29: error: return type ‘struct std::array<long unsigned int, 4>’ is incomplete"

I had to Add "#include < array >" to "Sha3Hash.h" file. (**minus spaces between the carats, since GH comments eats the text between carats without those spaces)

I also found I needed to include array in "Gpu.cpp" and "clwrap.cpp" as well to resolve all build errors and successfully compile, in case it is relevant to your Arch woes.

shenzhui007 commented 1 year ago

Is this with GCC 12? What is the output from g++ --version?

The output of mine is : g++ (Debian 12.2.0-1) 12.2.0

preda commented 1 year ago

The missing include was merged.

xcom169 commented 1 year ago

Thanks! I'll try soon.

On Sun, 2 Oct 2022 at 17:11, Mihai Preda @.***> wrote:

The missing include was merged.

— Reply to this email directly, view it on GitHub https://github.com/preda/gpuowl/issues/254#issuecomment-1264665962, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2G2TXZXCLXQPG6IWPEB3WBGXZNANCNFSM6AAAAAAQDEK7KM . You are receiving this because you authored the thread.Message ID: @.***>