Bitcoin Forum
May 03, 2024, 05:33:42 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help for compiling cgminer for icarus ASICs (USB Block Erupter)  (Read 207 times)
toto99303 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 03, 2023, 10:24:24 PM
 #1

Hi guys, newbie here,

I'm just trying to have some fun with an old USB Block Erupter, but I can't compile cg-miner.
I'm compiling on armbian (banana pi zero board), basically the same as raspbian for raspberry pi.

I tried 3 different repos and it's always the same error when I reach "make"

Steps:

sudo apt-get update -y
sudo apt-get install build-essential autoconf automake libtool pkg-config libcurl4-openssl-dev libudev-dev \
libjansson-dev libncurses5-dev libusb-1.0-0-dev zlib1g-dev git -y

git clone https://github.com/kanoi/cgminer.git   (tried also https://github.com/wareck/cgminer-gekko.git and the original http://ck.kolivas.org/apps/cgminer/)

cd cgminer
CFLAGS="-O2 -fcommon" ./autogen.sh --enable-icarus
make

and it fails with this:
Code:
In function ‘recv’,
    inlined from ‘api’ at api.c:5061:8:
/usr/include/arm-linux-gnueabihf/bits/socket2.h:40:12: warning: call to ‘__recv_chk_warn’ declared with attribute warning: recv called with bigger length than size of destination buffer [-Wattribute-warning]
   40 |     return __recv_chk_warn (__fd, __buf, __n, sz, __flags);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       cgminer-logging.o
  CC       cgminer-klist.o
  CC       cgminer-noncedup.o
  CC       cgminer-usbutils.o
  CC       cgminer-driver-icarus.o
  CCLD     cgminer
/usr/bin/ld: cgminer-api.o: in function `mcast':
api.c:(.text+0x814): undefined reference to `__glibc_safe_or_unknown_len'
/usr/bin/ld: api.c:(.text+0x82a): undefined reference to `__glibc_unsafe_len'
/usr/bin/ld: cgminer-api.o: in function `api':
api.c:(.text+0x7596): undefined reference to `__glibc_safe_or_unknown_len'
/usr/bin/ld: api.c:(.text+0x75ac): undefined reference to `__glibc_unsafe_len'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:907: cgminer] Error 1
make[2]: Leaving directory '/home/pi/cgminer'
make[1]: *** [Makefile:1896: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/cgminer'
make: *** [Makefile:810: all] Error 2
pi@bananapim2zero:~/cgminer$

Can anyone point me what could be the problem here?

Thanks!
1714714422
Hero Member
*
Offline Offline

Posts: 1714714422

View Profile Personal Message (Offline)

Ignore
1714714422
Reply with quote  #2

1714714422
Report to moderator
1714714422
Hero Member
*
Offline Offline

Posts: 1714714422

View Profile Personal Message (Offline)

Ignore
1714714422
Reply with quote  #2

1714714422
Report to moderator
1714714422
Hero Member
*
Offline Offline

Posts: 1714714422

View Profile Personal Message (Offline)

Ignore
1714714422
Reply with quote  #2

1714714422
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2955


Block halving is coming.


View Profile WWW
December 03, 2023, 11:11:34 PM
 #2

All guides and solution for cgminer is on the Kano Gekko page which you can find in the link below.

- https://kano.is/gekko.php

Also, scroll down to the bottom and read under "Remove pre-installed hack linux".

Would you mind to try this command below and update here if the error will be the  same.

Code:
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y build-essential autoconf automake libtool pkg-config libcurl4-openssl-dev libudev-dev libusb-1.0-0-dev libncurses5-dev zlib1g-dev git
cd
git clone https://github.com/kanoi/cgminer.git
cd cgminer
CFLAGS="-O2 -march=native -fcommon" ./autogen.sh --enable-gekko --enable-icarus
make
sudo apt-get install -y openjdk-8-jre-headless

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
toto99303 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 04, 2023, 08:39:40 PM
Last edit: December 04, 2023, 08:50:39 PM by toto99303
 #3

Hello BitMaxz,

I tried with your commands, but unfortunately it's still the same:

Code:
In function ‘recv’,
    inlined from ‘api’ at api.c:5061:8:
/usr/include/arm-linux-gnueabihf/bits/socket2.h:40:12: warning: call to ‘__recv_chk_warn’ declared with attribute warning: recv called with bigger length than size of destination buffer [-Wattribute-warning]
   40 |     return __recv_chk_warn (__fd, __buf, __n, sz, __flags);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       cgminer-logging.o
  CC       cgminer-klist.o
  CC       cgminer-noncedup.o
  CC       cgminer-usbutils.o
  CC       cgminer-crc16.o
  CC       cgminer-driver-icarus.o
  CC       cgminer-driver-gekko.o
  CCLD     cgminer
/usr/bin/ld: cgminer-api.o: in function `mcast':
api.c:(.text+0x822): undefined reference to `__glibc_safe_or_unknown_len'
/usr/bin/ld: api.c:(.text+0x838): undefined reference to `__glibc_unsafe_len'
/usr/bin/ld: cgminer-api.o: in function `api':
api.c:(.text+0x757c): undefined reference to `__glibc_safe_or_unknown_len'
/usr/bin/ld: api.c:(.text+0x7592): undefined reference to `__glibc_unsafe_len'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:907: cgminer] Error 1
make[2]: Leaving directory '/home/pi/cgminer'
make[1]: *** [Makefile:1896: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/cgminer'
make: *** [Makefile:810: all] Error 2
pi@bananapim2zero:~/cgminer$

I also checked and I don't have any previous version to remove. It's a clean box...
BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2955


Block halving is coming.


View Profile WWW
December 05, 2023, 12:29:36 AM
 #4

Hello BitMaxz,

I tried with your commands, but unfortunately it's still the same:
~snip~

I also checked and I don't have any previous version to remove. It's a clean box...

Ok I found a similar issue and it seems he solved the issue but the device is undetectable.

Can you try the command provided by IDontModLobbies from the link below?
- https://github.com/luke-jr/bfgminer/issues/816#issuecomment-1098654521

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
toto99303 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 06, 2023, 12:39:00 AM
 #5

I tried it, same problem Sad

Code:
In function ‘recv’,
    inlined from ‘api’ at api.c:5061:8:
/usr/include/arm-linux-gnueabihf/bits/socket2.h:40:12: warning: call to ‘__recv_chk_warn’ declared with attribute warning: recv called with bigger length than size of destination buffer [-Wattribute-warning]
   40 |     return __recv_chk_warn (__fd, __buf, __n, sz, __flags);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       cgminer-logging.o
  CC       cgminer-klist.o
  CC       cgminer-noncedup.o
  CC       cgminer-usbutils.o
  CC       cgminer-driver-blockerupter.o
  CCLD     cgminer
/usr/bin/ld: cgminer-api.o: in function `mcast':
api.c:(.text+0x822): undefined reference to `__glibc_safe_or_unknown_len'
/usr/bin/ld: api.c:(.text+0x838): undefined reference to `__glibc_unsafe_len'
/usr/bin/ld: cgminer-api.o: in function `api':
api.c:(.text+0x757c): undefined reference to `__glibc_safe_or_unknown_len'
/usr/bin/ld: api.c:(.text+0x7592): undefined reference to `__glibc_unsafe_len'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:907: cgminer] Error 1
make[2]: Leaving directory '/home/pi/cgminer'
make[1]: *** [Makefile:1896: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/cgminer'
make: *** [Makefile:810: all] Error 2
pi@bananapim2zero:~/cgminer$
paid2
Hero Member
*****
Offline Offline

Activity: 686
Merit: 2050


Crypto Swap Exchange


View Profile WWW
December 06, 2023, 12:50:53 AM
 #6

Did you tried with fcommon?

Code:
-fcommon


...

/usr/bin/ld: cgminer-driver-gekko.o:(.bss+0xd48): multiple definition of `modminer_drv'; cgminer-cgminer.o:(.bss+0x2078): first defined here
/usr/bin/ld: cgminer-driver-gekko.o:(.bss+0xdd0): multiple definition of `bitforce_drv'; cgminer-cgminer.o:(.bss+0x1ff0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:893: cgminer] Fehler 1
make[2]: Verzeichnis „/home/pi/mining/newpac/cgminer“ wird verlassen
make[1]: *** [Makefile:1837: all-recursive] ERROR 1
make[1]: Verzeichnis „/home/pi/mining/newpac/cgminer“ wird verlassen
make: *** [Makefile:796: all] ERROR 2

STILL THE SAME ERROR...



My updated version includes a README build comment that may fix this...

-fcommon

https://github.com/kanoi/cgminer/blob/master/README#L153

Alas you are compiling someone else's version, so no idea if that is the fix.
I had to 'fix' a large number of compile warnings and a few errors when I pulled the code into the master cgminer

Read here for 4.12.0:
https://bitcointalk.org/index.php?topic=5355470.msg58200639#msg58200639

-j has no effect on if it will compile

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
kano
Legendary
*
Offline Offline

Activity: 4480
Merit: 1800


Linux since 1997 RedHat 4


View Profile
December 08, 2023, 02:38:05 AM
Merited by NotFuzzyWarm (2), BitMaxz (1)
 #7

The problem is that the latest RPiOS uses a buggy gcc version.

As tested with gcc 12.3.0 if you use the latest ubuntu (and any version in the last few years) on RPi it works fine.

Someone has already come to my pool #gekko channel with this error and verified that even the earlier versions
of the RPiOS compile OK also.

The error is clearly false.
If you check further up in your error output you will see that it is a bug in gcc, since it effectively claims

(TMPBUFSIZ / 2 - 1) is greater than TMPBUFSIZ
(which is obviously not correct)

api.c:5061 is:
Code:
n = recv(c, &buf[0], TMPBUFSIZ / 2 - 1, 0);

However buf defined above that is:
Code:
char buf[TMPBUFSIZ];

So I can only guess there are rather blatant bugs in the version of gcc on the RPiOS
since obviously (TMPBUFSIZ / 2 - 1) is NOT greater than TMPBUFSIZ

Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
Nexus9090
Member
**
Offline Offline

Activity: 75
Merit: 44

Beam me up Scotty


View Profile
April 25, 2024, 05:01:46 PM
 #8

The problem is that the latest RPiOS uses a buggy gcc version.

As tested with gcc 12.3.0 if you use the latest ubuntu (and any version in the last few years) on RPi it works fine.

Someone has already come to my pool #gekko channel with this error and verified that even the earlier versions
of the RPiOS compile OK also.

The error is clearly false.
If you check further up in your error output you will see that it is a bug in gcc, since it effectively claims

(TMPBUFSIZ / 2 - 1) is greater than TMPBUFSIZ
(which is obviously not correct)

api.c:5061 is:
Code:
n = recv(c, &buf[0], TMPBUFSIZ / 2 - 1, 0);

However buf defined above that is:
Code:
char buf[TMPBUFSIZ];

So I can only guess there are rather blatant bugs in the version of gcc on the RPiOS
since obviously (TMPBUFSIZ / 2 - 1) is NOT greater than TMPBUFSIZ

Thanks for the info Kano,

I'd tried this on a Raspberry PI 5 a few times and ran into the same issues. I even tried downgrading GCC to 11 but that appears to have the same problem. There's no package for the PI5 distro for earlier versions of GCC than 11.

I've succesfully built CGMiner using GCC 10.2.1 on the PI3B and PI-Zero-2W and that is my main driver for my set-ups. While I can get the executable running on the PI5 it'd be nice to be able to build it there too.

I'm wondering if I can build GCC 10 from source, but thats giving me a headache just thinking about it.

Anyway, thanks for your help on this topic.






Donations greatfully received : 3MbtxahpbkC1fGhvcWR7Ja38u8cwN9wzY8
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!