BitShares Forum

Other => Graveyard => BitShares PTS => Topic started by: rhk on November 11, 2013, 02:42:46 pm

Title: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: rhk on November 11, 2013, 02:42:46 pm
Any ideas how to fix?

g++ -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/home/slicify/coin/ProtoShares-psforkinit/src -I/home/slicify/coin/ProtoShares-psforkinit/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 -I/home/slicify/coin/ProtoShares-psforkinit/src/leveldb/include -I/home/slicify/coin/ProtoShares-psforkinit/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -o bitcoind leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o -Wl,-z,relro -Wl,-z,now   -Wl,-Bdynamic -l boost_system -l boost_filesystem -l boost_program_optons -l boost_thread -l db_cxx -l ssl -l crypto -l miniupnpc -Wl,-Bdynamic -l z -l dl -l pthread /home/slicify/coin/ProtoShares-psforkinit/src/leveldb/libleveldb.a /home/slicify/coin/ProtoShares-psforkinit/src/leveldb/libmemenv.a

obj/main.o: In function `CBlockHeader::GetHash() const':
/home/slicify/coin/ProtoShares-psforkinit/src/main.cpp:1335: undefined reference to `bts::momentum_verify(uint256, unsigned int, unsigned int)'

obj/main.o: In function `CBlockHeader::CalculateBestBirthdayHash(int&)':
/home/slicify/coin/ProtoShares-psforkinit/src/main.cpp:1345: undefined reference to `bts::momentum_search(uint256)'

collect2: ld returned 1 exit status
make: *** [bitcoind] Error 1

thanks
Steve
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: cryptrol on November 11, 2013, 03:06:15 pm
Having the same problem here.
Although it seems that the ones that can compile it, found it is not stable so ...
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: ryen123 on November 11, 2013, 04:04:10 pm
Yup you are not alone. I managed to compile in ubuntu but crashed after running for a few minutes. Then tried compiling again on another os but get errors.
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: gigawatt on November 11, 2013, 04:40:06 pm
Check the "src" folder.  Are the "momentum.cpp" and "momentum.h" files there?

You might want to delete the whole directory and pull it from git again.  I ran into a few issues of git not fetching the files correctly.
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: xeroc on November 11, 2013, 05:51:27 pm
I crevertwd the last two commits in git.. keeping fork ... and then it compiled

Gesendet von meinem GT-P1000 mit Tapatalk

Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: victor on November 11, 2013, 07:51:10 pm
My patch should fix this issue:

Code: [Select]
--- ProtoShares/src/makefile.unix       2013-11-11 11:46:13.019922787 -0800
+++ ProtoShares-new/src/makefile.unix   2013-11-11 11:47:52.255921671 -0800
@@ -141,7 +141,8 @@
     obj/bloom.o \
     obj/noui.o \
     obj/leveldb.o \
-    obj/txdb.o
+    obj/txdb.o \
+    obj/momentum.o
 
 
 all: bitcoind



save the code above as makefile.patch and patch -p0 < makefile.patch, you should be able to compile it again 8)
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: gigawatt on November 11, 2013, 08:58:32 pm
My patch should fix this issue:

Code: [Select]
--- ProtoShares/src/makefile.unix       2013-11-11 11:46:13.019922787 -0800
+++ ProtoShares-new/src/makefile.unix   2013-11-11 11:47:52.255921671 -0800
@@ -141,7 +141,8 @@
     obj/bloom.o \
     obj/noui.o \
     obj/leveldb.o \
-    obj/txdb.o
+    obj/txdb.o \
+    obj/momentum.o
 
 
 all: bitcoind



save the code above as makefile.patch and patch -p0 < makefile.patch, you should be able to compile it again 8)

That's weird.  I wonder why "momentum.o" wasn't include in the makefile to begin with?  The makefile shows the last edit date was 7 months ago, so it must have been like that from the beginning.

How the hell did mine compile?
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: comal on November 11, 2013, 09:31:28 pm
hey,

thanks a lot, it did compile and is running now :)

cheers
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: victor on November 11, 2013, 09:59:55 pm

That's weird.  I wonder why "momentum.o" wasn't include in the makefile to begin with?  The makefile shows the last edit date was 7 months ago, so it must have been like that from the beginning.

How the hell did mine compile?

Previously, there is a "#include "momentum.cpp"" line at the beginning of main.cpp, but it was removed in a recent commit. If we include momentum.cpp, functions like momentum_search will be compiled into main.o, and thus we don't need to look for it at the final linking. Otherwise we must compile momentum.cpp into an individual object file.
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: skaffen on November 11, 2013, 10:06:52 pm
Thanks, that worked.  Maybe make a pull request for the fix on github?
Title: Re: Ubuntu build problem - undefined reference to bts::momentum_*
Post by: comal on November 12, 2013, 07:16:55 am
just report, client did not crash solo mining, my hash rate almost doubled :)
well but i didnt find a block.