Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: weex on June 14, 2015, 06:03:05 AM



Title: [solved] Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: weex on June 14, 2015, 06:03:05 AM
I got https://github.com/gavinandresen/bitcoin_miningsim and then apt-got libboost-dev. I changed the makefile to use g++ and this is what I get.

Code:
$ make
g++ -std=c++11 -I/usr/local/include -L/usr/local/lib -O2 -o mining_simulator main.cpp scheduler.cpp -lboost_program_options-mt -lboost_system-mt -lboost_thread-mt -lboost_chrono-mt
/usr/bin/ld: cannot find -lboost_program_options-mt
/usr/bin/ld: cannot find -lboost_system-mt
/usr/bin/ld: cannot find -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_chrono-mt
collect2: error: ld returned 1 exit status
make: *** [scheduler] Error 1

Where do I go from here?


Title: Re: Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: weex on June 14, 2015, 07:18:29 AM
It was simple enough. -mt isn't needed on any of these so after dropping that it compiled fine.


Title: Re: Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: tspacepilot on June 17, 2015, 08:16:13 AM
It was simple enough. -mt isn't needed on any of these so after dropping that it compiled fine.

Was the "mt' already in the Makefile that you downloaded with the project or was that something that you added?

A tip I just learned when getting ld missing errors is that you can run:

$ ldd -v name_of_library

to see what paths are being searched.  This was helpful for me in compiling a recent application on a system where I had no root rights and had to have all these headers and shared libraries in my userspace.


Title: Re: [solved] Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: weex on June 17, 2015, 09:21:32 AM
The -mt was already in the makefile from Gavin's github repo.


Title: Re: [solved] Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: tspacepilot on June 17, 2015, 03:06:39 PM
The -mt was already in the makefile from Gavin's github repo.

That's very strange, right?  It would seem to mean that Gavin's repo's Makefile is broken, or that he's using a different distribution than you.  But Ubuntu uses the same package names as debian, which I think is pretty standard.  Oftentimes, Makefiles get generated by ./configure or ./autoconf.sh.  Did you run ./configure or ./autoconf after installing libboost?


Title: Re: [solved] Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: weex on June 17, 2015, 05:19:19 PM
The -mt was already in the makefile from Gavin's github repo.

That's very strange, right?  It would seem to mean that Gavin's repo's Makefile is broken, or that he's using a different distribution than you.  But Ubuntu uses the same package names as debian, which I think is pretty standard.  Oftentimes, Makefiles get generated by ./configure or ./autoconf.sh.  Did you run ./configure or ./autoconf after installing libboost?

In the repo, he said "I don't do autotools" and that he was using OS X. The project is pretty minimal so I don't expect lots of handholding in making it easy to run. It turned out not too be that hard.

I find C++ with templating and boost pretty cumbersome to read and I may do a sim in python just so it's easier to explore some of the details. Overall I think his is pretty decent...perhaps being able to explore less reliability in network links, getting into some sort of mempool and fee modeling with some miners making smaller blocks, would be enough incentive to get started on a sim.


Title: Re: [solved] Need help compiling Gavin's bitcoin-miningsim on Ubuntu
Post by: tspacepilot on June 17, 2015, 05:41:17 PM
The -mt was already in the makefile from Gavin's github repo.

That's very strange, right?  It would seem to mean that Gavin's repo's Makefile is broken, or that he's using a different distribution than you.  But Ubuntu uses the same package names as debian, which I think is pretty standard.  Oftentimes, Makefiles get generated by ./configure or ./autoconf.sh.  Did you run ./configure or ./autoconf after installing libboost?

In the repo, he said "I don't do autotools" and that he was using OS X. The project is pretty minimal so I don't expect lots of handholding in making it easy to run. It turned out not too be that hard.

I find C++ with templating and boost pretty cumbersome to read and I may do a sim in python just so it's easier to explore some of the details. Overall I think his is pretty decent...perhaps being able to explore less reliability in network links, getting into some sort of mempool and fee modeling with some miners making smaller blocks, would be enough incentive to get started on a sim.

Cool, using OSX explains the difference in package names.  For some reason, I had just assumed that all of the C++ code from the "serious" developers would be targeting GNU/Linux.  'scuse me.  --TSP