-
Notifications
You must be signed in to change notification settings - Fork 0
EVMJIT
EVMJIT is a just-in-time compiler and execution engine for EVM bytecode. It translates EVM instructions to LLVM IR (intermediate representation) and uses LLVM backend to generate native code from the IR.
Follow the instructions for installing dependencies and obtaining sources for cpp-ethereum on Building on Ubuntu.
3.5 is the latest stable version of LLVM at the moment of writing this guide. Other versions may work too but have not been tested.
We are going to checkout LLVM sources into ./llvm-3.5-src
and build LLVM into ./llvm-3.5-build
.
Checkout LLVM 3.5 sources from Subversion repository (detailed instructions on http://llvm.org/releases/3.5.0/docs/GettingStarted.html#checkout-llvm-from-subversion):
mkdir llvm-3.5-src
cd llvm-3.5-src
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_350/final .
Build LLVM with cmake (detailed instructions on http://llvm.org/releases/3.5.0/docs/CMake.html):
mkdir ../llvm-3.5-build
cd ../llvm-3.5-build
cmake ../llvm-3.5-src
make
Now back to the cpp-ethereum building instructions at Building on Ubuntu#user-content-building-the-client. Build ethereum tools as described there, with LLVM_DIR
set to the location of LLVM cmake config files and with the additional EVMJIT
flag:
cd ../cpp-ethereum/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DHEADLESS=1 -DLLVM_DIR=../../llvm-3.5-build/share/llvm/cmake -DEVMJIT=1
At the end of output from cmake you should see:
-- Found LLVM 3.5.0svn
-- Using LLVMConfig.cmake in: ../../llvm-3.5-build/share/llvm/cmake/
-- Configuring done
-- Generating done
-- Build files have been written to: <cpp-ethereum-root>/build
After running make
check that you have libevmjit.so
in build/libevmjit
and the program evmcc
in build/evmcc
and you are done.
-
Download LLVM 3.5.0 source (http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz) and unpack it to
/llvm
folder (same level ascpp-ethereum
) -
Create & go to folder
_build/llvm/x64
-
Create Visual Studio 2013 project files with cmake
cmake -G "Visual Studio 12 Win64" -DLLVM_TARGETS_TO_BUILD="X86" ../../../llvm
-
Open LLVM.sln and build ALL_BUILD project.
- Open LLVM.props (Property Manager -> LibEvmJit -> Debug | x64 -> LLVM -> Properties), go to User Macros tab and set LLVMEnabled to 1.
- Add LibEvmJit dependency for projects eth, TestEthereum (Properties -> References -> Add New Reference...)
Start TestEthereum with option --jit
to run tests with JIT.
See ETC Resources
- Building on Linux
- Building on MacOS
- Building on Windows
- Compatibility Info and Build Tips
- Serpent LLL Only Build
- LLL PoC 6
- [LLL Examples for PoC 6](LLL Examples for PoC 5)
- PoC 6 JS API
- Client Development with PoC 6
- MetaCoin API
- Exchange API
- Name Registration API
- Coins API