0

I want to create a conda-forge package for https://github.com/uber/h3-py and have followed the instructions of https://conda-forge.org/docs/maintainer/adding_pkgs.html#staging-test-locally.

The recipe can be found here: https://github.com/geoHeil/staged-recipes/blob/h3-py/recipes/h3/meta.yaml

When trying to execute a local build using:

/.circleci/run_docker_build.sh

it fails with:

echo 'cc required but not found.'

Where the important part of the meta.yml looks like:

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

How can I get it to work to submit it to conda-forge?

cc is a general reference to a compiler, how can I add such a reference/symlink to the conda provided c, c++ compilers (presumably cxx/gcc) without forking the source repository /and their installation script?

Shouldn't

- {{ compiler('c') }}
- {{ compiler('cxx') }}

add this?

The error is caused from 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; }
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
  • Possible duplicate of https://stackoverflow.com/questions/45866648/conda-build-unsatisfiable-dependencies-error-with-pint - Please check that out and I'll take a look if it doesn't answer your problem. – lucasgcb May 28 '19 at 11:37
  • No, I have: `cc required but not found` which does not look like a duplicate to me. – Georg Heiler May 28 '19 at 11:39
  • 1
    Okay, and what is `cc` exactly, and why is it invoked? I cannot exactly find this program either. Would you mean `gcc` by any chance? – lucasgcb May 28 '19 at 11:54
  • It originates from https://github.com/uber/h3-py/blob/master/.install.sh#L25 and might be a short name for gcc, but I thought that `{{ compiler('c') }}` would add gcc. How could I add gcc if this doesn't already happen? – Georg Heiler May 28 '19 at 12:05
  • According to https://stackoverflow.com/questions/1516609/difference-between-cc-gcc-and-g, `On Linux, if it exists, CC is probably a link to g++.` So how can I get g++ into the yml file? – Georg Heiler May 28 '19 at 12:23
  • `cc` would be pointing to the default C compiler in that case, ironically enough it is probably there in the script specifically so there isn't this sort of issue: Keep in mind the error message comes from a return value treatment, so maybe something else is returning an ok value but throwing the script off. Assuming the docker image you are using simply doesn't have this link; I would try replacing `cc` with `gcc` in that install script. For `g++` try `g++`. – lucasgcb May 28 '19 at 12:31
  • Can I add a command to the `meta.yml` file to create this link for me? Or where would I put my custom install script? Looking at the logs lit seems like it is checked out from github and using https://github.com/uber/h3-py/blob/master/.install.sh, so how could I overwrite it without also forking that repository? – Georg Heiler May 28 '19 at 12:33
  • I would fork it and update whatever reference to their repo as the fork instead, with the modified installscript. This is a local install, right? or are you getting circle-ci to build it? Maybe cc even already exists, it's just that the return value for it is doing something else; perhaps open an issue in their repo for clarification or even an improvement. – lucasgcb May 28 '19 at 12:42
  • I believe `conda` compilers are using `$CC` env var, so you could try to patch the install script accordingly. Otherwise, just create a PR on conda-forge and ask for assistance there. People from the core team should be able to help since they experienced similar issues during the migration to new compilers last year. – FabienP May 28 '19 at 20:40
  • I did both: https://github.com/conda-forge/staged-recipes/pull/8467 this is now compiling successfully, but it fails when trying to package as the output is not found. – Georg Heiler May 29 '19 at 04:05

1 Answers1

0

I had to create a custom build.sh file:

where instead of relying on some $CC, cmake automatically uses the right environment. https://github.com/conda-forge/staged-recipes/pull/8467/files

Georg Heiler
  • 16,916
  • 36
  • 162
  • 292