0

我正在尝试获得一个 conda-build 配方以通过 conda-forge/staged-recipes 上的所有 CI 测试。这是拉取请求的链接 python 包有一个 fortran 扩展,并使用setup.py中的 numpy.distutils来构建扩展。Linux 的 Circle CI,OSX 的 Travis-CI 通过,但我无法让 Appveyor for Windows 使用 conda-build 配方。

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

导入测试无法加载 fortran 扩展,ImportError: DLL load failed: The specified module cannot be found.扩展模块被复制到站点包目录copying build\lib.win-amd64-3.6\timml\besselaesnew.cp36-win_amd64.pyd C:\bld\timml_1541596078787\_h_env\Lib\site-packages\timml,所以我很难过为什么找不到它。我阅读了 .pyd 和 dll 之间的区别,并尝试了这里提到--compiler=mingw32的而不是。那仍然没有用。在阅读了这篇文章之后,我还添加了主机和运行部分,但没有帮助。--compiler=msvczlib

任何获得 Python 包的 conda-build 配方以及在 Appveyor 上工作的 fortran 扩展的提示将不胜感激。windows 文件中的编译器参数在setup.py下面复制,以防万一。

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

4

1 回答 1

0

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

requirements:
  build:
    - {{ compiler('fortran') }}
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('m2w64_fortran') }}  # [win]
于 2018-11-10T03:05:06.717 回答