Changes between Version 1 and Version 2 of CompileError


Ignore:
Timestamp:
2012-07-11T14:40:00Z (12 years ago)
Author:
zooko
Comment:

what to do if you get a compile error

Legend:

Unmodified
Added
Removed
Modified
  • CompileError

    v1 v2  
     1=== The Symptoms ===
     2
    13Sometimes running {{{python setup.py build}}} results in an error message about a compile failure. This page will tell you how to get past that problem.
    24
     
    1315}}}
    1416
     17=== Why This Happens ===
     18
    1519To decide what to do about this, you have to understand that the Tahoe-LAFS software itself is written in 100% pure Python and never gets compiled. However, Tahoe-LAFS uses several libraries which themselves contain native C or C++ code that needs to be compiled. Currently there are six libraries that Tahoe-LAFS uses: {{{Twisted}}}, {{{pyOpenSSL}}}, {{{pycrypto}}}, {{{pycryptopp}}}, {{{zfec}}}, and {{{zope.interface}}}.
    1620
    17 To understand why the compile failure happens and how to get past it, you have to understand that {{{python setup.py build}}} tries *three* different methods of satisfying Tahoe-LAFS's need for its libraries, and only if all three methods fail does it emit an error message like this.
     21To understand why the compile failure happens and how to get past it, you have to understand that {{{python setup.py build}}} tries ''three'' different methods of satisfying Tahoe-LAFS's need for its libraries, and only if all three methods fail does it emit an error message like this.
    1822
    19 1. First, if a suitable version of the library is already installed in your system, then Tahoe-LAFS will just use that. So for example if the compile failure is happening because it can't compile {{{Twisted}}}, and if you were to install Twisted into your operating system, such as by running {{{sudo apt-get install python-twisted}}} on Debian, or by downloading and running the MSI installer for Twisted from http://twistedmatrix.com/trac/ on Windows, then the compile failure would stop happening, because it would no longer attempt to compile Twisted, because it would use the installed Twisted instead.
     231. First, if a suitable version of the library is already installed in your system, then Tahoe-LAFS will use it. So for example if the compile failure is happening because it can't compile {{{Twisted}}}, and if you were to install Twisted into your operating system — such as by running {{{sudo apt-get install python-twisted}}} on Debian, or by downloading and running the MSI installer for Twisted from http://twistedmatrix.com/trac/ on Windows — then the compile failure would stop happening, because it would no longer attempt to compile Twisted, because it would use the installed Twisted on your system instead.
    2024
    21 2. Second, if a "Python egg" of the library for your platform and your version of Python is available from the library's page on http://pypi.python.org or from [//source/tahoe-lafs/deps/tahoe-lafs-dep-eggs/README.html the collection of eggs hosted on http://tahoe-lafs.org], it will download and use that. In that case it will not attempt to compile the library at all! It will instead use the precompiled "egg" package of that library.
     252. Second, if a "Python egg" of the library for your platform and your version of Python is available from the library's page on http://pypi.python.org or from [//source/tahoe-lafs/deps/tahoe-lafs-dep-eggs/README.html the collection of eggs hosted on https://tahoe-lafs.org], it will download and use that. In that case it will not attempt to compile the library at all. It will instead use the precompiled "egg" package of that library.
    2226
    23 3. Third, only if both of the two methods above failed then it downloads the source code of the library and tries to compile it. Then, if you don't have a compiler, you don't have the {{{Python.h}}} header file, or you don't have some other compile-time dependency of that library, the compile will fail and you'll get an error message like the ones above.
     273. Third, only if both of the two methods above failed then it downloads the source code of the library and tries to compile it. If you have a working compiler and all the needed header files then the compilation will succeed.
    2428
     29Only if all three of the above attempts fail will it emit an error message like the ones above and then stop the build.
     30
     31=== What To Do ===
     32
     33If you get an error message like this, then please look at [//source/tahoe-lafs/deps/tahoe-lafs-dep-eggs/README.html the collection of eggs hosted on https://tahoe-lafs.org], look at the table for the version of Python you are using, and then look in the row of that table for your platform. To see what version of Python you are using, run {{{python -V}}}. To see what platform you are using, run {{{python -c 'import distutils.util;print distutils.util.get_platform()'}}}.
     34
     35If there are any blank cells in your row of the table, then that's your problem. The problem is that one of those dependencies is not available in precompiled binary form. To get this fixed, please send an email to [//cgi-bin/mailman/listinfo/tahoe-dev the tahoe-dev mailing list] politely requesting that someone who has your platform would build a precompiled binary of that dependency for you.