This also works on WSL2 for windows
https://docs.soliditylang.org/en/latest/installing-solidity.html#building-from-source https://github.com/ethereum/solidity/blob/develop/scripts/install_deps.sh
sudo apt-get update
- install the metamask chrome extension: https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en
- install cmake:
sudo apt-get install cmake
- install boost:
sudo apt-get install libboost-all-dev
- install z3:
sudo apt-get install z3
- install cvc4:
sudo apt-get install cvc4
- install gcc:
sudo apt-get install build-essential
- install clang:
sudo apt-get install clang
- install vscode: https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-18-04/
- download source code:
git clone --recursive https://github.com/ethereum/solidity.git
- this might timeout, so you might need to download the zip from the github UI
- https://github.com/ethereum/solidity/archive/refs/heads/develop.zip
cp ~/Downloads/solidity-develop.zip .
sudo apt-get install unzip
unzip solidity-develop.zip
- build solidity
cd solidity-develop
mkdir build
cd build
cmake .. && make
- if you get an error like:
CMake 3.13.0 or higher is required. You are running version 3.10.2
sudo apt remove --purge cmake
hash -r
sudo apt-get install build-essential libssl-dev
wget https://github.com/Kitware/CMake/releases/download/v3.16.5/cmake-3.16.5.tar.gz
- or download with chrome if you get a timeout
cp ~/Downloads/cmake-3.16.5.tar.gz .
tar -xvzf cmake-3.16.5.tar.gz
cd cmake-3.16.5
./bootstrap
make
sudo make install
- if you get an error like:
cd ..
-- Configuring incomplete, errors occurred!
See also "~/solidity-develop/build/CMakeFiles/CMakeOutput.log".
See also "~/solidity-develop/build/CMakeFiles/CMakeError.log".