python 带有 fortran 扩展的包的 conda-forge 配方不适用于 appveyor

conda-forge recipe for python package with a fortran extension not working on appveyor

我正在尝试获取 conda-build 配方以通过 conda-forge/staged-recipes 上的所有 CI 测试。这是一个 link 到 pull request The python package has a fortran extension and uses numpy.distutils in the setup.py 构建扩展。为 Linux 圈出 CI,为 OSX 圈出 Travis-CI,但我无法让 Windows 的 Appveyor 使用 conda-build 配方。

当使用 Miniconda 为 Windows and Travis CI build for OSX and Linux 的 Appveyor 构建包 repo 时,一切正常,测试通过。我还可以让 conda-build 配方在 Windows 和 Linux 上本地工作,但正如您从 conda-forge 的拉取请求中看到的那样,Windows 的测试未通过使用应用程序。

导入测试无法加载 ImportError: DLL load failed: The specified module cannot be found. 的 Fortran 扩展 扩展模块被复制到站点包目录 copying build\lib.win-amd64-3.6\timml\besselaesnew.cp36-win_amd64.pyd C:\bld\timml_1541596078787\_h_env\Lib\site-packages\timml,所以我很困惑为什么找不到它。我 read about the differences between .pyd and dll, and tried --compiler=mingw32 instead of --compiler=msvc as mentioned . That still didn't work. I also added zlib to the host and run section, after reading this 但这没有帮助。

任何获得 python 包的 conda-build 配方的提示都将不胜感激。 windows 的 setup.py 文件中的编译器参数被复制到下面以防万一。

if os.name == "nt": compile_args = ["-static-libgcc", "-Wall", "-shared"]

问题在于 dll 和 .pyd 文件以及编译器规范之间的差异。看了conda-forge-pinningconda_build_config.yaml,选择mingw而不是msvc的方法是:

requirements:
  build:
    - {{ compiler('fortran') }}
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('m2w64_fortran') }}  # [win]