Bitcoin Forum
June 19, 2024, 06:34:25 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to compile static version bitcoind?  (Read 2033 times)
kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 04, 2016, 07:35:32 PM
Merited by ABCbits (4)
 #1

Hi

i complied a bitcoind in Ubuntu Dektop 64bit

Code:
./configure
make
make install
completed and works well in Ubuntu

i moved this bitcoind into a Centos 64bit 6.5, ran it and some errors came out

Code:
./bitcoind: error while loading shared libraries: libboost_system.so.1.58.0: cannot open shared object file: No such file or directory

i think all *.so lib required need to be compiled together with the bitcoind binnary, but how? i tried

Code:
./configure --disable-shared
make clean
make
sudo make install
completed but still doesn't work in Centos, same error

and tried

Code:
./configure 
make clean
make STATIC=all
sudo make install
completed but still doesn't work in Centos, same error

the bitcoind in https://bitcoin.org/bin/bitcoin-core-0.13.0/bitcoin-0.13.0-x86_64-linux-gnu.tar.gz however works well in both Centos and Ubuntu

OpenTrade - Open Source Cryptocurrency Exchange
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
October 04, 2016, 07:53:41 PM
 #2

You should use the depends system and compile the libs. Then you can build with those and it would work.

kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 04, 2016, 08:02:24 PM
 #3

You should use the depends system and compile the libs. Then you can build with those and it would work.

This is all my steps:
Code:
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install libqrencode-dev
sudo apt-get update
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
wget https://github.com/bitcoin/bitcoin/archive/v0.13.0.tar.gz
tar -xvzf v0.13.0.tar.gz
cd bitcoin-0.13.0
./autogen.sh
./configure
make
sudo make install

exactly what I need to do more?

OpenTrade - Open Source Cryptocurrency Exchange
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
October 04, 2016, 08:16:25 PM
 #4

Do exactly this from the Bitcoin source dir.

Code:
cd depends
make
cd ..
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
make

The binaries produced should work across platforms.

kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 05, 2016, 02:01:35 PM
 #5

Do exactly this from the Bitcoin source dir.

Code:
cd depends
make
cd ..
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
make

The binaries produced should work across platforms.

I tried but I got such errors in CentOS

Code:
./bitcoind: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./bitcoind)
./bitcoind: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./bitcoind)
./bitcoind: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./bitcoind)
./bitcoind: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./bitcoind)
./bitcoind: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./bitcoind)
./bitcoind: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./bitcoind)

OpenTrade - Open Source Cryptocurrency Exchange
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
October 05, 2016, 03:48:50 PM
 #6

Try this configure command instead
Code:
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"

kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 06, 2016, 07:58:35 AM
 #7

Try this configure command instead
Code:
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"

I tried. Were such errors

Code:
./bitcoind: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./bitcoind)
./bitcoind: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./bitcoind)

OpenTrade - Open Source Cryptocurrency Exchange
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
October 06, 2016, 12:30:55 PM
Merited by ABCbits (2)
 #8

Ok.. How about this command?
Code:
./configure --enable-glibc-back-compat --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"

kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 06, 2016, 01:08:02 PM
 #9

Ok.. How about this command?
Code:
./configure --enable-glibc-back-compat --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"

It works!!!
Thank you very much!!!  Smiley

OpenTrade - Open Source Cryptocurrency Exchange
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!