Browse Source

fix linux build and stratum merkle calculation

2upstream
R4SAS 6 years ago
parent
commit
b7db07f434
  1. 2
      INSTALL
  2. 2
      Makefile.am
  3. 19
      ccminer.cpp
  4. 2
      ccminer.vcxproj
  5. 7
      miner.h

2
INSTALL

@ -79,7 +79,7 @@ make -j 8 && make install
./ccminer -n ./ccminer -n
** Arch Linux notice ** ** Arch Linux notice (need to be checked)**
For Arch Linux needed add some flags when configuring sources For Arch Linux needed add some flags when configuring sources
extracflags="-march=native -D_REENTRANT -falign-functions=16 -falign-jumps=16 -falign-labels=16" CPPFLAGS='-I/usr/include/openssl-1.0' \ extracflags="-march=native -D_REENTRANT -falign-functions=16 -falign-jumps=16 -falign-labels=16" CPPFLAGS='-I/usr/include/openssl-1.0' \
LDFLAGS='-L/usr/lib/openssl-1.0 -L/usr/lib' \ LDFLAGS='-L/usr/lib/openssl-1.0 -L/usr/lib' \

2
Makefile.am

@ -78,7 +78,7 @@ ccminer_SOURCES = elist.h miner.h compat.h \
x15/whirlpool.cu x15/cuda_x15_whirlpool_sm3.cu \ x15/whirlpool.cu x15/cuda_x15_whirlpool_sm3.cu \
x17/x17.cu x17/hmq17.cu x17/cuda_x17_haval256.cu x17/cuda_x17_sha512.cu \ x17/x17.cu x17/hmq17.cu x17/cuda_x17_haval256.cu x17/cuda_x17_sha512.cu \
x11/phi.cu x11/cuda_streebog_maxwell.cu \ x11/phi.cu x11/cuda_streebog_maxwell.cu \
x11/c11.cu x11/s3.cu x11/sib.cu x11/veltor.cu x11/cuda_streebog.cu x11/c11.cu x11/s3.cu x11/sib.cu x11/veltor.cu x11/cuda_streebog.cu \
gost/gost.cu gost/cuda_gosthash.cu gost/gost.cu gost/cuda_gosthash.cu
# scrypt # scrypt

19
ccminer.cpp

@ -251,12 +251,7 @@ Options:\n\
dmd-gr Diamond-Groestl\n\ dmd-gr Diamond-Groestl\n\
fresh Freshcoin (shavite 80)\n\ fresh Freshcoin (shavite 80)\n\
fugue256 Fuguecoin\n\ fugue256 Fuguecoin\n\
groestl Groestlcoin\n\ gostd GOSTd (GOSTcoin)\n\
heavy Heavycoin\n\
hmq1725 Doubloons / Espers\n\
jackpot Jackpot\n\
keccak Keccak-256 (Maxcoin)\n\
gostd GOSTd (GOSTcoin)\n\
groestl Groestlcoin\n" groestl Groestlcoin\n"
#ifdef WITH_HEAVY_ALGO #ifdef WITH_HEAVY_ALGO
" heavy Heavycoin\n" " heavy Heavycoin\n"
@ -1583,16 +1578,16 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
for (i = 0; i < sctx->job.merkle_count; i++) { for (i = 0; i < sctx->job.merkle_count; i++) {
memcpy(merkle_root + 32, sctx->job.merkle[i], 32); memcpy(merkle_root + 32, sctx->job.merkle[i], 32);
#ifdef WITH_HEAVY_ALGO if (opt_algo == ALGO_GOSTD)
if (opt_algo == ALGO_HEAVY || opt_algo == ALGO_MJOLLNIR)
heavycoin_hash(merkle_root, merkle_root, 64);
else if (opt_algo == ALGO_GOSTD)
{ {
memcpy(merkle_root + 32, merkle_root, 32); memcpy(merkle_root + 32, merkle_root, 32);
gostd(merkle_root, merkle_root, 64); gostd(merkle_root, merkle_root, 64);
} }
else #ifdef WITH_HEAVY_ALGO
else if (opt_algo == ALGO_HEAVY || opt_algo == ALGO_MJOLLNIR)
heavycoin_hash(merkle_root, merkle_root, 64);
#endif #endif
else
sha256d(merkle_root, merkle_root, 64); sha256d(merkle_root, merkle_root, 64);
} }
@ -3890,7 +3885,7 @@ int main(int argc, char *argv[])
CUDART_VERSION/1000, (CUDART_VERSION % 1000)/10, arch); CUDART_VERSION/1000, (CUDART_VERSION % 1000)/10, arch);
printf(" Originally based on Christian Buchner and Christian H. project\n"); printf(" Originally based on Christian Buchner and Christian H. project\n");
printf(" Include some kernels from alexis78, djm34, djEzo, tsiv and krnlx.\n\n"); printf(" Include some kernels from alexis78, djm34, djEzo, tsiv and krnlx.\n\n");
printf(" GOSTd algo by PurpleI2P team, ©2017. Donations are welcome to\n"); printf(" GOSTd algo by PurpleI2P team, ©2017-2018. Donations are welcome to\n");
printf(" address GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG. Thanks!\n\n"); printf(" address GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG. Thanks!\n\n");
printf("BTC donation address: 1AJdfCpLWPNoAMDfHF1wD5y8VgKSSTHxPo (tpruvot)\n\n"); printf("BTC donation address: 1AJdfCpLWPNoAMDfHF1wD5y8VgKSSTHxPo (tpruvot)\n\n");
} }

2
ccminer.vcxproj

@ -112,7 +112,7 @@
<MaxRegCount>80</MaxRegCount> <MaxRegCount>80</MaxRegCount>
<PtxAsOptionV>true</PtxAsOptionV> <PtxAsOptionV>true</PtxAsOptionV>
<Keep>true</Keep> <Keep>true</Keep>
<CodeGeneration>compute_50,sm_50</CodeGeneration> <CodeGeneration>compute_52,sm_52</CodeGeneration>
<Include>$(NVTOOLSEXT_PATH)\include;..\..\..\Common\C99</Include> <Include>$(NVTOOLSEXT_PATH)\include;..\..\..\Common\C99</Include>
<TargetMachinePlatform>64</TargetMachinePlatform> <TargetMachinePlatform>64</TargetMachinePlatform>
</CudaCompile> </CudaCompile>

7
miner.h

@ -267,7 +267,6 @@ json_t * json_load_url(char* cfg_url, json_error_t *err);
void sha256_init(uint32_t *state); void sha256_init(uint32_t *state);
void sha256_transform(uint32_t *state, const uint32_t *block, int swap); void sha256_transform(uint32_t *state, const uint32_t *block, int swap);
void sha256d(unsigned char *hash, const unsigned char *data, int len); void sha256d(unsigned char *hash, const unsigned char *data, int len);
void gostd(void *output, const void *input, size_t len); void gostd(void *output, const void *input, size_t len);
#define HAVE_SHA256_4WAY 0 #define HAVE_SHA256_4WAY 0
@ -288,6 +287,7 @@ extern int scanhash_equihash(int thr_id, struct work* work, uint32_t max_nonce,
extern int scanhash_keccak256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_keccak256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_fresh(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_fresh(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_fugue256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_fugue256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_gostd(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_groestlcoin(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_groestlcoin(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_hmq17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_hmq17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_heavy(int thr_id,struct work *work, uint32_t max_nonce, unsigned long *hashes_done, uint32_t maxvote, int blocklen); extern int scanhash_heavy(int thr_id,struct work *work, uint32_t max_nonce, unsigned long *hashes_done, uint32_t maxvote, int blocklen);
@ -311,7 +311,6 @@ extern int scanhash_sha256d(int thr_id, struct work *work, uint32_t max_nonce, u
extern int scanhash_sha256t(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_sha256t(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_sia(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_sia(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_sib(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_sib(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_gostd(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_skunk(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done); extern int scanhash_skunk(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done);
@ -353,6 +352,7 @@ extern void free_equihash(int thr_id);
extern void free_keccak256(int thr_id); extern void free_keccak256(int thr_id);
extern void free_fresh(int thr_id); extern void free_fresh(int thr_id);
extern void free_fugue256(int thr_id); extern void free_fugue256(int thr_id);
extern void free_gostd(int thr_id);
extern void free_groestlcoin(int thr_id); extern void free_groestlcoin(int thr_id);
extern void free_heavy(int thr_id); extern void free_heavy(int thr_id);
extern void free_hmq17(int thr_id); extern void free_hmq17(int thr_id);
@ -374,7 +374,6 @@ extern void free_quark(int thr_id);
extern void free_qubit(int thr_id); extern void free_qubit(int thr_id);
extern void free_sha256d(int thr_id); extern void free_sha256d(int thr_id);
extern void free_sha256t(int thr_id); extern void free_sha256t(int thr_id);
extern void free_gostd(int thr_id);
extern void free_sia(int thr_id); extern void free_sia(int thr_id);
extern void free_sib(int thr_id); extern void free_sib(int thr_id);
extern void free_skeincoin(int thr_id); extern void free_skeincoin(int thr_id);
@ -898,6 +897,7 @@ void deephash(void *state, const void *input);
void luffa_hash(void *state, const void *input); void luffa_hash(void *state, const void *input);
void fresh_hash(void *state, const void *input); void fresh_hash(void *state, const void *input);
void fugue256_hash(unsigned char* output, const unsigned char* input, int len); void fugue256_hash(unsigned char* output, const unsigned char* input, int len);
void gostd_hash(void *output, const void *input);
void heavycoin_hash(unsigned char* output, const unsigned char* input, int len); void heavycoin_hash(unsigned char* output, const unsigned char* input, int len);
void hmq17hash(void *output, const void *input); void hmq17hash(void *output, const void *input);
void hsr_hash(void *output, const void *input); void hsr_hash(void *output, const void *input);
@ -922,7 +922,6 @@ void scryptjane_hash(void* output, const void* input);
void sha256d_hash(void *output, const void *input); void sha256d_hash(void *output, const void *input);
void sha256t_hash(void *output, const void *input); void sha256t_hash(void *output, const void *input);
void sibhash(void *output, const void *input); void sibhash(void *output, const void *input);
void gostd_hash(void *output, const void *input);
void skeincoinhash(void *output, const void *input); void skeincoinhash(void *output, const void *input);
void skein2hash(void *output, const void *input); void skein2hash(void *output, const void *input);
void skunk_hash(void *state, const void *input); void skunk_hash(void *state, const void *input);

Loading…
Cancel
Save