README.Python
This file describes some problems that can occur with the cado-nfs.py
script in relation to various distributions' Python installations.
1. Python 3
Python 3, version 3.3 or greater, is required for cado-nfs.py. If you
do not wish to use cado-nfs.py, maybe because you plan to run all
commands by hand, you can disable the Python check in CMake by setting
NO_PYTHON_CHECK to any non-empty string in local.sh. See local.sh.example
for a template.
Some operating systems don't have a Python 3 interpreter installed by
default. The safest bet is to install a distribution-supplied package
for Python 3. If no such package is available, you can download the
Python source code, compile and and install it by yourself. For a good
introduction to installing Python from source, see
https://www.digitalocean.com/community/articles/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
2. Sqlite 3
The Python cado-nfs.py script requires sqlite3. Unfortunately, not all
distributions install the Python sqlite3 module by default.
In fact, two things are required: the binary sqlite3 library, and the Python
module called "sqlite3" which provides a Python interface to the sqlite3
library.
The binary sqlite3 library is installed by default on most systems, but it
is worthwhile to check that it is. Use your distribution's package manager,
and look for a package called "sqlite", "sqlite3", or "libsqlite3", which
should contain a file "libsqlite3.so.*"
The Python sqlite3 module unfortunately is not installed by default by some
distributions, known culprits include Gentoo.
Gentoo:
For Gentoo, the Python 3 package by default does not include the sqlite3
module. This link to a forum post briefly describes the situation:
<http://forums.gentoo.org/viewtopic-t-876737-start-0.html>
The sqlite3 module can be included in the Python installation by adding
the sqlite USE flag to /etc/portage/make.conf as shown in this example:
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="bindist mmx sse sse2 sqlite"
and then running
emerge --deep --newuse world
If you compile Python 3 yourself from source code, be aware that the sqlite3
development package with the header files for the sqlite3 library must be
installed on the system; without them, the Python 3 build will seem to
succeed but will not include the sqlite3 interface. When compiling Python 3,
be sure that the "make" output does NOT include a warning of the form:
The necessary bits to build these optional modules were not found:
_sqlite3
3. SSL
The workunit server and clients use SSL for communication to prevent an
attacker on the same network from injecting text into workunits which could
be used to execute arbitrary commands on the client machines. Generating a
server certificate requires that OpenSSL is installed on the computer
running the server.
4. MySQL
If you wish to use MySQL you first need to install the Python MySQL connector library available at
https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-py3_2.1.3-1ubuntu14.04_all.deb
You then pass the -mysql flag to ./cado-nfs.py