提交 fb3ceef9 authored 作者: lamblin's avatar lamblin

Merge pull request #1425 from nouiz/mac_anaconda

buildbot python 3.3.0 and Mac anaconda instruction.
...@@ -527,7 +527,7 @@ MacOS ...@@ -527,7 +527,7 @@ MacOS
----- -----
There are various ways to install Theano dependencies on a Mac. There are various ways to install Theano dependencies on a Mac.
Here we describe the process in detail with EPD or with MacPorts, but if you did Here we describe the process in detail with EPD, Anaconda or with MacPorts, but if you did
it differently and it worked, please let us know the details on the it differently and it worked, please let us know the details on the
`theano-users`_ mailing-list, so that we can add alternate instructions `theano-users`_ mailing-list, so that we can add alternate instructions
here. here.
...@@ -581,6 +581,54 @@ Then you must install g++. You can do this by installing XCode. See the first bu ...@@ -581,6 +581,54 @@ Then you must install g++. You can do this by installing XCode. See the first bu
if the user did the modification and if not, we tell him how to do if the user did the modification and if not, we tell him how to do
it. it.
Anaconda 1.5
~~~~~~~~~~~~
An easy way to install most of the dependencies is to install
`Anaconda <http://continuum.io/downloads.html>`_. There is a free
version available to everybody. If you install their ``MKL
Optimizations`` product (free for academic, ~30$ otherwise) Theano
will also be optimized as we will reuse the faster BLAS version
automatically.
Anaconda installation includes in particular Python (and the development headers),
numpy, scipy, nose, sphinx, pip, and a acceptable BLAS version. The Mac OS and
Linux version do not include g++.
After installing Anaconda, in a terminal execute this command to
install the latest Theano release:
.. code-block:: bash
$ pip install Theano
To install the missing Theano optional dependency (pydot):
.. code-block:: bash
$ conda install pydot
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
$ sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
See the section `install_bleeding_edge`_ for more
information on the bleading edge version.
Then you must install g++. You can do this by installing XCode. See the first bullet in the :ref:`macports` section.
.. note::
If you use the trunk or a version after 0.6rc3 of Theano, we try to
automaticaly link with the python library. Due to Mac OS
peculiarities, we need a user intervention to do it. We detect
if the user did the modification and if not, we tell him how to do
it.
.. _macports: .. _macports:
MacPorts MacPorts
......
...@@ -1682,6 +1682,26 @@ class GCC_compiler(object): ...@@ -1682,6 +1682,26 @@ class GCC_compiler(object):
if (python_inc.count('Python.framework') > 0 and if (python_inc.count('Python.framework') > 0 and
config.cmodule.mac_framework_link): config.cmodule.mac_framework_link):
cxxflags.extend(['-framework', 'Python']) cxxflags.extend(['-framework', 'Python'])
if 'Anaconda' in sys.version:
new_path = os.path.join(sys.prefix, "lib")
v = os.getenv("DYLD_FALLBACK_LIBRARY_PATH", None)
if v is not None:
# This will resolve symbolic links
v = os.path.realpath(v)
# The python __import__ don't seam to take into account
# the new env variable "DYLD_FALLBACK_LIBRARY_PATH"
# when we set with os.environ['...'] = X or os.putenv()
# So we tell the user and tell him what todo.
if v is None or new_path not in v.split(":"):
raise Exception(
"The environment variable "
"'DYLD_FALLBACK_LIBRARY_PATH' does not contain "
"the '%s' path in its value. This will make "
"Theano unable to compile c code. Update "
"'DYLD_FALLBACK_LIBRARY_PATH' to contain the "
"said value, this will fix this error."
% new_path)
return cxxflags return cxxflags
...@@ -1815,7 +1835,7 @@ class GCC_compiler(object): ...@@ -1815,7 +1835,7 @@ class GCC_compiler(object):
# sometimes, the linker cannot find -lpython so we need to tell it # sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located # explicitly where it is located
# this returns somepath/lib/python2.x # this returns somepath/lib/python2.x
python_lib = distutils.sysconfig.get_python_lib(plat_specific=1, \ python_lib = distutils.sysconfig.get_python_lib(plat_specific=1,
standard_lib=1) standard_lib=1)
python_lib = os.path.dirname(python_lib) python_lib = os.path.dirname(python_lib)
if python_lib not in lib_dirs: if python_lib not in lib_dirs:
......
...@@ -12,9 +12,11 @@ me='lisa@iro.umontreal.ca' ...@@ -12,9 +12,11 @@ me='lisa@iro.umontreal.ca'
#Those file contain the output of the do_nightly_build script. #Those file contain the output of the do_nightly_build script.
files=["/tmp/do_nightly_build_theano", "/tmp/do_nightly_build_pylearn", files=["/tmp/do_nightly_build_theano", "/tmp/do_nightly_build_pylearn",
"/tmp/do_nightly_build_deeplearning", "/tmp/do_nightly_build_pylearn2", "/tmp/do_nightly_build_deeplearning", "/tmp/do_nightly_build_pylearn2",
"/tmp/do_nightly_build_theano_python2.4"] "/tmp/do_nightly_build_theano_python2.4",
"/tmp/do_nightly_build_theano_python3.3.0",
]
msgs=['Theano buildbot', 'Pylearn buildbot', 'Deep Learning Tutorial buildbot', msgs=['Theano buildbot', 'Pylearn buildbot', 'Deep Learning Tutorial buildbot',
'Pylearn2 buildbot', 'Theano Python2.4 buildbot'] 'Pylearn2 buildbot', 'Theano Python2.4 buildbot', 'Theano Python3.3.0 buildbot']
print files print files
print msgs print msgs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论