{
  "__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:windows:index",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "warning",
          "base_type": "warning",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "warning "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "F2PY support for Windows is not always at par with Linux support"
                }
              ]
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "note",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "note "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Link",
                  "__tag": 4049,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "SciPy's documentation"
                    }
                  ],
                  "url": "https://scipy.github.io/devdocs/building/index.html#system-level-dependencies",
                  "title": ""
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " has some information on system-level dependencies which are well tested for Fortran as well."
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Broadly speaking, there are two issues working with F2PY on Windows:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the lack of actively developed FOSS Fortran compilers, and,"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the linking issues related to the C runtime library for building Python-C extensions."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The focus of this section is to establish a guideline for developing and extending Fortran modules for Python natively, via F2PY on Windows."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Currently supported toolchains are:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Mingw-w64 C/C++/Fortran compilers"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Intel compilers"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Clang-cl + Flang"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "MSVC + Flang"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "F2PY and Windows"
        }
      ],
      "level": 0,
      "target": "f2py-windows"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "From a user perspective, the most UNIX compatible Windows development environment is through emulation, either via the Windows Subsystem on Linux, or facilitated by Docker. In a similar vein, traditional virtualization methods like VirtualBox are also reasonable methods to develop UNIX tools on Windows."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Native Windows support is typically stunted beyond the usage of commercial compilers. However, as of 2022, most commercial compilers have free plans which are sufficient for general use. Additionally, the Fortran language features supported by "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (partial coverage of Fortran 2003), means that newer toolchains are often not required. Briefly, then, for an end user, in order of use:"
            }
          ]
        },
        {
          "__type": "DefList",
          "__tag": 4033,
          "children": [
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Classic Intel Compilers (commercial)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "These are maintained actively, though licensing restrictions may apply as    further detailed in "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "f2py-win-intel",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:windows:intel"
                      },
                      "kind": "exists"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Suitable for general use for those building native Windows programs by    building off of MSVC."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "MSYS2 (FOSS)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "In conjunction with the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "mingw-w64"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " project, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "gfortran"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "gcc"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "    toolchains can be used to natively build Windows programs."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Windows Subsystem for Linux"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Assuming the usage of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "gfortran"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", this can be used for cross-compiling    Windows applications, but is significantly more complicated."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Conda"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Windows support for compilers in "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "conda"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is facilitated by pulling MSYS2    binaries, however these "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "are outdated"
                        }
                      ],
                      "url": "https://github.com/conda-forge/conda-forge.github.io/issues/1044",
                      "title": ""
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and therefore not recommended (as of 30-01-2022)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "PGI Compilers (commercial)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Unmaintained but sufficient if an existing license is present. Works    natively, but has been superseded by the Nvidia HPC SDK, with no "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "native    Windows support",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Cygwin (FOSS)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Can also be used for "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "gfortran"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". However, the POSIX API compatibility layer provided by    Cygwin is meant to compile UNIX software on Windows, instead of building    native Windows programs. This means cross compilation is required."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The compilation suites described so far are compatible with the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "now deprecated"
                }
              ],
              "url": "https://github.com/numpy/numpy/pull/20875",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "np.distutils"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " build backend which is exposed by the F2PY CLI. Additional build system usage ("
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "meson"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "cmake"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ") as described in "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "f2py-bldsys",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "f2py:buildtools:index"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " allows for a more flexible set of compiler backends including:"
            }
          ]
        },
        {
          "__type": "DefList",
          "__tag": 4033,
          "children": [
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Intel oneAPI"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The newer Intel compilers ("
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "ifx"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "icx"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") are based on LLVM and can be    used for native compilation. Licensing requirements can be onerous."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "Classic Flang (FOSS)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The backbone of the PGI compilers were cannibalized to form the \"classic\" or    "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "legacy version of Flang"
                        }
                      ],
                      "url": "https://github.com/flang-compiler/flang",
                      "title": ""
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". This may be compiled from source and used    natively. "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "LLVM Flang"
                        }
                      ],
                      "url": "https://releases.llvm.org/11.0.0/tools/flang/docs/ReleaseNotes.html",
                      "title": ""
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " does not support Windows yet (30-01-2022)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "LFortran (FOSS)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "One of two LLVM based compilers. Not all of F2PY supported Fortran can be    compiled yet (30-01-2022) but uses MSVC for native linking."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Overview"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For this document we will assume the following basic tools:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The IDE being considered is the community supported "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Microsoft Visual Studio Code"
                        }
                      ],
                      "url": "https://code.visualstudio.com/Download",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The terminal being used is the "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Windows Terminal"
                        }
                      ],
                      "url": "https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The shell environment is assumed to be "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "Powershell 7.x"
                        }
                      ],
                      "url": "https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.1",
                      "title": ""
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "Python 3.10 from "
                          },
                          {
                            "__type": "Link",
                            "__tag": 4049,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "the Microsoft Store"
                              }
                            ],
                            "url": "https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5",
                            "title": ""
                          },
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": " and this can be tested with"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "Get-Command python.exe"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " resolving to    "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "C:\\Users\\$USERNAME\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The Microsoft Visual C++ (MSVC) toolset"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "With this baseline configuration, we will further consider a configuration matrix as follows:"
            }
          ]
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "table-f2py-winsup-mat"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For an understanding of the key issues motivating the need for such a matrix "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Pauli Virtanen's in-depth post on wheels with Fortran for Windows"
                }
              ],
              "url": "https://pav.iki.fi/blog/2017-10-08/pywingfortran.html#building-python-wheels-with-fortran-for-windows",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is an excellent resource. An entertaining explanation of an application binary interface (ABI) can be found in this post by "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "JeanHeyd Meneide"
                }
              ],
              "url": "https://thephd.dev/binary-banshees-digital-demons-abi-c-c++-help-me-god-please",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Baseline"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "MSVC is installed either via the Visual Studio Bundle or the lighter (preferred) "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Build Tools for Visual Studio"
                }
              ],
              "url": "https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "Desktop development with C++"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " setting."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "note",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "note "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "This can take a significant amount of time as it includes a download of around 2GB and requires a restart."
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "It is possible to use the resulting environment from a "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "standard command prompt"
                }
              ],
              "url": "https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160#developer_command_file_locations",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". However, it is more pleasant to use a "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "developer powershell"
                }
              ],
              "url": "https://docs.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2019",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", with a "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "profile in Windows Terminal"
                }
              ],
              "url": "https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/add-developer-powershell-and-developer-command-prompt-for-visual/ba-p/2243078",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". This can be achieved by adding the following block to the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "profiles->list"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " section of the JSON file used to  configure Windows Terminal (see "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "Settings->Open JSON file"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "):"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "{\n\"name\": \"Developer PowerShell for VS 2019\",\n\"commandline\": \"powershell.exe -noe -c \\\"$vsPath = (Join-Path ${env:ProgramFiles(x86)} -ChildPath 'Microsoft Visual Studio\\\\2019\\\\BuildTools'); Import-Module (Join-Path $vsPath 'Common7\\\\Tools\\\\Microsoft.VisualStudio.DevShell.dll'); Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation\\\"\",\n\"icon\": \"ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png\"\n}",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Now, testing the compiler toolchain could look like:"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "# New Windows Developer Powershell instance / tab\n# or\n$vsPath = (Join-Path ${env:ProgramFiles(x86)} -ChildPath 'Microsoft Visual Studio\\\\2019\\\\BuildTools'); \nImport-Module (Join-Path $vsPath 'Common7\\\\Tools\\\\Microsoft.VisualStudio.DevShell.dll');\nEnter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation\n**********************************************************************\n** Visual Studio 2019 Developer PowerShell v16.11.9\n** Copyright (c) 2021 Microsoft Corporation\n**********************************************************************\ncd $HOME\necho \"#include<stdio.h>\" > blah.cpp; echo 'int main(){printf(\"Hi\");return 1;}' >> blah.cpp\ncl blah.cpp",
          "execution_status": null
        },
        {
          "__type": "DefList",
          "__tag": 4033,
          "children": [
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "\\blah.exe"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "# Hi    rm blah.cpp"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "It is also possible to check that the environment has been updated correctly with "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "$ENV:PATH"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "PowerShell and MSVC"
        }
      ],
      "level": 1,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The MS Windows version of Python discussed here installs to a non-deterministic path using a hash. This needs to be added to the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "PATH"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " variable."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "$Env:Path += \";$env:LOCALAPPDATA\\packages\\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\\localcache\\local-packages\\python310\\scripts\"",
          "execution_status": null
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY and Windows Intel Fortran",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:windows:intel"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY and Windows with MSYS2",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:windows:msys2"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY and Conda on Windows",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:windows:conda"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY and PGI Fortran on Windows",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:windows:pgi"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "the Microsoft Store"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Microsoft Visual Studio Code"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "more complete POSIX environment"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "This MSYS2 document"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Build Tools for Visual Studio"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Windows Terminal"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Powershell 7.x"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "standard command prompt"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "developer powershell"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "profile in Windows Terminal"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Pauli Virtanen's in-depth post on wheels with Fortran for Windows"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Nvidia HPC SDK"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "JeanHeyd Meneide"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "legacy version of Flang"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "native Windows support"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "are outdated"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "now deprecated"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "LLVM Flang"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "SciPy's documentation"
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Microsoft Store Python paths"
        }
      ],
      "level": 1,
      "target": null
    }
  ],
  "local_refs": []
}