Skip to content

Compatibility Info and Build Tips

s-a-m edited this page Aug 7, 2014 · 16 revisions

Please use this page to specify any hints on the compatibility of the Ethereum software base and how you got it to build or what you did while attempting.

Ubuntu

12.04 (Precise) TROUBLESHOOTING

Pretty problematic building/installation, with plenty of issues. Highly recommended to upgrade to the 14.04 (which is also a LTS version).

Basic references & requirements

Here there is a step-by-step guide (although it gives some problems, it's the best available): http://askubuntu.com/questions/414293/how-to-install-ethereum

And here two threads of common problems found with 12.04: http://forum.ethereum.org/discussion/203/how-to-install-ethereum-on-ubuntu-12-04 http://forum.ethereum.org/discussion/comment/905/

And of course use this wiki, both the Building on Ubuntu (checking 13.04 and other versions) and especially this troubleshooting you are reading.

For less experienced users: you may need to know how to look up the version of an installed package and how to install specific versions of packages.

Requirements: you will need gcc-4.7, g++-4.7, libboost1.53-all-dev (apart from libboost1.53-dev), qtbase5-dev. You need PPA repositories for all of them, e.g.:

sudo apt-add-repository ppa:ubuntu-sdk-team/ppa
sudo apt-add-repository ppa:apokluda/boost1.53
sudo apt-get update

For gcc, the referenced http://www.swiftsoftwaregroup.com/upgrade-gcc-4-7-ubuntu-12-04/ is useful but you still may find issues. There is plenty of info googling ubuntu 12.04 gcc 4.7 . Note the following troubleshooting on gcc Cmake problems.

Version conflict with libminiupnpc8 / libminiupnpc-dev

That's a library that has a version conflict (1.6-3ubuntu1 and 1.6-precise2), probably related to previous Bitcoin-related software in the same Ubuntu. sudo aptitude install libminiupnpc-dev should help solving it. Otherwise, apt-cache policy libminiupnpc8 will show the different versions it has available in the repositories. You can either use repository pinning (to change priorities) or remove repositories to force apt-get to install the desired version. Some related info in: http://forum.ethereum.org/discussion/203/how-to-install-ethereum-on-ubuntu-12-04

Cmake Error: gcc / g++ version

While executing cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release, and error such as this may appear (even if you installed gcc-4.7 and g++-4.7):

CMake Error at CMakeLists.txt:104 (message): ethereum requires g++ 4.7 or greater

You can check the default version with g++ --version. You may be able to fix it using update-alternatives. Following http://askubuntu.com/questions/26498/choose-gcc-and-g-version you may do: Remove the alternatives if any, and make sure the 4.7 versions are installed:

sudo update-alternatives --remove-all gcc 
sudo update-alternatives --remove-all gcc 
sudo update-alternatives --remove-all g++
sudo apt-get install gcc-4.7 g++-4.7

Check that there is /usr/bin/gcc-4.6, /usr/bin/gcc-4.7 and /usr/bin/gcc:

ls /usr/bin/gcc*

Include the different alternatives with different priorities:

`sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 10`
`sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20`
`sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 10`
`sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20`
`sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30`
`sudo update-alternatives --set cc /usr/bin/gcc`
`sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30`
`sudo update-alternatives --set c++ /usr/bin/g++`

Check which are now the automatic versions (should be 4.7):

`sudo update-alternatives --config gcc`
`sudo update-alternatives --config g++`

If everything is correct, now clean and try again the cmake that gave you the error, e.g.:

`cmake clean`
`cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release`

Cmake Error: Boost libraries

While executing cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release, the error looks like this:

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1194 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.53.0

  Boost include path: /usr/include

  The following Boost libraries could not be found:

It may complain about boost_thread, boost_date_time, boost_python... doesn't matter which. You should make sure "libboost1.53-all-dev" is correctly installed.

Cmake Error: Qt5Quick

While executing cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release, the error looks like this:

CMake Error at libqethereum/CMakeLists.txt:29 (find_package):
  By not providing "FindQt5Quick.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Quick",
  but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Quick" with any
  of the following names:

    Qt5QuickConfig.cmake
    qt5quick-config.cmake

  Add the installation prefix of "Qt5Quick" to CMAKE_PREFIX_PATH or set
  "Qt5Quick_DIR" to a directory containing one of the above files.  If
  "Qt5Quick" provides a separate development package or SDK, be sure it has
  been installed.

I solved it by installing the following packages: qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev

Make Error: libcryptopp

While executing the make of cpp-ethereum (after a successful cmake), the error looks like:

[ 40%] Building CXX object libethcore/CMakeFiles/ethcore.dir/BlockInfo.cpp.o
Linking CXX shared library libethcore.so
/usr/bin/ld: /opt/cryptopp562/libcryptopp.a(cryptlib.o): relocation R_X86_64_32S against `_ZTVN8CryptoPP9ExceptionE can not be used when making a shared object; recompile with -fPIC
/opt/cryptopp562/libcryptopp.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libethcore/libethcore.so] Error 1
make[1]: *** [libethcore/CMakeFiles/ethcore.dir/all] Error 2
make: *** [all] Error 2

Thus, it is related to the installation of cryptopp562. You can notice it says "recompile with -fPIC". If you open the "GNUmakefile" of cryptopp562, it says "-fPIC" is supported, and you can uncomment the line

# CXXFLAGS += -fPIC

so it looks like:

CXXFLAGS += -fPIC

Afterwards, in the cryptopp562 directory, you may:

make clean
make

And now run again the cpp-ethereum make.

Make Error: "Linking CXX executable eth"

While executing the make of cpp-ethereum (after a successful cmake), the error looks like:

[ 75%] Building CXX object test/CMakeFiles/testeth.dir/rlp.cpp.o
Linking CXX executable testeth
/usr/bin/ld: warning: libsnappy.so.1, needed by /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libleveldb.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libleveldb.so: undefined reference to `snappy::GetUncompressedLength(char const*, unsigned long, unsigned long*)'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libleveldb.so: undefined reference to `snappy::MaxCompressedLength(unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libleveldb.so: undefined reference to `snappy::RawUncompress(char const*, unsigned long, char*)'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libleveldb.so: undefined reference to `snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)'
collect2: error: ld returned 1 exit status
make[2]: *** [test/testeth] Error 1
make[1]: *** [test/CMakeFiles/testeth.dir/all] Error 2
make: *** [all] Error 2

The issue is due to libleveldb-dev, as found in: http://forum.ethereum.org/discussion/comment/905/#Comment_905 You may need aptitude remove libleveldb-dev.

Make Error: libleveldb.so

While executing the make of cpp-ethereum (after a successful cmake), the error looks like:

[ 40%] Building CXX object libethcore/CMakeFiles/ethcore.dir/BlockInfo.cpp.o
make[2]: *** no rule to build target «/usr/lib/x86_64-linux-gnu/libleveldb.so», needed by «libethcore/libethcore.so». 

This was caused by having a libleveldb version for i386 (libleveldb1:i386) while having a amd64 architecture. A simple apt-get install libleveldb1 reveals it. Downloading and installing the packages libleveldb-dev and/or libleveldb1 and/or libsnappy1 for amd64 solved it. You may need aptitude install libminiupnpc-dev

Make Error: neth & ncurses

While executing the make of cpp-ethereum (after a successful cmake), the error looks like:

Scanning dependencies of target neth
[ 80%] Building CXX object neth/CMakeFiles/neth.dir/main.cpp.o
/opt/cpp-ethereum/neth/main.cpp:46:21: fatal error: ncurses.h: No such file or directory
compilation terminated.
make[2]: *** [neth/CMakeFiles/neth.dir/main.cpp.o] Error 1
make[1]: *** [neth/CMakeFiles/neth.dir/all] Error 2
make: *** [all] Error 2

Install libncurses5-dev.

Make Error: alethzero & QLineEdit

While executing the make of cpp-ethereum (after a successful cmake), the error looks like:

[ 87%] Building CXX object alethzero/CMakeFiles/alethzero.dir/MainWin.cpp.o
In file included from /opt/cpp-ethereum/alethzero/MainWin.cpp:43:0:
/opt/cpp-ethereum-build/alethzero/ui_Main.h: In member function ‘void Ui_Main::setupUi(QMainWindow*)’:
/opt/cpp-ethereum-build/alethzero/ui_Main.h:685:27: error: ‘class QLineEdit’ has no member named ‘setClearButtonEnabled’
make[2]: *** [alethzero/CMakeFiles/alethzero.dir/MainWin.cpp.o] Error 1
make[1]: *** [alethzero/CMakeFiles/alethzero.dir/all] Error 2
make: *** [all] Error 2

The QT used is not the right version. The Class QLineEdit in 5.0.2 doesn't have such method 'setClearButtonEnabled' (http://qt.apidoc.info/5.0.2/qtwidgets/qlineedit.html ), while in 5.2 it does (http://qt.apidoc.info/5.2.0/qtwidgets/qlineedit.html ). If you execute qmake -v it would show which version you are using:

QMake version 3.0
Using Qt version 5.0.2 

You may try to install the packages qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev but depending on the repositories used it may not work. For me, it worked downloading the official qt5 release and installing it:

wget http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x64-1.6.0-4-online.run 
chmod +x qt-opensource-linux-x64-1.6.0-4-online.run 
./qt-opensource-linux-x64-1.6.0-4-online.run 
echo "PATH=/opt/Qt5.2/5.2.1/gcc_64/bin:$PATH" >> ~/.bashrc
source ~/.bashrc

(change the PATH line accordingly). Now executing qmake -v should show something like:

QMake version 3.0
Using Qt version 5.2.1 in /opt/Qt5.2/5.2.1/gcc_64/lib

A cpp-ethereum make straight away may not work (as it needs to be relinked to the right QT). Try cleaning and redoing the clone, cmake and make if it doesn't work otherwise.

13.04

Works with build instructions as per the Uncyclo

####Linking against the correct version of Cryptopp

If during the build process you get undefined reference to vtable for CryptoPP::SHA3 linking errors, you may be linking against the wrong version of the Cryptopp library. Please check that your cpp-ethereum, cpp-ethereum-build and cryptopp562 are all in the same directory, then remove the system version of librypto++-dev

apt-get remove libcrypto++-dev

Check the output of this command: you may need to remove some directories omitted by apt-get remove manually. Recompile, and hopefully now the build will link against the correct version of Cryptopp. More info can be found here

Debian

Wheezy

Works similar to Ubuntu, but needs newer versions of libboost and libminiupnpc. The following creates a headless build:

  • Install the following packages:
sudo apt-get install build-essential libgmp-dev libgmp3-dev libcrypto++-dev \
  git cmake  automake libtool libleveldb-dev yasm unzip python-all-dev libbz2-dev

Create a directory for the libraries which will be built, as you probably don't want them as system libraries. This will be used as a prefix for the builds. Add <prefix>/lib and <prefix>/usr/lib to your LD_LIBRARY_PATH. Add <prefix>/include and <prefix>/usr/include to your C_INCLUDE_PATH and CPLUS_INCLUDE_PATH.

Download miniupnpc-1.6.20120502.tar.gz from http://miniupnp.tuxfamily.org/ , unpack and build it. Install it with PREFIX=<prefix> make install

Make sure you have following packages installed: python-all-dev and libbz2-dev

Download boost_1_55_tar.bz2 from boost.org. Build according to the instructions and install with b2 install --prefix=<prefix>

Build cryptopp562 and SECP256k1 according to the Ubuntu-instructions.

Pull the ethereum source from git and edit the file cpp-ethereum/CMakeLists.txt. Add your prefix-dir at a location of your choice LINK_DIRECTORIES(<prefix>/lib)

The rest works like on Ubuntu. Don't forget to add -DHEADLESS=1 to the cmake-call!

Other Distributions

The current ethereum client depends on an older version of libminiupnpc. The client has been successfully tested with libminiupnpc 1.6.2 which is the version Ubuntu currently uses.

Clone this wiki locally