i tried to compile the source code on my mac 10.12.5.
i followed the instruction on git:
git submodule init
git submodule update
autoreconf -i
CFLAGS="-O2 -Wall -march=native -std=gnu99" ./configure
make
I get following messages: For me it looks like the compiler does some pre checking. in C you should be able to compile this..
sgminer.c:8160:56: error: member reference type 'int' is not a pointer
list_for_each_entry_safe(ent, iter, &pool->curlring, node)
Error messages:
`
./miner.h:8:9: note: previous definition is here
define VERSION GIT_VERSION
^
sgminer.c:2562:26: warning: passing 'gl_uint8_t [32]' to parameter of type 'char ' converts between pointers to integer types with different sign [-Wpointer-sign]
if (!parse_diff_ethash(Target, TgtStr))
^~
sgminer.c:2533:30: note: passing argument to parameter 'Target' here
bool parse_diff_ethash(char Target, const char TgtStr);
^
sgminer.c:2536:7: warning: unused variable 'i' [-Wunused-variable]
int i;
^
sgminer.c:2539:51: warning: unused variable 'BlockHeightStr' [-Wunused-variable]
const char EthWorkStr, SeedHashStr, TgtStr, BlockHeightStr, NetDiffStr, FinalNetDiffStr[65];
^
sgminer.c:2539:68: warning: unused variable 'NetDiffStr' [-Wunused-variable]
const char EthWorkStr, SeedHashStr, TgtStr, BlockHeightStr, NetDiffStr, FinalNetDiffStr[65];
^
sgminer.c:2539:80: warning: unused variable 'FinalNetDiffStr' [-Wunused-variable]
const char EthWorkStr, SeedHashStr, TgtStr, BlockHeightStr, NetDiffStr, FinalNetDiffStr[65];
^
sgminer.c:3332:31: warning: incompatible pointer types passing 'uint64_t ' (aka 'unsigned long long ') to parameter of type 'const unsigned char '
[-Wincompatible-pointer-types]
char ASCIINonce = bin2hex(&tmp, 8);
^~~~
./miner.h:1179:43: note: passing argument to parameter 'p' here
extern char bin2hex(const unsigned char p, size_t len);
^
sgminer.c:3934:26: warning: passing 'const char const ' to parameter of type 'char const ' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]
execv(initial_args[0], (EXECV_2ND_ARG_TYPE)initial_args);
^~~~~~~~
/usr/include/unistd.h:443:48: note: passing argument to parameter 'argv' here
int execv(const char * path, char const argv) WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
sgminer.c:6031:34: warning: incompatible pointer types passing 'uint64_t ' (aka 'unsigned long long ') to parameter of type 'const unsigned char '
[-Wincompatible-pointer-types]
char ASCIINonce = bin2hex(&tmp, 8);
^~~~
./miner.h:1179:43: note: passing argument to parameter 'p' here
extern char bin2hex(const unsigned char p, size_t len);
^
sgminer.c:6053:34: warning: incompatible pointer types passing 'gl_uint32_t ' (aka 'unsigned int ') to parameter of type 'const unsigned char '
[-Wincompatible-pointer-types]
char ASCIINonce = bin2hex(&work->XMRNonce, 4);
^~~~~~~
./miner.h:1179:43: note: passing argument to parameter 'p' here
extern char bin2hex(const unsigned char p, size_t len);
^
sgminer.c:6045:15: warning: unused variable 'HashResult' [-Wunused-variable]
uint8_t HashResult[32];
^
sgminer.c:6006:15: warning: unused variable 'nonce2_64' [-Wunused-variable]
uint64_t nonce2_64;
^
sgminer.c:6369:45: warning: variable 'ethval2' is uninitialized when used here [-Wuninitialized]
rc = work_decode_eth(pool, work, val, ethval2);
^~~
sgminer.c:6232:24: note: initialize the variable 'ethval2' to silence this warning
json_t val, ethval2;
^
= NULL
sgminer.c:6906:15: warning: unused variable 'opt' [-Wunused-variable]
const char opt;
^
sgminer.c:7329:17: warning: unused variable 'opt' [-Wunused-variable]
const char opt;
^
sgminer.c:8160:3: warning: implicit declaration of function 'typeof' is invalid in C99 [-Wimplicit-function-declaration]
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
^
./elist.h:245:38: note: expanded from macro 'list_for_each_entry_safe'
for (pos = list_entry((head)->next, typeof(pos), member), \
^
sgminer.c:8160:3: error: expected ')'
./elist.h:245:13: note: expanded from macro 'list_for_each_entry_safe'
for (pos = list_entry((head)->next, typeof(pos), member), \
^
./elist.h:185:48: note: expanded from macro 'list_entry'
((type)((char )(ptr)-(unsigned long)(&((type)0)->member)))
^
sgminer.c:8160:3: note: to match this '('
./elist.h:245:13: note: expanded from macro 'list_for_each_entry_safe'
for (pos = list_entry((head)->next, typeof(pos), member), \
^
./elist.h:185:41: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
^
sgminer.c:8160:56: error: member reference type 'int' is not a pointer
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
./elist.h:245:51: note: expanded from macro 'list_for_each_entry_safe'
for (pos = list_entry((head)->next, typeof(pos), member), \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
./elist.h:185:52: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
~~~~~~ ^
sgminer.c:8160:3: error: expected ')'
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
^
./elist.h:246:7: note: expanded from macro 'list_for_each_entry_safe'
n = list_entry(pos->member.next, typeof(pos), member); \
^
./elist.h:185:48: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
^
sgminer.c:8160:3: note: to match this '('
./elist.h:246:7: note: expanded from macro 'list_for_each_entry_safe'
n = list_entry(pos->member.next, typeof(pos), member); \
^
./elist.h:185:41: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
^
sgminer.c:8160:56: error: member reference type 'int' is not a pointer
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
./elist.h:246:49: note: expanded from macro 'list_for_each_entry_safe'
n = list_entry(pos->member.next, typeof(pos), member); \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
./elist.h:185:52: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
~~~~~~ ^
sgminer.c:8160:3: error: expected ')'
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
^
./elist.h:248:16: note: expanded from macro 'list_for_each_entry_safe'
pos = n, n = list_entry(n->member.next, typeof(n), member))
^
./elist.h:185:48: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
^
sgminer.c:8160:3: note: to match this '('
./elist.h:248:16: note: expanded from macro 'list_for_each_entry_safe'
pos = n, n = list_entry(n->member.next, typeof(n), member))
^
./elist.h:185:41: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
^
sgminer.c:8160:56: error: member reference type 'int' is not a pointer
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
./elist.h:248:54: note: expanded from macro 'list_for_each_entry_safe'
pos = n, n = list_entry(n->member.next, typeof(n), member))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
./elist.h:185:52: note: expanded from macro 'list_entry'
((type)((char *)(ptr)-(unsigned long)(&((type)0)->member)))
~~~~~~ ^
16 warnings and 6 errors generated.
make[2]: *** [sgminer-sgminer.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
`
Hi all,
i tried to compile the source code on my mac 10.12.5. i followed the instruction on git: git submodule init git submodule update autoreconf -i CFLAGS="-O2 -Wall -march=native -std=gnu99" ./configure
make
I get following messages: For me it looks like the compiler does some pre checking. in C you should be able to compile this..
sgminer.c:8160:56: error: member reference type 'int' is not a pointer list_for_each_entry_safe(ent, iter, &pool->curlring, node)
Error messages: ` ./miner.h:8:9: note: previous definition is here
define VERSION GIT_VERSION
sgminer.c:2562:26: warning: passing 'gl_uint8_t [32]' to parameter of type 'char ' converts between pointers to integer types with different sign [-Wpointer-sign] if (!parse_diff_ethash(Target, TgtStr)) ^
~sgminer.c:2533:30: note: passing argument to parameter 'Target' here bool parse_diff_ethash(char Target, const char TgtStr); ^ sgminer.c:2536:7: warning: unused variable 'i' [-Wunused-variable] int i; ^ sgminer.c:2539:51: warning: unused variable 'BlockHeightStr' [-Wunused-variable] const char EthWorkStr, SeedHashStr, TgtStr, BlockHeightStr, NetDiffStr, FinalNetDiffStr[65]; ^ sgminer.c:2539:68: warning: unused variable 'NetDiffStr' [-Wunused-variable] const char EthWorkStr, SeedHashStr, TgtStr, BlockHeightStr, NetDiffStr, FinalNetDiffStr[65]; ^ sgminer.c:2539:80: warning: unused variable 'FinalNetDiffStr' [-Wunused-variable] const char EthWorkStr, SeedHashStr, TgtStr, BlockHeightStr, NetDiffStr, FinalNetDiffStr[65]; ^ sgminer.c:3332:31: warning: incompatible pointer types passing 'uint64_t ' (aka 'unsigned long long ') to parameter of type 'const unsigned char ' [-Wincompatible-pointer-types] char ASCIINonce = bin2hex(&tmp, 8); ^~~~ ./miner.h:1179:43: note: passing argument to parameter 'p' here extern char bin2hex(const unsigned char p, size_t len); ^ sgminer.c:3934:26: warning: passing 'const char const ' to parameter of type 'char const ' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] execv(initial_args[0], (EXECV_2ND_ARG_TYPE)initial_args); ^~~~~~~~ /usr/include/unistd.h:443:48: note: passing argument to parameter 'argv' here int execv(const char * path, char const argv) WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ sgminer.c:6031:34: warning: incompatible pointer types passing 'uint64_t ' (aka 'unsigned long long ') to parameter of type 'const unsigned char ' [-Wincompatible-pointer-types] char ASCIINonce = bin2hex(&tmp, 8); ^~~~ ./miner.h:1179:43: note: passing argument to parameter 'p' here extern char bin2hex(const unsigned char p, size_t len); ^ sgminer.c:6053:34: warning: incompatible pointer types passing 'gl_uint32_t ' (aka 'unsigned int ') to parameter of type 'const unsigned char ' [-Wincompatible-pointer-types] char ASCIINonce = bin2hex(&work->XMRNonce, 4); ^~~~~~~ ./miner.h:1179:43: note: passing argument to parameter 'p' here extern char bin2hex(const unsigned char p, size_t len); ^ sgminer.c:6045:15: warning: unused variable 'HashResult' [-Wunused-variable] uint8_t HashResult[32]; ^ sgminer.c:6006:15: warning: unused variable 'nonce2_64' [-Wunused-variable] uint64_t nonce2_64; ^ sgminer.c:6369:45: warning: variable 'ethval2' is uninitialized when used here [-Wuninitialized] rc = work_decode_eth(pool, work, val, ethval2); ^~~ sgminer.c:6232:24: note: initialize the variable 'ethval2' to silence this warning json_t val, ethval2; ^ = NULL sgminer.c:6906:15: warning: unused variable 'opt' [-Wunused-variable] const char opt; ^ sgminer.c:7329:17: warning: unused variable 'opt' [-Wunused-variable] const char opt; ^ sgminer.c:8160:3: warning: implicit declaration of function 'typeof' is invalid in C99 [-Wimplicit-function-declaration] list_for_each_entry_safe(ent, iter, &pool->curlring, node) { ^ ./elist.h:245:38: note: expanded from macro 'list_for_each_entry_safe' for (pos = list_entry((head)->next, typeof(pos), member), \ ^ sgminer.c:8160:3: error: expected ')' ./elist.h:245:13: note: expanded from macro 'list_for_each_entry_safe' for (pos = list_entry((head)->next, typeof(pos), member), \ ^ ./elist.h:185:48: note: expanded from macro 'list_entry' ((type)((char )(ptr)-(unsigned long)(&((type)0)->member))) ^ sgminer.c:8160:3: note: to match this '(' ./elist.h:245:13: note: expanded from macro 'list_for_each_entry_safe' for (pos = list_entry((head)->next, typeof(pos), member), \ ^ ./elist.h:185:41: note: expanded from macro 'list_entry' ((type)((char *)(ptr)-(unsigned long)(&((type)0)->member))) ^ sgminer.c:8160:56: error: member reference type 'int' is not a pointer list_for_each_entry_safe(ent, iter, &pool->curlring, node) {