{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "f2py:buildtools:distutils",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "numpy.distutils",
              "domain": null,
              "role": "mod",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is part of NumPy, and extends the standard Python "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "distutils"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " module to deal with Fortran sources and F2PY signature files, e.g. compile Fortran sources, call F2PY to construct extension modules, etc."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "topic",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Example"
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Consider the following "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "setup_file.py"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " for the "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "fib"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " and "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "scalar"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " examples from "
                },
                {
                  "__type": "CrossRef",
                  "__tag": 4002,
                  "value": "f2py-getting-started",
                  "reference": {
                    "__type": "LocalRef",
                    "__tag": 4022,
                    "kind": "docs",
                    "path": "f2py:f2py.getting-started"
                  },
                  "kind": "exists"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " section:"
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Running"
                }
              ]
            },
            {
              "__type": "Code",
              "__tag": 4050,
              "value": "python setup_example.py build",
              "execution_status": null
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "will build two extension modules "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "scalar"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " and "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "fib2"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " to the build directory."
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Using via "
        },
        {
          "__type": "InlineRole",
          "__tag": 4003,
          "value": "numpy.distutils",
          "domain": null,
          "role": null,
          "inventory": null
        }
      ],
      "level": 0,
      "target": "f2py-distutils"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "numpy.distutils",
              "domain": null,
              "role": "mod",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " extends "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "distutils"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with the following features:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "Extension",
                      "domain": null,
                      "role": "class",
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " class argument "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "sources"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " may contain Fortran source   files. In addition, the list "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "sources"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " may contain at most one   F2PY signature file, and in this case, the name of an Extension module must   match with the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "<modulename>"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " used in signature file. It is   assumed that an F2PY signature file contains exactly one "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "python   module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " block."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "sources"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " do not contain a signature file, then F2PY is used to scan   Fortran source files to construct wrappers to the Fortran codes."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Additional options to the F2PY executable can be given using the   "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "Extension",
                      "domain": null,
                      "role": "class",
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " class argument "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f2py_options"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The following new "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "distutils"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " commands are defined:"
                    }
                  ]
                },
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "build_src"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "to construct Fortran wrapper extension modules, among many other things."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "config_fc"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "to change Fortran compiler options."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Additionally, the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "build_ext"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "build_clib"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " commands are also enhanced   to support Fortran sources."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Run"
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "python <setup.py file> config_fc build_src build_ext --help",
                  "execution_status": null
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "to see available options for these commands."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "When building Python packages containing Fortran sources, one   can choose different Fortran compilers by using the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "build_ext"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "   command option "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "--fcompiler=<Vendor>"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Here "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "<Vendor>"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " can be one of the   following names (on "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "linux"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " systems)      "
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "absoft compaq fujitsu g95 gnu gnu95 intel intele intelem lahey nag nagfor nv pathf95 pg vast",
                  "execution_status": null
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "See "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "numpy_distutils/fcompiler.py"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for an up-to-date list of   supported compilers for different platforms, or run"
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "python -m numpy.f2py -c --backend distutils --help-fcompiler",
                  "execution_status": null
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Extensions to "
        },
        {
          "__type": "InlineCode",
          "__tag": 4051,
          "value": "distutils"
        }
      ],
      "level": 1,
      "target": null
    }
  ],
  "local_refs": []
}