python - Conda-forge 包构建失败:需要 CC,但即使添加了编译器也找不到
问题描述
我想为https://github.com/uber/h3-py创建一个 conda-forge 包,并按照https://conda-forge.org/docs/maintainer/adding_pkgs.html#staging-test 的说明进行操作-本地。
配方可以在这里找到:https ://github.com/geoHeil/staged-recipes/blob/h3-py/recipes/h3/meta.yaml
尝试使用以下命令执行本地构建时:
/.circleci/run_docker_build.sh
它失败了:
echo 'cc required but not found.'
meta.yml 的重要部分如下所示:
requirements:
build:
# If your project compiles code (such as a C extension) then add the required compilers as separate entries here.
# Compilers are named 'c', 'cxx' and 'fortran'.
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake
- make
host:
- python
- pip
run:
- python
我怎样才能让它工作以将其提交给 conda-forge?
cc
是对编译器的一般参考,如何在不分叉源存储库/及其安装脚本的情况下将这样的参考/符号链接添加到 conda 提供的 c、c++ 编译器(可能是 cxx/gcc)?
不应该
- {{ compiler('c') }}
- {{ compiler('cxx') }}
添加这个?
该错误是由https://github.com/uber/h3-py/blob/master/.install.sh#L25引起的
command -v cc >/dev/null 2>&1 || { echo "cc required but not found."; exit 1; }
解决方案
我必须创建一个自定义 build.sh 文件:
where 而不是依赖 some $CC
,cmake
自动使用正确的环境。https://github.com/conda-forge/staged-recipes/pull/8467/files
推荐阅读
- c - 是否可以从输出行的中间删除一个字符而不删除它后面的字符?
- windows - Windows Ffmpeg - 将音频发送到声卡的输出
- r - 从同一列表的元素中查找零位置的不匹配
- javascript - 如何使用 Javascript 移动带有箭头的元素
- python - 在 Pandas 中使用 fillna() 和 lambda 函数替换 NaN 值
- android - 无法加载 config.js
- actions-on-google - Google Assistant SDK - 操作从 SQL Server 获取信息
- node.js - 角度图像未从 nodejs 后端正确提供
- android - 转换异常 - AndroidJUnitRunner 无法转换为 RoboMonitoringInstrumentation
- deployment - 如何在 terraform 文件中创建 terraform azure 远程状态基础设施?