solidity/docs/installing-solidity.rst

154 lines
5.1 KiB
ReStructuredText
Raw Normal View History

2015-12-10 11:22:53 +00:00
###################
Installing Solidity
###################
Browser-Solidity
================
If you just want to try Solidity for small contracts, you
2016-05-20 10:52:32 +00:00
can try `browser-solidity <https://ethereum.github.io/browser-solidity>`_
2015-12-10 11:22:53 +00:00
which does not need any installation. If you want to use it
without connection to the Internet, you can also just save the page
2016-05-20 10:52:32 +00:00
locally or clone http://github.com/ethereum/browser-solidity.
2015-12-10 11:22:53 +00:00
2016-05-19 17:27:57 +00:00
npm / Node.js
2015-12-10 11:22:53 +00:00
=============
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
2016-05-19 17:27:57 +00:00
into JavaScript using Emscripten for browser-solidity and there is also an npm
2015-12-10 11:22:53 +00:00
package available.
To install it, simply use
::
npm install solc
2016-05-19 17:27:57 +00:00
Details about the usage of the Node.js package can be found in the
2016-05-20 10:52:32 +00:00
`solc-js repository <https://github.com/ethereum/solc-js>`_.
2015-12-10 11:22:53 +00:00
Binary Packages
===============
Binary packages of Solidity together with its IDE Mix are available through
the `C++ bundle <https://github.com/ethereum/webthree-umbrella/releases>`_ of
Ethereum.
Building from Source
====================
Building Solidity is quite similar on MacOS X, Ubuntu and probably other Unices.
This guide starts explaining how to install the dependencies for each platform
and then shows how to build Solidity itself.
MacOS X
-------
Requirements:
- OS X Yosemite (10.10.5)
- Homebrew
- Xcode
Set up Homebrew:
.. code-block:: bash
brew update
brew upgrade
2016-05-13 14:32:35 +00:00
2015-12-10 11:22:53 +00:00
brew install boost --c++11 # this takes a while
2016-05-13 14:32:35 +00:00
brew install cmake cryptopp miniupnpc leveldb gmp libmicrohttpd libjson-rpc-cpp
2015-12-10 11:22:53 +00:00
# For Mix IDE and Alethzero only
brew install xz d-bus
brew install homebrew/versions/v8-315
2016-05-13 14:32:35 +00:00
brew install llvm --HEAD --with-clang
2015-12-10 11:22:53 +00:00
brew install qt5 --with-d-bus # add --verbose if long waits with a stale screen drive you crazy as well
Ubuntu
------
Below are the build instructions for the latest versions of Ubuntu. The best
supported platform as of December 2014 is Ubuntu 14.04, 64 bit, with at least 2
GB RAM. All our tests are done with this version. Community contributions for
other versions are welcome!
Install dependencies:
Before you can build the source, you need several tools and dependencies for the application to get started.
First, update your repositories. Not all packages are provided in the main
Ubuntu repository, those you'll get from the Ethereum PPA and the LLVM archive.
.. note::
Ubuntu 14.04 users, you'll need the latest version of cmake. For this, use:
`sudo apt-add-repository ppa:george-edison55/cmake-3.x`
Now add all the rest:
.. code-block:: bash
sudo apt-get -y update
sudo apt-get -y install language-pack-en-base
sudo dpkg-reconfigure locales
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get -y update
sudo apt-get -y upgrade
For Ubuntu 15.04 (Vivid Vervet) or older, use the following command to add the develop packages:
.. code-block:: bash
sudo apt-get -y install build-essential git cmake libboost-all-dev libgmp-dev libleveldb-dev libminiupnpc-dev libreadline-dev libncurses5-dev libcurl4-openssl-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev libjsoncpp-dev libedit-dev libz-dev
For Ubuntu 15.10 (Wily Werewolf) or newer, use the following command instead:
2015-12-10 11:22:53 +00:00
.. code-block:: bash
sudo apt-get -y install build-essential git cmake libboost-all-dev libgmp-dev libleveldb-dev libminiupnpc-dev libreadline-dev libncurses5-dev libcurl4-openssl-dev libcryptopp-dev libjsonrpccpp-dev libmicrohttpd-dev libjsoncpp-dev libedit-dev libz-dev
2016-05-13 14:32:35 +00:00
The reason for the change is that ``libjsonrpccpp-dev`` is available in the universe repository for newer versions of Ubuntu.
2015-12-10 11:22:53 +00:00
Building
--------
Run this if you plan on installing Solidity only, ignore errors at the end as
they relate only to Alethzero and Mix
.. code-block:: bash
git clone --recursive https://github.com/ethereum/webthree-umbrella.git
cd webthree-umbrella
./webthree-helpers/scripts/ethupdate.sh --no-push --simple-pull --project solidity # update Solidity repo
2015-12-17 18:55:51 +00:00
./webthree-helpers/scripts/ethbuild.sh --no-git --project solidity --all --cores 4 -DEVMJIT=0 # build Solidity and others
2015-12-17 16:31:37 +00:00
#enabling DEVMJIT on OS X will not build
2016-05-13 14:32:35 +00:00
#feel free to enable it on Linux
2015-12-10 11:22:53 +00:00
If you opted to install Alethzero and Mix:
.. code-block:: bash
git clone --recursive https://github.com/ethereum/webthree-umbrella.git
cd webthree-umbrella && mkdir -p build && cd build
cmake ..
If you want to help developing Solidity,
you should fork Solidity and add your personal fork as a second remote:
.. code-block:: bash
cd webthree-umbrella/solidity
git remote add personal git@github.com:username/solidity.git
Note that webthree-umbrella uses submodules, so solidity is its own git
repository, but its settings are not stored in ``.git/config``, but in
``webthree-umbrella/.git/modules/solidity/config``.
2015-12-10 11:22:53 +00:00