GithubHelp home page GithubHelp logo

Comments (11)

sidutta avatar sidutta commented on June 3, 2024

Can you try checking whether explicitly including functional header helps and also that you don't have any other C++11 related compiler issue?

from zilliqa.

stoomart avatar stoomart commented on June 3, 2024

Sorry I'm not a developer, I'm not familiar with how to explicitly include functional headers. I ran a C++11 compiler verification script and all the checks came back OK.

I have since tried building on CentOS 7.4.1708, which also failed complaining about c++14, which I determined was due to gcc-c++ 4.8.5 (4.9 is required).

The build got much further on Fedora 25 (uses gcc-c++ 6.4.1 instead of 7.2.1 in F27), but ends up complaining about undefined references to LevelDB::..., which seem to be defined in the LevedDB.h file. I will keep working on this, let me know if you have any quick pointers.

from zilliqa.

stoomart avatar stoomart commented on June 3, 2024

Experienced the same issue originally reported on a fresh install of Ubuntu 17.10, which uses gcc 7.2. Installing Ubuntu 17.04 now, which uses gcc 6.3.

Durian_build_ubuntu-1710.log

from zilliqa.

stoomart avatar stoomart commented on June 3, 2024

Built and executed test scripts successfully on Ubuntu 17.04, looks like there's a specific library version/path dependency somewhere.

from zilliqa.

sidutta avatar sidutta commented on June 3, 2024

Thanks for sharing your findings. I use gcc 5.4. We could use this thread to discuss compatibility issues for most major versions of gcc and linux. I have edited the title to reflect this.

from zilliqa.

MastaG avatar MastaG commented on June 3, 2024

Yes, adding #include to src/libUtils/Scheduler.h fixed this issue.
However lt's not linking correctly with leveldb, while both leveldb and leveldb-devel are installed.

[ 72%] Linking CXX executable Test_Transaction
../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::Lookup[abi:cxx11](dev::FixedHash<32u> const&) const' ../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::Exists(dev::FixedHash<32u> const&) const'
../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::Lookup[abi:cxx11](vector_ref<unsigned char const> const&) const' ../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::BatchInsert(std::unordered_map<dev::FixedHash<32u>, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, unsigned int>, std::hash<dev::FixedHash<32u> >, std::equal_to<dev::FixedHash<32u> >, std::allocator<std::pair<dev::FixedHash<32u> const, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, unsigned int> > > >&, std::unordered_map<dev::FixedHash<32u>, std::pair<std::vector<unsigned char, std::allocator >, bool>, std::hash<dev::FixedHash<32u> >, std::equal_to<dev::FixedHash<32u> >, std::allocator<std::pair<dev::FixedHash<32u> const, std::pair<std::vector<unsigned char, std::allocator >, bool> > > >&)'
collect2: fout: ld gaf exit-status 1 terug
make[2]: *** [tests/Data/CMakeFiles/Test_Transaction.dir/build.make:105: tests/Data/Test_Transaction] Fout 1
make[1]: *** [CMakeFiles/Makefile2:1777: tests/Data/CMakeFiles/Test_Transaction.dir/all] Fout 2
make: *** [Makefile:84: all] Fout 2

from zilliqa.

sidutta avatar sidutta commented on June 3, 2024

@MastaG May be try explicitly adding -L to the root CMakeLists.txt.

if(NOT IS_LOOKUP_NODE)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} -pthread -std=c++14 -Wall -DSTAT_TEST -ggdb" )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} -pthread -ljsoncpp -lboost_system -lboost_filesystem -std=c++14 -Wall -DSTAT_TEST -L path_here" )

A proper solution may be something as in https://github.com/Zilliqa/Zilliqa/blob/macosx-support/CMakeLists.txt

from zilliqa.

MastaG avatar MastaG commented on June 3, 2024

Doesn't seem to work. I've tried to add -lleveldb and -L/usr/lib64 to all four linker lines in the root CMakeLists.txt.
I can confirm that the libleveldb.so is present in /usr/lib64 and so are the header files in /usr/include.

Still the same error.

from zilliqa.

MastaG avatar MastaG commented on June 3, 2024

Should I open new issue for the leveldb problem?

from zilliqa.

MastaG avatar MastaG commented on June 3, 2024

Anyways, here the exact error:

[ 71%] Linking CXX executable Test_Transaction
cd /home/mastag/src/Zilliqa/build/tests/Data && /usr/bin/cmake -E cmake_link_script CMakeFiles/Test_Transaction.dir/link.txt --verbose=1
/usr/bin/c++ -pthread -std=c++14 -Wall -DSTAT_TEST -ggdb -g -pthread -ljsoncpp -lboost_system -lboost_filesystem -std=c++14 -Wall -DSTAT_TEST -rdynamic CMakeFiles/Test_Transaction.dir/Test_Transaction.cpp.o -o Test_Transaction -Wl,-rpath,/home/mastag/src/Zilliqa/build/src/depends/libTrie:/home/mastag/src/Zilliqa/build/src/depends/common:/home/mastag/src/Zilliqa/build/src/depends/libDatabase ../../src/libData/AccountData/libAccountData.a ../../src/libUtils/libUtils.a ../../src/libData/BlockData/Block/libBlock.a ../../src/libData/BlockData/BlockHeader/libBlockHeader.a ../../src/libCrypto/libCrypto.a -lcrypto ../../src/depends/libTrie/libTrie.so ../../src/depends/libDatabase/libDatabase.a ../../src/libUtils/libUtils.a ../../src/depends/common/libCommon.so -lboost_filesystem -lboost_system ../../src/depends/libDatabase/libOverlay.so -L/usr/lib64 -lleveldb
../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::Lookup[abi:cxx11](dev::FixedHash<32u> const&) const' ../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::Exists(dev::FixedHash<32u> const&) const'
../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::Lookup[abi:cxx11](vector_ref<unsigned char const> const&) const' ../../src/depends/libDatabase/libOverlay.so: undefined reference to LevelDB::BatchInsert(std::unordered_map<dev::FixedHash<32u>, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, unsigned int>, std::hash<dev::FixedHash<32u> >, std::equal_to<dev::FixedHash<32u> >, std::allocator<std::pair<dev::FixedHash<32u> const, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, unsigned int> > > >&, std::unordered_map<dev::FixedHash<32u>, std::pair<std::vector<unsigned char, std::allocator >, bool>, std::hash<dev::FixedHash<32u> >, std::equal_to<dev::FixedHash<32u> >, std::allocator<std::pair<dev::FixedHash<32u> const, std::pair<std::vector<unsigned char, std::allocator >, bool> > > >&)'
collect2: fout: ld gaf exit-status 1 terug

from zilliqa.

stoomart avatar stoomart commented on June 3, 2024

The fix #47 resolved the original issue when building from a fresh git clone on Fedora 27, Ubuntu 17.10, and CentOS 7.

I was able to successfully bypass the LevelDB build errors in the 4 failing tests (Test_Account, Test_Transaction, Test_LookupNodeForDSBlock, and Test_LookupNodeForTxBlock) by commenting out their directories in test/CMakeLists.txt:

#add_subdirectory (Data)
#add_subdirectory (Lookup)

I was able to build and run locally on CentOS by installing gcc 5 and building in a development terminal:

sudo yum install centos-release-scl epel-release
sudo yum install boost-devel devtoolset-4-gcc* git jsoncpp-devel cmake leveldb-devel openssl-devel psmisc
scl enable devtoolset-4 bash
./build.sh

Now I'm just working on some freezes that appear to be related to user max process limits/nproc.

from zilliqa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.