Solidity versions follow semantic versioning and in addition to releases, nightly development builds are also made available. The nightly builds are not guaranteed to be working and despite best efforts they might contain undocumented and/or broken changes. We recommend to use the latest release. Package installers below will use the latest release.
If you just want to try Solidity for small contracts, you can try browser-solidity which does not need any installation. If you want to use it without connection to the Internet, you can go to https://github.com/ethereum/browser-solidity/tree/gh-pages and download the .ZIP file as explained on that page.
npm / Node.js¶
This is probably the most portable and most convenient way to install Solidity locally.
To install it, simply use
npm install solc
Details about the usage of the Node.js package can be found in the solc-js repository.
Binary packages of Solidity available at solidity/releases.
We also have PPAs for Ubuntu. For the latest stable version.
sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc
If you want to use the cutting edge developer version:
sudo add-apt-repository ppa:ethereum/ethereum sudo add-apt-repository ppa:ethereum/ethereum-dev sudo apt-get update sudo apt-get install solc
Homebrew is missing pre-built bottles at the time of writing, following a Jenkins to TravisCI migration, but Homebrew should still work just fine as a means to build-from-source. We will re-add the pre-built bottles soon.
brew update brew upgrade brew tap ethereum/ethereum brew install solidity brew linkapps solidity
Building from Source¶
Clone the Repository¶
To clone the source code, execute the following command:
git clone --recursive https://github.com/ethereum/solidity.git cd solidity
If you want to help developing Solidity, you should fork Solidity and add your personal fork as a second remote:
cd solidity git remote add personal email@example.com:[username]/solidity.git
Prerequisites - macOS¶
For macOS, ensure that you have the latest version of Xcode installed. This contains the Clang C++ compiler, the Xcode IDE and other Apple development tools which are required for building C++ applications on OS X. If you are installing Xcode for the first time, or have just installed a new version then you will need to agree to the license before you can do command-line builds:
sudo xcodebuild -license accept
Prerequisites - Windows¶
You will need to install the following dependencies for Windows builds of Solidity:
|Git for Windows||Command-line tool for retrieving source from Github.|
|CMake||Cross-platform build file generator.|
|Visual Studio 2015||C++ compiler and dev environment.|
We now have a “one button” script which installs all required external dependencies on macOS, Windows and on numerous Linux distros. This used to be a multi-step manual process, but is now a one-liner:
Or, on Windows:
Building Solidity is quite similar on Linux, macOS and other Unices:
mkdir build cd build cmake .. && make
And even on Windows:
mkdir build cd build cmake -G "Visual Studio 14 2015 Win64" ..
This latter set of instructions should result in the creation of solidity.sln in that build directory. Double-clicking on that file should result in Visual Studio firing up. We suggest building RelWithDebugInfo configuration, but all others work.
Alternatively, you can build for Windows on the command-line, like so:
cmake --build . --config RelWithDebInfo
Important information about versioning¶
After a release is made, the patch version level is bumped, because we assume that only
patch level changes follow. When changes are merged, the version should be bumped according
to semver and the severity of the change. Finally, a release is always made with the version
of the current nightly build, but without the
- the 0.4.0 release is made
- nightly build has a version of 0.4.1 from now on
- non-breaking changes are introduced - no change in version
- a breaking change is introduced - version is bumped to 0.5.0
- the 0.5.0 release is made
This behaviour works well with the version pragma.