solidity/docs/installing-solidity.rst

134 lines
3.6 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-08-04 09:04:13 +00:00
brew install cmake cryptopp gmp
2015-12-10 11:22:53 +00:00
Ubuntu Trusty (14.04)
---------------------
Below are the instructions to install the minimal dependencies required
to compile Solidity on Ubuntu 14.04 (Trusty Tahr).
.. code-block:: bash
sudo apt-get -y install build-essential git cmake libgmp-dev libboost-all-dev \
2016-08-04 09:04:13 +00:00
libjsoncpp-dev
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 # this will update cmake to version 3.x
2016-08-04 09:04:13 +00:00
sudo apt-get -y install libcryptopp-dev libjsoncpp-dev
Ubuntu Xenial (16.04)
---------------------
2015-12-10 11:22:53 +00:00
Below are the instructions to install the minimal dependencies required
to compile Solidity on Ubuntu 16.04 (Xenial Xerus).
2015-12-10 11:22:53 +00:00
One of the dependencies (Crypto++ Library, with version >= 5.6.2) can be
installed either by adding the Ethereum PPA (Option 1) or by backporting
2016-06-04 19:36:10 +00:00
``libcrypto++`` from Ubuntu Development to Ubuntu Xenial (Option 2).
2015-12-10 11:22:53 +00:00
.. code-block:: bash
sudo apt-get -y install build-essential git cmake libgmp-dev libboost-all-dev \
2016-08-04 09:04:13 +00:00
libjsoncpp-dev
# (Option 1) For those willing to add the Ethereum PPA:
2015-12-10 11:22:53 +00:00
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
sudo apt-get -y install libcryptopp-dev
2016-07-11 15:23:17 +00:00
## (Option 2) For those willing to backport libcrypto++:
#sudo apt-get -y install ubuntu-dev-tools
#sudo pbuilder create
#mkdir ubuntu
#cd ubuntu
#backportpackage --workdir=. --build --dont-sign libcrypto++
#sudo dpkg -i buildresult/libcrypto++6_*.deb buildresult/libcrypto++-dev_*.deb
#cd ..
2015-12-10 11:22:53 +00:00
Building
--------
Run this if you plan on installing Solidity only:
2015-12-10 11:22:53 +00:00
.. code-block:: bash
2016-08-04 09:04:13 +00:00
git clone --recursive https://github.com/ethereum/solidity.git
cd solidity
mkdir build
cd build
cmake .. && make
2015-12-10 11:22:53 +00:00
If you want to help developing Solidity,
you should fork Solidity and add your personal fork as a second remote:
.. code-block:: bash
2016-08-04 09:04:13 +00:00
cd solidity
2015-12-10 11:22:53 +00:00
git remote add personal git@github.com:username/solidity.git