Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Build on Ubuntu 17.04 (amd64) breaking. #413

Closed
siginfo opened this issue Sep 13, 2017 · 19 comments
Closed

Build on Ubuntu 17.04 (amd64) breaking. #413

siginfo opened this issue Sep 13, 2017 · 19 comments
Milestone

Comments

@siginfo
Copy link
Contributor

siginfo commented Sep 13, 2017

I was trying to build eos on ubuntu 17.04 (amd64) and followed the instructions mentioned in the README.md.

EOS environment

gcc/g++ version

siginfo@ubuntu:~$ gcc --version && g++ --version
gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

siginfo@ubuntu:~$ 

I exported following variables from bashrc, namely

environment variables

export BOOST_ROOT=~/opt/boost_1_64_0
export BINARYEN_ROOT=~/code/binaryen
export WASM_LLVM_CONFIG=~/code/wasm-compiler/llvm/bin/llvm-config
export LLVM_DIR=~/code/wasm-compiler/llvm/lib/cmake/llvm

The build failure logs are located in this gist

Am I missing something?

@gguoss
Copy link
Contributor

gguoss commented Sep 13, 2017

My system is also ubuntu17.04, but compiled in ubuntu16.04, OK

@gguoss
Copy link
Contributor

gguoss commented Sep 13, 2017

fafa
To see your problem, I changed to ubuntu17.04, compile through.

@elmato
Copy link
Contributor

elmato commented Sep 13, 2017

Your cmake log indicates that g++ is being used for compiling.

...
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
...

Set clang-4 as your preferred compiler before running cmake

export CC=clang-4.0
export CXX=clang++-4.0

or use the build.sh script as indicated in the README.md

git clone https://github.com/eosio/eos --recursive
cd eos
./build.sh ubuntu # For ubuntu

@elmato elmato closed this as completed Sep 13, 2017
@siginfo
Copy link
Contributor Author

siginfo commented Sep 14, 2017

@elmato I tried build.sh on ubuntu 17.04 - still failing at the same stage. Attaching my run of script's build.txt (zipped) here build.txt.zip

script ~/build.txt

Also, added a small fix to build.sh here fix

@siginfo
Copy link
Contributor Author

siginfo commented Sep 15, 2017

@elmato @bytemaster please re-open this issue as there seems to be a genuine issue here. It seems that wasm's llvm is not compiled with cmake's -DLLVM_ENABLE_RTTI=ON option both on Linux and macOS.

I have added a fix here.

Once this issue reopens - I will initiate a pull request for the same.

@elmato
Copy link
Contributor

elmato commented Sep 15, 2017

Ref #466

@siginfo I have successfully built the project using the current build.sh as it is now.
The llvm toolchain that needs to have RTTI=ON is the one used to build eosd (because of wasm-jit).

The Ubuntu packages from https://apt.llvm.org have rtti enabled (those are the ones installed by install_dependecies.sh).

You can check that using llvm-config --has-rtti

> ➜  build git:(master) ✗ llvm-config-4.0 --has-rtti                     
> YES
> ➜  build git:(master) ✗ ~/wasm-compiler/llvm/bin/llvm-config --has-rtti
> NO
> 

@siginfo
Copy link
Contributor Author

siginfo commented Sep 16, 2017

@elmato are you sure that https://github.com/llvm-mirror/llvm.git and https://github.com/llvm-mirror/clang.git (because that is what is referenced in scripts/install_dependencies.sh) has the RTTI CMAKE switch 'ON'?

I tried it on my macOS - same issue with linking errors. But then when I added RTTI switch back - the build on macOS went fine.

I am now trying to build a new ubuntu-amd64-16.10 virtual machine to see if something I am not doing correctly.

@minimizeTrustLess
Copy link

hi @elmato, @siginfo, how long does it take to build? i have been doing it for a while now. More than 3hrs
scary that it might break soon. I did a fresh build on a newely installed ubuntu...maybe has a huge dependency?
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
latest log from build-----
[ 44%] Building CXX object lib/Target/CMakeFiles/LLVMTarget.dir/TargetLoweringObjectFile.cpp.o

@siginfo
Copy link
Contributor Author

siginfo commented Sep 16, 2017

@minimizeTrustLess it took around 1:30 hrs before it failed on my machine (same as your setup). Check the build logs here.
Please let us know about the build status on your machine. I tried on my another machine which is a macOS - but it failed around the same stage as on ubuntu.
I added a fix here which fixes my macOS build.
I am starting a fresh build on Linux 17.04...

@minimizeTrustLess
Copy link

minimizeTrustLess commented Sep 16, 2017

@siginfo thanks for the comment, Failed as i had suspected.i left it running all night lol, thought my laptop is 8 years old...i did not do a std output or std err...not sure if this build shell script actually writes log to something....i got tired and let my laptop run all night. woke up to see the below
i will give one more try soon. First look at screen failure looks like a linking issue.

make[2]: *** [contracts/test_api/test_api.wast] Error 127
CMakeFiles/Makefile2:338: recipe for target 'contracts/test_api/CMakeFiles/test_api.dir/all' failed
make[1]: *** [contracts/test_api/CMakeFiles/test_api.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

i see below too... not sure when this shows up in the build info....
make[1]: *** [contracts/proxy/CMakeFiles/proxy.dir/all] Error 2
[ 8%] Building LLVM bitcode test_math.cpp.bc
[ 8%] Building LLVM bitcode test_message.cpp.bc
[ 9%] Building LLVM bitcode test_print.cpp.bc
[ 9%] Building LLVM bitcode test_transaction.cpp.bc
[ 9%] Linking LLVM bitcode test_api.bc
[ 10%] Generating textual assembly test_api.s
[ 10%] Generating WAST test_api.wast

@siginfo
Copy link
Contributor Author

siginfo commented Sep 16, 2017

@elmato @minimizeTrustLess I was successfully able to build on my fresh ubuntu (amd64) 17.04 machine via build.sh. I guess my clang on ubuntu was stale which was missing rtti support.

@minimizeTrustLess
Copy link

@siginfo i am trying a new one in a brand new fast laptop.

@siginfo
Copy link
Contributor Author

siginfo commented Sep 16, 2017

@minimizeTrustLess @elmato build on my fresh macOS Sierra (10.12.6) went well with build.sh darwin

@minimizeTrustLess
Copy link

@siginfo it failed like this....
-- Configuring ChainBase on Linux
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/home/minizime/Desktop/decentralized/eos/libraries/appbase/Boost_INCLUDE_DIR
used as include directory in directory /home/minizime/Desktop/decentralized/eos/libraries/appbase
/home/minizime/Desktop/decentralized/eos/libraries/chainbase/Boost_INCLUDE_DIR
used as include directory in directory /home/minizime/Desktop/decentralized/eos/libraries/chainbase
/home/minizime/Desktop/decentralized/eos/libraries/fc/Boost_INCLUDE_DIR
used as include directory in directory /home/minizime/Desktop/decentralized/eos/libraries/fc

-- Configuring incomplete, errors occurred!
See also "/home/minizime/Desktop/decentralized/eos/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.

@siginfo
Copy link
Contributor Author

siginfo commented Sep 17, 2017

@minimizeTrustLess do this:

$ script ~/build.txt
$ ./build.sh ubuntu
$ exit

send the gist of the ~/build.txt file

note: don't forget to pull submodules

@minimizeTrustLess
Copy link

minimizeTrustLess commented Sep 17, 2017

@siginfo. Thank you much for the info. I am doing a fresh pull and all over again....staring now :)

git clone https://github.com/eosio/eos --recursive
cd eos
script ~/build.txt
./build.sh ubuntu
exit

@minimizeTrustLess
Copy link

@siginfo @elmato looks like it finally built? if so great :D
98%] Building CXX object programs/eosc/CMakeFiles/eosc.dir/main.cpp.o
[ 99%] Linking CXX static library libaccount_history_api_plugin.a
[ 99%] Built target account_history_api_plugin
Scanning dependencies of target eosd
[100%] Building CXX object programs/eosd/CMakeFiles/eosd.dir/main.cpp.o
[100%] Linking CXX executable eosc
[100%] Built target eosc
[100%] Linking CXX executable eosd
[100%] Built target eosd

@minimizeTrustLess
Copy link

@siginfo @elmato Awesome sauce.. I was able to build finally. Now time for experimenting with true decentralization...
Could you please help me with getting following answered for my research, so I can get my hands dirty on this new platform?

  1. Where is developer Wiki/confluence?
  2. What is the entry point to get started using this platform? API reference. Demo?
    Thanks

@SheldonHH
Copy link
Contributor

DLLVM_ENABLE_RTTI=1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants