Bitcoin Forum
November 06, 2024, 12:43:09 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Compiling under Linux (0.3.6) - Older Glibc 2.9 version  (Read 11717 times)
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 05:39:33 AM
Last edit: July 30, 2010, 08:11:56 PM by knightmb
 #1

I know I've seen this topic a half-dozen times (can't compile), but after spending hours hunting down source and compiling every piece of software listed in the build-unix.txt, correcting path errors in the build files, etc.  I still can't get the program compiled on my Mandriva 2010.0 box, LOL.

The error it hangs at is:
Code:
/usr/bin/ld: cannot find -lboost_system
collect2: ld returned 1 exit status
make: *** [bitcoin] Error 1

The program is there, but I'm not familiar enough with how the boost software works to fix the error. If anyone has any feedback or ideas it would be greatly appreciated. I would like to catch up with everyone else on the Linux client front, but I won't be able to use the new version until the next release that supports Linux builds not using bleeding edge software  Grin

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
teknohog
Sr. Member
****
Offline Offline

Activity: 520
Merit: 253


555


View Profile WWW
July 30, 2010, 10:47:41 AM
 #2

The error it hangs at is:
Code:
/usr/bin/ld: cannot find -lboost_system
collect2: ld returned 1 exit status
make: *** [bitcoin] Error 1

Try changing the link options (LIBS=... variable) from static to dynamic. This has solved the problem for me. It seems that some packages in Gentoo require extra options to enable static linking, and I have not enabled them as I do not need them otherwise.

On the other hand, static linking of some libraries is a good thing for wider distribution of the binaries, so it makes sense in bitcoin by default.

world famous math art | masternodes are bad, mmmkay?
Every sha(sha(sha(sha()))), every ho-o-o-old, still shines
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 02:14:35 PM
 #3

That seems to solved the problem, but now it hangs on the wxWidgets 2.9 with a screen full of "undefined reference" errors in the for the displayx11.cpp files.  Cry

I think I might have an easier time compiling on the same Distro that he uses in a virtual box rather than have hunting down all these errors.

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 03:13:47 PM
 #4

I'm going to take the easier route, found a virtual box of Ubuntu 9.04, so I'm going to fire one up, go through the instructions again and see if I can compile a version that isn't using the latest glibc library for those of us on old distros  Grin

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1100


View Profile
July 30, 2010, 03:39:20 PM
 #5

I know I've seen this topic a half-dozen times (can't compile), but after spending hours hunting down source and compiling every piece of software listed in the build-unix.txt, correcting path errors in the build files, etc.  I still can't get the program compiled, LOL.

The error it hangs at is:
Code:
/usr/bin/ld: cannot find -lboost_system
collect2: ld returned 1 exit status
make: *** [bitcoin] Error 1

A bit tough to elaborate on, since I don't see your Linux OS version.

For some OS's, like Fedora here, you need to link with the multi-threaded boost libs instead.  This implies adding a "-mt" suffix, eg. -lboost_system-mt rather than -lboost_system, for example.

Here is the complete, makefile-free, working solution I use to build bitcoind on Fedora:
Code:
g++ -O3 -ffast-math -march=native -Wno-invalid-offsetof -Wformat -pthread \
-I"/usr/local/openssl-0.9.8/include" \
-o bitcoind \
rpc.cpp main.cpp util.cpp script.cpp db.cpp net.cpp irc.cpp \
init.cpp cryptopp/sha.cpp cryptopp/cpu.cpp \
-L"/usr/local/openssl-0.9.8/lib" \
-l boost_system-mt -l boost_filesystem-mt -l boost_program_options-mt \
-l boost_thread-mt -l db_cxx -l crypto -l gthread-2.0

(openssl 0.9.8 is installed in /usr/local/openssl-0.9.8, everything else is a system lib)

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 03:51:01 PM
Last edit: July 30, 2010, 05:40:51 PM by knightmb
 #6

Thanks for the help, I did finally get past those errors, got hung up on the wxWidgets even though it's installed exactly as the instructions showed, I don't know enough about wxWidgets to troubleshoot the error.

But I'm building a Ubuntu box on the same setup (well older version) of what the program is being compiled on for release here in hopes it will speed things up for testing rather than troubleshooting different distro builds.

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 05:39:37 PM
 #7

I've built a Ubuntu 9.04 box and the irony is, when it finally came time to compile, I get the same errors I got on my Mandriva box.

So I'm stuck at the wxWidgets again. I guess I'm not understanding what my wxWidgets issue is. I've downloaded the 2.9 source directly from the website, compiled and installed without any errors. When it comes time to compile bitcoin, it just throws up a ton of wxWidget errors, too long to really paste here.

Has anyone done a successful build of Bitcoin in Linux, if so I'm curious to which Distro you were using?

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
imnichol
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
July 30, 2010, 06:02:57 PM
 #8

I've built a Ubuntu 9.04 box and the irony is, when it finally came time to compile, I get the same errors I got on my Mandriva box.

So I'm stuck at the wxWidgets again. I guess I'm not understanding what my wxWidgets issue is. I've downloaded the 2.9 source directly from the website, compiled and installed without any errors. When it comes time to compile bitcoin, it just throws up a ton of wxWidget errors, too long to really paste here.

Has anyone done a successful build of Bitcoin in Linux, if so I'm curious to which Distro you were using?

Have you read the directions in `path-to-bitcoin-folder`/src/build-unix.txt?
It contains information about how to compile wx 2.9 that you need to follow.  Apologies if you already know this.
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 06:12:48 PM
 #9

I've built a Ubuntu 9.04 box and the irony is, when it finally came time to compile, I get the same errors I got on my Mandriva box.

So I'm stuck at the wxWidgets again. I guess I'm not understanding what my wxWidgets issue is. I've downloaded the 2.9 source directly from the website, compiled and installed without any errors. When it comes time to compile bitcoin, it just throws up a ton of wxWidget errors, too long to really paste here.

Has anyone done a successful build of Bitcoin in Linux, if so I'm curious to which Distro you were using?

Have you read the directions in `path-to-bitcoin-folder`/src/build-unix.txt?
It contains information about how to compile wx 2.9 that you need to follow.  Apologies if you already know this.
Yeah, I'm following those to the letter, but I think that's my issue is, there might be a step missing because when compiling bitcoin, the errors point towards something else missing in the wx2.9 stuff (maybe an additional step) necessary. I think I'm close to figuring it out, if I do, I'll be sure to post it and hopefully have the text updated for future people to avoid any frustration  Grin

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
imnichol
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
July 30, 2010, 06:38:39 PM
 #10

Yeah, I'm following those to the letter, but I think that's my issue is, there might be a step missing because when compiling bitcoin, the errors point towards something else missing in the wx2.9 stuff (maybe an additional step) necessary. I think I'm close to figuring it out, if I do, I'll be sure to post it and hopefully have the text updated for future people to avoid any frustration  Grin
You downloaded all the dependencies too?  I know I had a bunch of problems until I did that.  Good luck, I've done it myself so it's definitely possible.
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 06:55:55 PM
 #11

As far as I know, but I finally got past the wxWidgets problem (typo in a command while installing, grrr)

I've finally landed at the libboost-dev-all package to install, but it's not found in the Ubuntu repository for some reason? I guess I'll just install anything/everything that has to do with boost-dev   Grin

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
imnichol
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
July 30, 2010, 07:01:56 PM
 #12

As far as I know, but I finally got past the wxWidgets problem (typo in a command while installing, grrr)

I've finally landed at the libboost-dev-all package to install, but it's not found in the Ubuntu repository for some reason? I guess I'll just install anything/everything that has to do with boost-dev  Grin

That's what I did and it seemed to work.  Cheers!
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 07:06:46 PM
 #13

That's what I'm hoping for as well, between compiling from the website then downloading another hundred megabytes worth of files anyway, hehe.

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 07:17:38 PM
 #14

As far as I know, but I finally got past the wxWidgets problem (typo in a command while installing, grrr)

I've finally landed at the libboost-dev-all package to install, but it's not found in the Ubuntu repository for some reason? I guess I'll just install anything/everything that has to do with boost-dev  Grin

That's what I did and it seemed to work.  Cheers!
Is there a blanket command with apt-get to install everything that has to do with libboost without it error out on package conflicts? I tried to cheat with a "apt-get install libboost*" but it just complains that it's not possible due to conflicts (which I understand since I can't install 2 versions of the same thing at the same time).

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 07:33:43 PM
 #15

Victory at last, finally installed enough files to compile, LOL.

But then, I just noticed a 32bit build on Ubuntu 9.04 was just put up, haha.

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
knightmb (OP)
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
July 30, 2010, 08:11:39 PM
Last edit: August 02, 2010, 03:28:11 PM by knightmb
 #16

I have a 64bit compile of the linux client bitcoin up here that I just finished. All the debug symbols are stripped as well so the file isn't 60+ megabytes in size.
Test at your own risk (like me right now)

64bit Build Only - Client only (bitcoin)
http://knightmb.dyndns.org/files/bitcoin/bitcoin.tar.gz

64bit Build Only - Daemon only (bitcoind)
http://knightmb.dyndns.org/files/bitcoin/bitcoind.tar.gz

Compiled on a Ubuntu 9.04 box with Glibc 2.9 (so those running 2.9, 2.10, 2.11 should work with this)

[edit]New version has come out since then, so those links are valid not anymore.

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
imnichol
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
August 02, 2010, 03:20:58 PM
 #17

Now if we can get a repository set up, everything will be awesome.
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
March 16, 2011, 04:56:11 PM
 #18

Try changing the link options (LIBS=... variable) from static to dynamic. This has solved the problem for me. It seems that some packages in Gentoo require extra options to enable static linking, and I have not enabled them as I do not need them otherwise.

Thanks! That did the trick for me (gentoo).

Likely could've also put "dev-libs/boost static-libs" in /usr/portage/package.use and reemerged boost.

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
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!