Bitcoin Forum
April 25, 2024, 10:28:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Totally static compilation of jgarzic's CPU miner.  (Read 3303 times)
Joe Juneau (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 18, 2011, 01:26:34 AM
 #1

Hi there  Cheesy

I've spent hours (days, actually) on something where I still get stuck: I cann't compile this as fully static binary.

Here is how I do it:
- Got a
Code:
jgarzik-cpuminer-602e31b
directory where I expanded the archive.
- In this directory, I've downloaded source of curl, including libs,
- In curl directory, I've downloaded gnu-tls source, including libs.

Then I do:
Code:
remi@puddipuddi:~/Logiciels/jgarzik-cpuminer-602e31b/curl-7.21.0/gnutls26-2.8.6$ ./configure LDFLAGS=-static
I go into gnutls26-2.8.6/lib and give it a make:
Code:
gnutls26-2.8.6/lib$ make
Then back to curl, and I configure again:
Code:
remi@puddipuddi:~/Logiciels/jgarzik-cpuminer-602e31b/curl-7.21.0$./configure LDFLAGS=-static --disable-shared --with-gnutls LDFLAGS=-L/home/remiLogiciels/jgarzik-cpuminer-602e31b/gnutls26-2.8.6/lib
Then I make my lib curl:
Code:
curl-7.21.0/lib$ make
Then I autogen, and I configure the miner:
Code:
remi@puddipuddi:~/Logiciels/jgarzik-cpuminer-602e31b$ ./autogen
remi@puddipuddi:~/Logiciels/jgarzik-cpuminer-602e31b$ ./configure LDFLAGS=-static LDFLAGS=-L/home/remi/Logiciels/jgarzik-cpuminer-602e31b/curl-7.21.0/gnutls26-2.8.6/lib LDFLAGS=-L/home/remi/Logiciels/jgarzik-cpuminer-602e31b/curl-7.21.0/lib

Then I make it, and I get a "minerd" binary.

When I try this binary on another x86 system, this is what I get  Embarrassed
Code:
./minerd: error while loading shared libraries: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory

How can I statically compile the cpu miner so that I could use "anywhere"?
1714040915
Hero Member
*
Offline Offline

Posts: 1714040915

View Profile Personal Message (Offline)

Ignore
1714040915
Reply with quote  #2

1714040915
Report to moderator
1714040915
Hero Member
*
Offline Offline

Posts: 1714040915

View Profile Personal Message (Offline)

Ignore
1714040915
Reply with quote  #2

1714040915
Report to moderator
1714040915
Hero Member
*
Offline Offline

Posts: 1714040915

View Profile Personal Message (Offline)

Ignore
1714040915
Reply with quote  #2

1714040915
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
BeeCee1
Member
**
Offline Offline

Activity: 115
Merit: 10


View Profile
June 18, 2011, 03:08:12 AM
 #2

I've never done this but take a look at: http://www.linuxquestions.org/questions/linux-software-2/gcc-compile-static-and-so-537575/

One of the answers suggests you need .a (archive) versions of the libraries.
Joe Juneau (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 18, 2011, 06:14:14 AM
 #3

I've never done this but take a look at: http://www.linuxquestions.org/questions/linux-software-2/gcc-compile-static-and-so-537575/

One of the answers suggests you need .a (archive) versions of the libraries.
I have already seen this, and yes I do have .a versions of libs.

will do a try on a computer where there are none of the libs installed, with the hope that compilation will stop saying "this is missing"...  Undecided
Joe Juneau (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 18, 2011, 03:43:38 PM
 #4

up  Tongue
gpa
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
June 18, 2011, 09:43:00 PM
 #5

I guess your minerd is not static - I would have at least used CFLAGS=-static somewhere

Anyway, try to take the last compine line and run it manually with gcc -static -Wl, -static to see if it works

I guess it won't because it will try to use the distribution curl (for some reason I don't want to spend time investigating) and mess up with the dependancies. You may want to install it in a path and remove the default one. See http://curl.haxx.se/mail/lib-2006-09/0128.html for a similar suggestion.

But all that is a waste of time. I've prepared a binary for you on :
https://rapidshare.com/files/515355188/minerd.linux.x86_64

Let me know your arch (i386.. ?) and  I will compile another static binary for you if that's not what you need.

Donations welcome :-)
gpa
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
June 18, 2011, 10:26:23 PM
 #6

BTW I forgot - if you want to run it on a machine where you do not know the # of cores :
 -t `cat /proc/cpuinfo|grep processor|wc -l`
anonymous_acc
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile
January 23, 2013, 02:00:47 PM
 #7

Up!

I'm too looking for instruction to make static on x86_64 linux platform

BTC: 1HRcwjxG2H5vSnNo5ZbGqMxRPFWJk6dwW9
Gabi
Legendary
*
Offline Offline

Activity: 1148
Merit: 1008


If you want to walk on water, get out of the boat


View Profile
January 23, 2013, 03:37:36 PM
 #8

There is a reason why the last reply is from June 2011, cpu mining is dead. And gpu mining will die very soon as ASIC arrives

anonymous_acc
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile
January 23, 2013, 03:55:39 PM
 #9

Gabi, you don't believe in chance.

There are still non-zero probability to find block, even on cpu.

BTC: 1HRcwjxG2H5vSnNo5ZbGqMxRPFWJk6dwW9
Gabi
Legendary
*
Offline Offline

Activity: 1148
Merit: 1008


If you want to walk on water, get out of the boat


View Profile
January 23, 2013, 03:57:57 PM
 #10

At least if you win a lottery you win millions of $ but with cpu mining even if in 10 years you find 1 block you have only 25btc...

mangoo
Newbie
*
Offline Offline

Activity: 23
Merit: 0


View Profile
November 24, 2017, 06:31:17 PM
 #11

Here are well written instructions for a static compilation of cpuminer:

https://lxadm.com/Static_compilation_of_cpuminer
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!