Bitcoin Forum
July 07, 2024, 08:16:50 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Other / Beginners & Help / Re: compile adlutil with gcc on Ubuntu 16.04.3 LTS on: December 12, 2017, 08:01:37 PM
I solved it finally myself, there is an error in the main.c in the adlutil directory.

Here is the fix for others, go to line 819, there you will find the functions: GetValue(), GetHex() and GetFloat().

Old code to replace

Code:
int GetValue(  char * name, int * iValue, int line )
{
char sField[ 256 ];
fscanf_s( file,"%32s %d\n", sField, 33, iValue);
if ( 0 == strcmp( sField, name ) )
return ADL_OK;
else
{
sprintf_s( err, sErr, "Expected     : %s \nActual       : %s \nIn line      : %d", name, sField, line );
return ADL_ERR;
}
}

int GetHex(  char * name, int * iValue, int line )
{
char sField[ 256 ];
fscanf_s( file,"%32s %X\n", sField, 33, iValue);
if ( 0 == strcmp( sField, name ) )
return ADL_OK;
else
{
sprintf_s( err, sErr, "Expected     : %s \nActual       : %s \nIn line      : %d", name, sField, line );
return ADL_ERR;
}
}

int GetFloat(  char * name, float * fValue, int line )
{
char sField[ 256 ];
fscanf_s( file,"%32s %f\n", sField, 33, fValue);
if ( 0 == strcmp( sField, name ) )
return ADL_OK;
else
{
sprintf_s( err,  sErr, "Expected     : %s \nActual       : %s \nIn line      : %d", name, sField, line );
return ADL_ERR;
}
}

with that:
Code:
int GetValue(  char * name, int * iValue, int line )
{
char sField[ 256 ];
fscanf_s( file,"%32s %d\n", sField, iValue);
if ( 0 == strcmp( sField, name ) )
return ADL_OK;
else
{
sprintf_s( err, sErr, "Expected     : %s \nActual       : %s \nIn line      : %d", name, sField, line );
return ADL_ERR;
}
}

int GetHex(  char * name, int * iValue, int line )
{
char sField[ 256 ];
fscanf_s( file,"%32s %X\n", sField, iValue);
if ( 0 == strcmp( sField, name ) )
return ADL_OK;
else
{
sprintf_s( err, sErr, "Expected     : %s \nActual       : %s \nIn line      : %d", name, sField, line );
return ADL_ERR;
}
}

int GetFloat(  char * name, float * fValue, int line )
{
char sField[ 256 ];
fscanf_s( file,"%32s %f\n", sField, fValue);
if ( 0 == strcmp( sField, name ) )
return ADL_OK;
else
{
sprintf_s( err,  sErr, "Expected     : %s \nActual       : %s \nIn line      : %d", name, sField, line );
return ADL_ERR;
}
}

Explaination:

the error was in the function:
Code:
fscanf_s( file,"%32s %d\n", sField, 33, iValue);
you have to remove te third argument in all the functions, after that it should compile the adlutil.

Regards,
Banzak
2  Other / Beginners & Help / [SOLVED] compile adlutil with gcc on Ubuntu 16.04.3 LTS on: December 12, 2017, 05:19:47 PM
Hello,

I am stuck with compiling the adlutil from the adl_sdk_V10.2 package.

I am running:
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

the gcc version is:
  • gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 2016060

I already installed:
  • the AMD-APP-SDK-3.0
  • the amdgpu-pro-17.40.492261

the Claymore DualMiner 10.2 is running fine since 1 week.

When I am trying to compile the adlutil with the following command:
Code:
sudo gcc main.c -o adlutil -DLINUX -ldl -I ../include/

I get the following error:
Code:
main.c: In function ‘GetValue’:
main.c:815:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 4 has type ‘int’ [-Wformat=]
  fscanf_s( file,"%32s %d\n", sField, 33, iValue);
                 ^
main.c:815:17: warning: too many arguments for format [-Wformat-extra-args]
main.c: In function ‘GetHex’:
main.c:828:17: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘int’ [-Wformat=]
  fscanf_s( file,"%32s %X\n", sField, 33, iValue);
                 ^
main.c:828:17: warning: too many arguments for format [-Wformat-extra-args]
main.c: In function ‘GetFloat’:
main.c:841:17: warning: format ‘%f’ expects argument of type ‘float *’, but argument 4 has type ‘int’ [-Wformat=]
  fscanf_s( file,"%32s %f\n", sField, 33, fValue);
                 ^
main.c:841:17: warning: too many arguments for format [-Wformat-extra-args]

How do I fix that, or what I am missing?

Thank you for your help!

Regards,
Banzak



3  Other / Off-topic / Merry Mining Xmas for All! on: December 11, 2017, 06:08:19 PM
Today I made a little XMas-Video for Miners!

And here is the link to the video:
Merry Mining XMas-Video

Have fun and Merry Mining Xmas!

Regards
Banzak
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!