Skip to content

Commit

Permalink
Per #2388, add MET_PYTHON_BIN_EXE to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Jan 12, 2023
1 parent ba40fb9 commit 7081535
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/Users_Guide/appendixF.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ In order to use Python embedding, the user's local Python installation must have

The local Python installation must also support a minimum set of required packages. The MET build includes some python wrapper scripts to facilitate the passing of data in memory as well as the reading and writing of temporary files. The packages required by those wrapper scripts are **sys, os, argparse, importlib, numpy and netCDF4**. While most of these are standard packages and readily available, numpy and netCDF4 may not be. Users are advised to confirm their availability prior to compiling MET with python embedding support.

In addition to the **configure** option mentioned above, two variables, **MET_PYTHON_CC** and **MET_PYTHON_LD**, must also be set for the configuration process. These may either be set as environment variables or as command line options to **configure**. These constants are passed as compiler command line options when building MET to enable the compiler to find the requisite Python header files and libraries in the user's local filesystem. Fortunately, Python provides a way to set these variables properly. This frees the user from the necessity of having any expert knowledge of the compiling and linking process. Along with the **Python** executable, there should be another executable called **python3-config**, whose output can be used to set these environment variables as follows:
In addition to the **configure** option mentioned above, three variables, **MET_PYTHON_BIN_EXE**, **MET_PYTHON_CC**, and **MET_PYTHON_LD**, must also be set for the configuration process. These may either be set as environment variables or as command line options to **configure**. These constants are passed as compiler command line options when building MET to enable the compiler to find the requisite Python executable, header files, and libraries in the user's local filesystem. Fortunately, Python provides a way to set these variables properly. This frees the user from the necessity of having any expert knowledge of the compiling and linking process. Along with the **Python** executable, there should be another executable called **python3-config**, whose output can be used to set these environment variables as follows:

• Set **MET_PYTHON_BIN_EXE** to the full path of the desired python executable.

• On the command line, run "**python3-config --cflags**". Set the value of **MET_PYTHON_CC** to the output of that command.

Expand Down
3 changes: 2 additions & 1 deletion docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ The following environment variables should also be set:

* If compiling support for GRIB2, set $MET_GRIB2CINC and $MET_GRIB2CLIB to point to the main GRIB2C directory which contains both the include and library files. These are used instead of $MET_GRIB2C since the main GRIB2C directory does not contain include and lib subdirectories.

* If compiling support for PYTHON, set $MET_PYTHON_CC and $MET_PYTHON_LD to specify the compiler (-I) and linker (-L) flags required for python. Set $MET_PYTHON_CC for the directory containing the "Python.h" header file. Set $MET_PYTHON_LD for the directory containing the python library file and indicate the name of that file. For example:
* If compiling support for PYTHON, set $MET_PYTHON_BIN_EXE to specify the desired python executable to be used. Also set $MET_PYTHON_CC, and $MET_PYTHON_LD to specify the compiler (-I) and linker (-L) flags required for python. Set $MET_PYTHON_CC for the directory containing the "Python.h" header file. Set $MET_PYTHON_LD for the directory containing the python library file and indicate the name of that file. For example:

.. code-block:: none
MET_PYTHON_BIN_EXE='/usr/bin/python3.6'
MET_PYTHON_CC='-I/usr/include/python3.6'
MET_PYTHON_LD='-L/usr/lib/python3.6/config-x86_64-linux-gnu -lpython3.6m'
Expand Down

0 comments on commit 7081535

Please sign in to comment.