Author

Topic: How to compile static version bitcoind? (Read 2040 times)

kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
October 06, 2016, 08:08:02 AM
#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
staff
Activity: 3458
Merit: 6793
Just writing some code
October 06, 2016, 07:30:55 AM
#8
Ok.. How about this command?
Code:
./configure --enable-glibc-back-compat --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
October 06, 2016, 02: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)
staff
Activity: 3458
Merit: 6793
Just writing some code
October 05, 2016, 10:48:50 AM
#6
Try this configure command instead
Code:
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
October 05, 2016, 09:01:35 AM
#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)
staff
Activity: 3458
Merit: 6793
Just writing some code
October 04, 2016, 03: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
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
October 04, 2016, 03: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?
staff
Activity: 3458
Merit: 6793
Just writing some code
October 04, 2016, 02: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
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
October 04, 2016, 02:35:32 PM
#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
Jump to: