################### Installing Solidity ################### Browser-Solidity ================ 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 also just save the page locally or clone http://github.com/ethereum/browser-solidity. npm / Node.js ============= This is probably the most portable and most convenient way to install Solidity locally. A platform-independent JavaScript library is provided by compiling the C++ source into JavaScript using Emscripten for browser-solidity and there is also an npm package available. 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 =============== Binary packages of Solidity available at `solidity/releases `_. Building from Source ==================== Clone the Repository -------------------- To clone the source code, execute the following command: .. code:: bash 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: .. code:: bash cd solidity git remote add personal git@github.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: .. code:: bash sudo xcodebuild -license accept Our OS X builds require you to `install the Homebrew `_ package manager for installing external dependencies. Here's how to `uninstall Homebrew `_, if you ever want to start again from scratch. Prerequisites - Windows ------------------------ You will need to install the following dependencies for Windows builds of Solidity: +------------------------------+-------------------------------------------------------+ | Software | Notes | +==============================+=======================================================+ | `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. | +------------------------------+-------------------------------------------------------+ .. _Git for Windows: https://git-scm.com/download/win .. _CMake: https://cmake.org/download/ .. _Visual Studio 2015: https://www.visualstudio.com/products/vs-2015-product-editions External Dependencies --------------------- 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: .. code:: bash ./scripts/install_deps.sh Or, on Windows: .. code:: bash scripts\install_deps.bat Command-Line Build ------------------ Building Solidity is quite similar on Linux, macOS and other Unices: .. code:: bash mkdir build cd build cmake .. && make And even on Windows: .. code:: bash 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: .. code:: bash cmake --build . --config RelWithDebInfo