dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

Dash Core does not build on Amazon AMI: libdb_cxx headers missing, Dash Core requires this library for wallet functionality #1442

Closed sorin-postelnicu closed 7 years ago

sorin-postelnicu commented 7 years ago

Hello guys, I am trying to build Dash Core master (commit 86525601d5915f380976c9d2e686ad7f66db991f) on Amazon AMI (based on CentOS), but I get this error:

configure: error: libdb_cxx headers missing, Dash Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)

Note that I have already installed all development tools: sudo yum groupinstall "Development Tools"

I see that db4 is actually installed and the headers are available in /usr/include/db4 , but for some reason the configure script does not search there. (I've had a very quick look inside configure.ac and I see that it is searching inside /opt/local/include/db48 but just for Mac/Brew)

Is CentOS/AWS not a supported build platform for DashCore?

sorin-postelnicu commented 7 years ago

Actually I get a similar error on AWS with Ubuntu 16.04 image. It seems I need to manually compile Berkeley DB 4.8 from source, as shown in this post: http://bitzuma.com/posts/compile-bitcoin-core-from-source-on-ubuntu/

But I find this is not ok that a simple clean build does not work by default. This dependency should be documented in https://github.com/dashpay/dash/blob/master/INSTALL

Also now I get another error, which I could not yet fix: configure: error: pkg-config not found.

sorin-postelnicu commented 7 years ago

Here is the list of commands that I executed on a fresh Ubuntu 16.04 image on AWS:

sudo apt update sudo apt install -y git build-essential wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz tar -xvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix/ mkdir -p build BDB_PREFIX=$(pwd)/build ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX make install cd ../.. sudo apt-get install -y autoconf libtool pkg-config libqt4-dev sudo apt-get install -y libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqrencode-dev git clone https://github.com/dashpay/dash.git cd dash/ ./autogen.sh ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --with-gui

And this is the new error that I get now:

checking whether to build Dash Core GUI... yes (Qt) checking for boostlib >= 1.20.0... yes checking whether the Boost::System library is available... yes checking for exit in -lboost_system... yes checking whether the Boost::Filesystem library is available... yes checking for exit in -lboost_filesystem... yes checking whether the Boost::Program_Options library is available... yes checking for exit in -lboost_program_options... yes checking whether the Boost::Thread library is available... yes checking for exit in -lboost_thread... yes checking whether the Boost::Chrono library is available... yes checking for exit in -lboost_chrono... yes checking whether the Boost::Unit_Test_Framework library is available... yes checking for dynamic linked boost test... yes configure: error: pkg-config not found.

tgflynn commented 7 years ago

Dash definitely builds on Ubuntu 16.04 if you first install all the dependencies that are listed in doc/build-unix.md.

Note especially these dependencies:

`

sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install libdb4.8-dev libdb4.8++-dev

`

sorin-postelnicu commented 7 years ago

You're right, on Ubuntu it works with these commands:

sudo apt update sudo apt install -y build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils sudo apt install -y libboost-all-dev sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt update sudo apt install -y libdb4.8-dev libdb4.8++-dev sudo apt install -y libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler sudo apt install -y libqrencode-dev git clone https://github.com/dashpay/dash.git cd dash/ ./autogen.sh ./configure --with-gui make sudo make install

sorin-postelnicu commented 7 years ago

I managed to also build it on Amazon Linux AMI (based on CentOS), but without the GUI, by running these commands:

sudo yum update sudo yum groupinstall -y "Development Tools"

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz tar -xvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix/ mkdir -p build BDB_PREFIX=$(pwd)/build ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX make make install cd ../..

sudo yum install -y boost-devel openssl-devel libevent-devel git clone https://github.com/dashpay/dash.git cd dash/ ./autogen.sh ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --without-gui make sudo make install

nmarley commented 7 years ago

@sorin-postelnicu Glad it's working for you now.

Since it's working, can this issue be closed?

sorin-postelnicu commented 7 years ago

Dear Nathan, I suppose that it can be closed. Nevertheless, it would be good if the main INSTALL readme file would contain a reference to the doc/build-unix.md which you mentioned, otherwise any newcomer is confused why the INSTALL file says that it can be built with just 3 commands, when in reality it can only be built after manually installing a lot of dependencies which do not come by default with the Linux distributions. I think I will create a pull request with some clarifications for the newcomers.