Bitcoin Forum
September 28, 2016, 01:40:57 PM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Compiling under Linux (0.3.6) - Older Glibc 2.9 version  (Read 4687 times)
knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


View Profile WWW
July 30, 2010, 05:39:33 AM
 #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

1475070057
Hero Member
*
Offline Offline

Posts: 1475070057

View Profile Personal Message (Offline)

Ignore
1475070057
Reply with quote  #2

1475070057
Report to moderator
1475070057
Hero Member
*
Offline Offline

Posts: 1475070057

View Profile Personal Message (Offline)

Ignore
1475070057
Reply with quote  #2

1475070057
Report to moderator
1475070057
Hero Member
*
Offline Offline

Posts: 1475070057

View Profile Personal Message (Offline)

Ignore
1475070057
Reply with quote  #2

1475070057
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1475070057
Hero Member
*
Offline Offline

Posts: 1475070057

View Profile Personal Message (Offline)

Ignore
1475070057
Reply with quote  #2

1475070057
Report to moderator
1475070057
Hero Member
*
Offline Offline

Posts: 1475070057

View Profile Personal Message (Offline)

Ignore
1475070057
Reply with quote  #2

1475070057
Report to moderator
teknohog
Sr. Member
****
Offline Offline

Activity: 410


minor developer


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.

knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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.

knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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

jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


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, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


View Profile WWW
July 30, 2010, 03:51:01 PM
 #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.

knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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?

imnichol
Jr. Member
*
Offline Offline

Activity: 38


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.

1CkFCGSsFSS1VJXNeyHoNoXrYWu2yiFeM
knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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

imnichol
Jr. Member
*
Offline Offline

Activity: 38


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.

1CkFCGSsFSS1VJXNeyHoNoXrYWu2yiFeM
knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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

imnichol
Jr. Member
*
Offline Offline

Activity: 38


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!

1CkFCGSsFSS1VJXNeyHoNoXrYWu2yiFeM
knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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.

knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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

knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


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.

knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


View Profile WWW
July 30, 2010, 08:11:39 PM
 #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.

imnichol
Jr. Member
*
Offline Offline

Activity: 38


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

Now if we can get a repository set up, everything will be awesome.

1CkFCGSsFSS1VJXNeyHoNoXrYWu2yiFeM
molecular
Donator
Legendary
*
Offline Offline

Activity: 2058



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:  

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!