提交 35d52bda authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Update installation instruction for Mac.

上级 4e91569d
...@@ -525,44 +525,33 @@ everything is working properly. ...@@ -525,44 +525,33 @@ everything is working properly.
MacOS MacOS
----- -----
There are various ways to install Theano dependencies on a Mac. There are various ways to install Theano dependencies on a Mac. Here
Here we describe the process in detail with EPD, Anaconda or with MacPorts, but if you did we describe the process in detail with Canopy, Anaconda or Homebrew, but
it differently and it worked, please let us know the details on the if you did it differently and it worked, please let us know the
`theano-users`_ mailing-list, so that we can add alternate instructions details on the `theano-users`_ mailing-list, so that we can add
here. alternate instructions here.
In academia: Enthought Python Distribution (EPD) In academia: Enthought Canopy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you are working in academia, the easiest way to install most of the If you are working in academia, the easiest way to install most of the
dependencies is to install dependencies is to install
`Enthought Python Distribution (EPD) <http://enthought.com/products/epd.php>`_. `Canopy <http://enthought.com/products/canopy/>`_.
If you are affiliated with a university (as student or employee), you can If you are affiliated with a university (as student or employee), you
download the installer for free. can download the installer for free.
EPD installation includes in particular Python (and the development headers),
NumPy, SciPy, nose, sphinx, easy_install, pydot (but *not* `Graphviz`_, which is
necessary for it to work) and the MKL implementation of blas. The Mac OS and
Linux version do not include g++.
pip is not included in EPD. After the installation of EPD,
you can simply install it with::
.. code-block:: bash
$ sudo easy_install pip The Canopy installation includes in particular Python (and the
development headers), NumPy, SciPy, nose, sphinx, pip, pydot
(but *not* `Graphviz`_, which is necessary for it to work) and the MKL
implementation of blas.
Then in a terminal execute this command to install the latest Theano release: To install the latest Theano release execute this in a terminal:
.. code-block:: bash .. code-block:: bash
$ sudo pip install Theano $ sudo pip install Theano
If you want the bleeding edge version, `download
and install git <http://git-scm.com/downloads>`_. Then in a
terminal excute this command:
.. code-block:: bash .. code-block:: bash
$ sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git $ sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
...@@ -570,18 +559,19 @@ terminal excute this command: ...@@ -570,18 +559,19 @@ terminal excute this command:
See the section `install_bleeding_edge`_ for more See the section `install_bleeding_edge`_ for more
information on the bleeding edge version. information on the bleeding edge version.
Then you must install g++. You can do this by installing XCode. See the first bullet in the :ref:`macports` section. Then you must install the compiler. See :ref:`compiler_osx` below.
.. note:: .. note::
If you use the trunk or version 0.6 or later of Theano, we try to If you use version 0.6 or later of Theano, we try to automatically
automatically link with the EPD blas version. Due to Mac OS link with the Canopy blas version. Due to Mac OS peculiarities,
peculiarities, we need a user intervention to do it. We detect this requires user intervention. We detect if the manipulation was
if the user did the modification and if not, we tell him how to do done or not and give an error message explaining what to do in case
it. it hasn't been done.
Anaconda 1.5 Anaconda
~~~~~~~~~~~~ ~~~~~~~~
An easy way to install most of the dependencies is to install An easy way to install most of the dependencies is to install
`Anaconda <http://continuum.io/downloads.html>`_. There is a free `Anaconda <http://continuum.io/downloads.html>`_. There is a free
...@@ -590,9 +580,9 @@ Optimizations`` product (free for academic, ~30$ otherwise) Theano ...@@ -590,9 +580,9 @@ Optimizations`` product (free for academic, ~30$ otherwise) Theano
will also be optimized as we will reuse the faster BLAS version will also be optimized as we will reuse the faster BLAS version
automatically. automatically.
Anaconda installation includes in particular Python (and the development headers), The Anaconda installation includes in particular Python (and the
NumPy, SciPy, nose, sphinx, pip, and a acceptable BLAS version. The Mac OS and development headers), NumPy, SciPy, nose, sphinx, pip, and a
Linux version do not include g++. acceptable BLAS version.
After installing Anaconda, in a terminal execute this command to After installing Anaconda, in a terminal execute this command to
install the latest Theano release: install the latest Theano release:
...@@ -607,9 +597,7 @@ To install the missing Theano optional dependency (pydot): ...@@ -607,9 +597,7 @@ To install the missing Theano optional dependency (pydot):
$ conda install pydot $ conda install pydot
If you want the bleeding edge version, `download If you want the bleeding edge version instead execute this command:
and install git <http://git-scm.com/downloads>`_. Then in a
terminal execute this command:
.. code-block:: bash .. code-block:: bash
...@@ -618,17 +606,53 @@ terminal execute this command: ...@@ -618,17 +606,53 @@ terminal execute this command:
See the section `install_bleeding_edge`_ for more See the section `install_bleeding_edge`_ for more
information on the bleeding edge version. information on the bleeding edge version.
Then you must install g++. You can do this by installing XCode. See the first bullet in the :ref:`macports` section. Then you must install the compiler. See :ref:`compiler_osx` below.
.. note:: .. note::
If you use the trunk or a version after 0.6rc3 of Theano, we try to If you use version 0.6 or later of Theano, we try to automatically
automatically link with the python library. Due to Mac OS link with the python library. Due to Mac OS peculiarities, this
peculiarities, we need a user intervention to do it. We detect requires user intervention. We detect if the user did the
if the user did the modification and if not, we tell him how to do modification and if not, we tell him how to do it.
it.
.. _compiler_osx:
Installing the compiler
~~~~~~~~~~~~~~~~~~~~~~~
Theano officially supports only clang on OS X. This can be installed
by getting XCode from the App Store and running it once to install the
command-line tools.
If you still want to use g++ you can do so by setting its full path in
the theano config flag `gxx`. Note that any bug reports on Mac using
g++ will be ignored unless it can be reproduced with clang.
Homebrew
~~~~~~~~
Install python with homebrew:
.. code-block:: bash
$ brew install python # or python3 if you prefer
This will install pip. Then use pip to install numpy, scipy:
.. code-block:: bash
$ pip install numpy scipy
If you want to use openblas instead of Accelerate, you have to install
numpy and scipy with hombrew:
.. code-block:: bash
$ brew tap homebrew/python
$ brew install numpy --with-openblas
$ brew install scipy --with-openblas
.. _macports:
MacPorts MacPorts
~~~~~~~~ ~~~~~~~~
...@@ -723,14 +747,6 @@ Theano dependencies is easy, but be aware that it will take a long time ...@@ -723,14 +747,6 @@ Theano dependencies is easy, but be aware that it will take a long time
$ python -c "import theano; theano.test()" $ python -c "import theano; theano.test()"
Homebrew
~~~~~~~~
There are some `instructions
<https://github.com/samueljohn/homebrew-python>`__ by Samuel John on how to install
Theano dependencies with Homebrew instead of MacPort.
.. _gpu_macos: .. _gpu_macos:
Using the GPU Using the GPU
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论