CDT is a toolchain for WebAssembly (WASM) and a set of tools to facilitate smart contract development for the Mandel platform. In addition to being a general purpose WebAssembly toolchain, Mandel specific optimizations are available to support building smart contracts. This new toolchain is built around Clang 9, which means that CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are incomplete or not available.
CDT currently supports Linux x86_64 Debian packages.
wget https://github.com/eosnetworkfoundation/mandel.cdt/releases/download/v3.0.0-rc1/cdt_3.0.0-rc1_amd64.deb
sudo apt install ./cdt_3.0.0-rc1_amd64.deb
sudo apt remove cdt
apt-get update && apt-get install \
build-essential \
clang \
cmake \
git \
libxml2-dev \
opam ocaml-interp \
python3 \
python3-pip \
time
python3 -m pip install pygments
If issues persist with ccache
export CCACHE_DISABLE=1
Integration tests require access to a mandel build. Instructions below provide additional steps for using a mandel built from source. For development purposes it is generally advised to use mandel built from source.
Set an environment variable to tell CDT where to find the Mandel build directory:
export eosio_DIR=/path/to/mandel/build/lib/cmake/eosio
git clone --recursive https://github.com/eosnetworkfoundation/mandel.cdt
cd mandel.cdt
mkdir build
cd build
cmake ..
make -j8
From here onward you can build your contracts code by simply exporting the build
directory to your path, so you don't have to install globally (makes things cleaner).
Or you can install globally by running this command:
sudo make install
cd build
ctest
cd build/tests/integration
ctest
sudo rm -fr /usr/local/cdt
sudo rm -fr /usr/local/lib/cmake/cdt
sudo rm /usr/local/bin/eosio-*
sudo rm /usr/local/bin/cdt-*
- cdt-cpp
- cdt-cc
- cdt-ld
- cdt-init
- cdt-abidiff
- cdt-wasm2wast
- cdt-wast2wasm
- cdt-ranlib
- cdt-ar
- cdt-objdump
- cdt-readelf