Update documentation for new Python configuration options

This commit is contained in:
Bryan W. Weber 2017-11-12 09:17:57 -05:00 committed by Ray Speth
parent 2bc4d09da3
commit 6ca67b4845
4 changed files with 100 additions and 30 deletions

View file

@ -329,14 +329,16 @@ config_options = [
defaults.prefix, PathVariable.PathAccept),
EnumVariable(
'python_package',
"""If you plan to work in Python 2, then you need the 'full' Cantera Python
"""If you plan to work in Python, then you need the ``full`` Cantera Python
package. If, on the other hand, you will only use Cantera from some
other language (e.g. MATLAB or Fortran 90/95) and only need Python
to process CTI files, then you only need a 'minimal' subset of the
package and Cython and NumPy are not necessary. The 'none' option
doesn't install any components of the Python interface. The 'default'
behavior is to build the full Python 2 module if the required
prerequisites (NumPy and Cython) are installed.""",
to process CTI files, then you only need a ``minimal`` subset of the
package and Cython and NumPy are not necessary. The ``none`` option
doesn't install any components of the Python interface. The default
behavior is to build the full Python module for whichever version of
Python is running SCons if the required prerequisites (NumPy and
Cython) are installed. Note: ``y`` is a synonym for ``full`` and ``n``
is a synonym for ``none``.""",
'default', ('new', 'full', 'minimal', 'none', 'n', 'y', 'default')),
PathVariable(
'python_cmd',
@ -386,7 +388,7 @@ config_options = [
the empty string or the 'prefix' option is not set, then the package
will be installed to the system default 'site-packages' directory.
To install to the current user's 'site-packages' directory, use
'python_prefix=USER'.""",
'python2_prefix=USER'.""",
defaults.python_prefix, PathVariable.PathAccept),
EnumVariable(
'python3_package',
@ -415,7 +417,7 @@ config_options = [
the empty string or the 'prefix' option is not set, then the package
will be installed to the system default 'site-packages' directory.
To install to the current user's 'site-packages' directory, use
'python_prefix=USER'.""",
'python3_prefix=USER'.""",
defaults.python_prefix, PathVariable.PathAccept),
EnumVariable(
'matlab_toolbox',

View file

@ -76,15 +76,17 @@ Options List
.. _python-package:
* ``python_package``: [ ``new`` | ``full`` | ``minimal`` | ``none`` | ``default`` ]
If you plan to work in Python 2, then you need the ``full`` Cantera Python
* ``python_package``: [ ``y`` | ``n`` | ``full`` | ``minimal`` | ``none`` | ``default`` ]
If you plan to work in Python, then you need the ``full`` Cantera Python
package. If, on the other hand, you will only use Cantera from some
other language (e.g. MATLAB or Fortran 90/95) and only need Python
to process CTI files, then you only need a ``minimal`` subset of the
package and Cython and NumPy are not necessary. The ``none`` option
doesn't install any components of the Python interface. The default
behavior is to build the full Python 2 module if the required
prerequisites (NumPy and Cython) are installed.
behavior is to build the full Python module for whichever version of
Python is running SCons if the required prerequisites (NumPy and
Cython) are installed. Note: ``y`` is a synonym for ``full`` and ``n``
is a synonym for ``none``.
- default: ``'default'``
@ -101,14 +103,14 @@ Options List
* ``python_array_home``: [ ``/path/to/python_array_home`` ]
If NumPy was installed using the ``--home`` option, set this to the home
directory for NumPy for Python 2.
directory for NumPy for Python.
- default: ``''``
.. _python-prefix:
* ``python_prefix``: [ ``/path/to/python_prefix`` ]
Use this option if you want to install the Cantera Python 2 package to
Use this option if you want to install the Cantera Python package to
an alternate location. On Unix-like systems, the default is the same
as the ``prefix`` option. If the ``python_prefix`` option is set to
the empty string or the ``prefix`` option is not set, then the package
@ -118,9 +120,50 @@ Options List
- default: ``''``
.. _python2-package:
* ``python2_package``: [ ``y`` | ``n`` | ``full`` | ``minimal`` | ``none`` | ``default`` ]
Controls whether or not the Python 2 module will be built. By
default, the module will be built if the Python 2 interpreter
and the required dependencies (NumPy for Python 2 and Cython
for the version of Python for which SCons is installed) can be
found.
- default: ``'default'``
.. _python2-cmd:
* ``python2_cmd``: [ ``/path/to/python2_cmd`` ]
The path to the Python 2 interpreter. The default is
``python2``; if this executable cannot be found, this
value must be specified to build the Python 2 module.
- default: ``'python2'``
.. _python2-array-home:
* ``python2_array_home``: [ ``/path/to/python2_array_home`` ]
If NumPy was installed using the ``--home`` option, set this to the home
directory for NumPy for Python 2.
- default: ``''``
.. _python2-prefix:
* ``python2_prefix``: [ ``/path/to/python2_prefix`` ]
Use this option if you want to install the Cantera Python 2 package to
an alternate location. On Unix-like systems, the default is the same
as the ``prefix`` option. If the ``python_prefix`` option is set to
the empty string or the ``prefix`` option is not set, then the package
will be installed to the system default ``site-packages`` directory.
To install to the current user's ``site-packages`` directory, use
``python2_prefix=USER``.
- default: ``''``
.. _python3-package:
* ``python3_package``: [ ``y`` | ``n`` | ``default`` ]
* ``python3_package``: [ ``y`` | ``n`` | ``full`` | ``minimal`` | ``none`` | ``default`` ]
Controls whether or not the Python 3 module will be built. By
default, the module will be built if the Python 3 interpreter
and the required dependencies (NumPy for Python 3 and Cython
@ -155,7 +198,7 @@ Options List
the empty string or the ``prefix`` option is not set, then the package
will be installed to the system default ``site-packages`` directory.
To install to the current user's ``site-packages`` directory, use
``python_prefix=USER``.
``python3_prefix=USER``.
- default: ``''``

View file

@ -54,33 +54,58 @@ Common Options
* :ref:`sundials_include <sundials-include>`
* :ref:`sundials_libdir <sundials-libdir>`
Python 2 Module Options
^^^^^^^^^^^^^^^^^^^^^^^
General Python Module Options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, SCons will attempt to build the Cython-based Python module for
Python 2, if both Numpy and Cython are installed. The following options control
how the Python 2 module is built:
By default, SCons will try to build the full Python interface for
whichever version of Python is running SCons. This requires that
NumPy is installed for that version of Python, and that Cython is
installed for whichever Python is running SCons. The following SCons
options control how the Python module is built:
* :ref:`python_cmd <python-cmd>`
* :ref:`python_package <python-package>`
* :ref:`python_prefix <python-prefix>`
Note that these general options should not be used at the same time
as the Python-version specific options discussed below. If SCons
detects that it is being run with Python 2, and the
:ref:`python2_package <python2-package` option is set, the build will
raise an error and exit; or if SCons detects that it is being run with
Python 3, and the :ref:`python3_package <python3-package` option is
set, the build will raise an error and exit.
If a user wishes to build multiple Python interfaces, or a Python
interface for the version of Python that is not running SCons, they
should use the version-specific options below, and set the
:ref:`python_package <python-package>` option to ``none``.
Python 2 Module Options
^^^^^^^^^^^^^^^^^^^^^^^
By default, if SCons detects a Python 2 interpreter installed in a
default location (i.e., ``python2`` is on the ``PATH`` environment
variable) or ``python2_package`` is ``full``, SCons will try to build
the Python module for Python 2. The following SCons options control how
the Python 2 module is built:
* :ref:`python2_cmd <python2-cmd>`
* :ref:`python2_package <python2-package>`
* :ref:`python2_prefix <python2-prefix>`
Python 3 Module Options
^^^^^^^^^^^^^^^^^^^^^^^
If SCons detects a Python 3 interpreter installed in a default location
(i.e., ``python3`` is on the ``PATH`` environment variable) or
``python3_package`` is ``y``, SCons will try to build the Python module
for Python 3. The following SCons options control how the Python 3 module is
built:
By default, if SCons detects a Python 3 interpreter installed in a
default location (i.e., ``python3`` is on the ``PATH`` environment
variable) or ``python3_package`` is ``full``, SCons will try to build
the Python module for Python 3. The following SCons options control how
the Python 3 module is built:
* :ref:`python3_cmd <python3-cmd>`
* :ref:`python3_package <python3-package>`
* :ref:`python3_prefix <python3-prefix>`
Note that even when building the Python 3 Cantera module, you should still use
Python 2 with SCons, as SCons does not currently support Python 3.
Windows Only Options
^^^^^^^^^^^^^^^^^^^^

View file

@ -48,5 +48,5 @@ Intel Compilers
Another option is to set the :ref:`prefix <prefix>` option to a directory
for which you have write permissions, and specify the ``USER`` value to the
:ref:`python_prefix <python-prefix>` or :ref:`python3_prefix <python3-prefix>`
:ref:`python2_prefix <python2-prefix>` or :ref:`python3_prefix <python3-prefix>`
option.