KlausT / ccminer

Software for mining various cryptocoins
GNU General Public License v3.0
403 stars 312 forks source link

Compilation fails #251

Closed kkkrackpot closed 6 years ago

kkkrackpot commented 6 years ago

Current git version fails on Linux CUDA 9.2 GCC 7.3:

In file included from lyra2/lyra2REv2.cpp:11:0:
./cuda_helper.h: In function 'uint32_t ROL8(uint32_t)':
./cuda_helper.h:702:9: error: '__byte_perm' was not declared in this scope
  return __byte_perm(x, x, 0x2103);
         ^~~~~~~~~~~
./cuda_helper.h: In function 'uint32_t ROL16(uint32_t)':
./cuda_helper.h:706:9: error: '__byte_perm' was not declared in this scope
  return __byte_perm(x, x, 0x1032);
         ^~~~~~~~~~~
./cuda_helper.h: In function 'uint32_t ROL24(uint32_t)':
./cuda_helper.h:710:9: error: '__byte_perm' was not declared in this scope
  return __byte_perm(x, x, 0x0321);
         ^~~~~~~~~~~
./cuda_helper.h: In function 'uint2 ROR8(uint2)':
./cuda_helper.h:716:13: error: '__byte_perm' was not declared in this scope
  result.x = __byte_perm(a.y, a.x, 0x0765);
             ^~~~~~~~~~~
./cuda_helper.h: In function 'uint2 ROR16(uint2)':
./cuda_helper.h:725:13: error: '__byte_perm' was not declared in this scope
  result.x = __byte_perm(a.y, a.x, 0x1076);
             ^~~~~~~~~~~
./cuda_helper.h: In function 'uint2 ROR24(uint2)':
./cuda_helper.h:734:13: error: '__byte_perm' was not declared in this scope
  result.x = __byte_perm(a.y, a.x, 0x2107);
             ^~~~~~~~~~~
./cuda_helper.h: In function 'uint2 ROL8(uint2)':
./cuda_helper.h:743:13: error: '__byte_perm' was not declared in this scope
  result.x = __byte_perm(a.y, a.x, 0x6543);
             ^~~~~~~~~~~
./cuda_helper.h: In function 'uint2 ROL16(uint2)':
./cuda_helper.h:752:13: error: '__byte_perm' was not declared in this scope
  result.x = __byte_perm(a.y, a.x, 0x5432);
             ^~~~~~~~~~~
./cuda_helper.h: In function 'uint2 ROL24(uint2)':
./cuda_helper.h:761:13: error: '__byte_perm' was not declared in this scope
  result.x = __byte_perm(a.y, a.x, 0x4321);
             ^~~~~~~~~~~
lyra2/lyra2REv2.cpp: In function 'void lyra2v2_hash(void*, const void*)':
lyra2/lyra2REv2.cpp:74:2: error: 'memcpy' was not declared in this scope
  memcpy(state, hashA, 32);
  ^~~~~~
lyra2/lyra2REv2.cpp:74:2: note: suggested alternative: 'cuMemcpy'
  memcpy(state, hashA, 32);
  ^~~~~~
  cuMemcpy
lyra2/lyra2REv2.cpp: In function 'int scanhash_lyra2v2(int, uint32_t*, const uint32_t*, uint32_t, uint32_t*)':
lyra2/lyra2REv2.cpp:89:5: error: 'strstr' was not declared in this scope
  if(strstr(props.name, "Titan"))
     ^~~~~~
lyra2/lyra2REv2.cpp:89:5: note: suggested alternative: 'strtoq'
  if(strstr(props.name, "Titan"))
     ^~~~~~
     strtoq
make[2]: *** [Makefile:1484: lyra2/ccminer-lyra2REv2.o] Error 1
make[2]: Leaving directory '/tmp/ccminer'
make[1]: *** [Makefile:1770: all-recursive] Error 1
make[1]: Leaving directory '/tmp/ccminer'
make: *** [Makefile:513: all] Error 2
qpblockchain commented 6 years ago

Have the same

g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DUSE_WRAPNVML -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -O3 -march=native -D_REENTRANT -falign-functions=16 -falign-jumps=16 -falign-labels=16 -std=c++11 -MT Algo256/ccminer-keccak256.o -MD -MP -MF Algo256/.deps/ccminer-keccak256.Tpo -c -o Algo256/ccminer-keccak256.otest -f 'Algo256/keccak256.cpp' || echo './'Algo256/keccak256.cpp In file included from Algo256/keccak256.cpp:15:0: ./cuda_helper.h: In function ‘uint32_t ROL8(uint32_t)’: ./cuda_helper.h:711:33: error: ‘__byte_perm’ was not declared in this scope return __byte_perm(x, x, 0x2103); ^ ./cuda_helper.h: In function ‘uint32_t ROL16(uint32_t)’: ./cuda_helper.h:715:33: error: ‘__byte_perm’ was not declared in this scope return __byte_perm(x, x, 0x1032); ^ ./cuda_helper.h: In function ‘uint32_t ROL24(uint32_t)’: ./cuda_helper.h:719:33: error: ‘__byte_perm’ was not declared in this scope return __byte_perm(x, x, 0x0321); ^ ./cuda_helper.h: In function ‘uint2 ROR8(uint2)’: ./cuda_helper.h:725:41: error: ‘__byte_perm’ was not declared in this scope result.x = __byte_perm(a.y, a.x, 0x0765); ^ ./cuda_helper.h: In function ‘uint2 ROR16(uint2)’: ./cuda_helper.h:734:41: error: ‘__byte_perm’ was not declared in this scope result.x = __byte_perm(a.y, a.x, 0x1076); ^ ./cuda_helper.h: In function ‘uint2 ROR24(uint2)’: ./cuda_helper.h:743:41: error: ‘__byte_perm’ was not declared in this scope result.x = __byte_perm(a.y, a.x, 0x2107); ^ ./cuda_helper.h: In function ‘uint2 ROL8(uint2)’: ./cuda_helper.h:752:41: error: ‘__byte_perm’ was not declared in this scope result.x = __byte_perm(a.y, a.x, 0x6543); ^ ./cuda_helper.h: In function ‘uint2 ROL16(uint2)’: ./cuda_helper.h:761:41: error: ‘__byte_perm’ was not declared in this scope result.x = __byte_perm(a.y, a.x, 0x5432); ^ ./cuda_helper.h: In function ‘uint2 ROL24(uint2)’: ./cuda_helper.h:770:41: error: ‘__byte_perm’ was not declared in this scope result.x = __byte_perm(a.y, a.x, 0x4321); ^ Algo256/keccak256.cpp: In function ‘int scanhash_keccak256(int, uint32_t*, uint32_t*, uint32_t, uint32_t*)’: Algo256/keccak256.cpp:44:66: error: ‘min’ was not declared in this scope uint32_t throughput = min(throughputmax, max_nonce - first_nonce) & 0xfffffc00;

KlausT commented 6 years ago

Yeah. This happens sometimes because I don't have Linux here to test stuff. I will have to make some changes in the file cuda_helper.h

KlausT commented 6 years ago

I have made some changes. Please try it again. Not all errors will be gone, probably.

kkkrackpot commented 6 years ago

Nope, some errors are still there:

ccminer.cpp: In function 'void* miner_thread(void*)':
ccminer.cpp:1578:69: error: no matching function for call to 'max(int, time_t)'
    max64time = (uint32_t)max(1, scan_time + g_work_time - time(NULL));
                                                                     ^
...
ccminer.cpp:1640:32: error: no matching function for call to 'min(unsigned int, uint64_t&)'
   max64 = min(UINT32_MAX, max64);
                                ^
KlausT commented 6 years ago

Ok, more changes. Try again :-)

kkkrackpot commented 6 years ago

@KlausT Nope, it still fails, in yet another place...

nvml.cpp: In function 'int nvml_set_clocks(nvml_handle*, int)':
nvml.cpp:350:27: error: no matching function for call to 'min(uint32_t&, int)'
  nclocks = min(nclocks, 32);
                           ^
...
nvml.cpp: In function 'int nvml_set_pstate(nvml_handle*, int)':
nvml.cpp:463:27: error: no matching function for call to 'min(uint32_t&, int)'
  nclocks = min(nclocks, 32);
                           ^
KlausT commented 6 years ago

Ok, I have made changes to those two lines. More fixes will have to wait until tomorrow

kkkrackpot commented 6 years ago

It builds now, thanks!