Bitcoin Forum
December 11, 2016, 11:59:09 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Totally static compilation of jgarzic's CPU miner.  (Read 2594 times)
Joe Juneau
Newbie
*
Offline Offline

Activity: 3


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"?
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481457549
Hero Member
*
Offline Offline

Posts: 1481457549

View Profile Personal Message (Offline)

Ignore
1481457549
Reply with quote  #2

1481457549
Report to moderator
1481457549
Hero Member
*
Offline Offline

Posts: 1481457549

View Profile Personal Message (Offline)

Ignore
1481457549
Reply with quote  #2

1481457549
Report to moderator
BeeCee1
Member
**
Offline Offline

Activity: 116


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
Newbie
*
Offline Offline

Activity: 3


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
Newbie
*
Offline Offline

Activity: 3


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

up  Tongue
gpa
Newbie
*
Offline Offline

Activity: 4


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 :-)

1DN56T4xWHXLa6pJFraoSCgaiHYfHV6B1D
gpa
Newbie
*
Offline Offline

Activity: 4


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`

1DN56T4xWHXLa6pJFraoSCgaiHYfHV6B1D
anonymous_acc
Sr. Member
****
Offline Offline

Activity: 322



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: 1050


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



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: 1050


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...
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!