conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
152 stars 183 forks source link

mpich not showing up in ci support file #1600

Closed beckermr closed 2 years ago

beckermr commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

This recipe doesn't appear to be rendered properly or our docs on mpi are wrong:

{% set name = "cosmosis" %}
{% set version = "0.5.16" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url:  https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: bfab54a67338b2db80017b69ca60728893d8622cfe3933b1dc7539cb0cd35d09

build:
  number: 2
  skip: True  # [(py < 36) or win]
  script:   "{{ PYTHON }} -m pip install . -vv"

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('fortran') }}
    - {{ compiler('cxx') }}
    - make
    - llvm-openmp  # [osx]
    - libgomp      # [linux]    
  host:
    - python
    - pip
    - wheel
    - {{ mpi }}
    - liblapack
    - libblas
    - minuit2_standalone
  run:
    # core
    - python
    - mpi4py
    - matplotlib-base
    - future
    - numpy
    - pip
    - pybind11
    - pyyaml
    - scipy
    - setuptools
    - threadpoolctl
    - git
    # for samplers
    - emcee
    - dynesty
    - minuit2_standalone
    - zeus-mcmc

test:
  imports:
    - cosmosis
  commands:
    - test -f ${SP_DIR}/cosmosis/samplers/multinest/multinest_src/libnest3.so
    - test -f ${SP_DIR}/cosmosis/samplers/multinest/multinest_src/libnest3_mpi.so
    - test -f ${SP_DIR}/cosmosis/samplers/polychord/polychord_src/libchord.so
    - test -f ${SP_DIR}/cosmosis/samplers/polychord/polychord_src/libchord_mpi.so
    - source cosmosis-configure && pytest --pyargs cosmosis
  requires:
    - pytest

about:
  home: https://github.com/joezuntz/cosmosis
  license: BSD-2-Clause AND LicenseRef-non-commerical-use-only
  license_family: BSD
  license_file:
    - LICENSE
    - cosmosis/samplers/multinest/multinest_src/LICENCE
    - cosmosis/samplers/polychord/polychord_src/LICENCE

  summary: The Cosmological Survey Inference System
  description: |
    CosmoSIS is a framework designed primarily for cosmological
    parameter estimation.
  doc_url: https://cosmosis.readthedocs.io/
  dev_url: https://github.com/joezuntz/cosmosis

extra:
  recipe-maintainers:
    - joezuntz

The ci support file is

c_compiler:
- gcc
c_compiler_version:
- '10'
cdt_name:
- cos6
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- gxx
cxx_compiler_version:
- '10'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
fortran_compiler:
- gfortran
fortran_compiler_version:
- '10'
libblas:
- 3.8 *netlib
liblapack:
- 3.8 *netlib
mpi:
- mpich
pin_run_as_build:
  python:
    min_pin: x.x
    max_pin: x.x
python:
- 3.10.* *_cpython
target_platform:
- linux-64
zip_keys:
- - c_compiler_version
  - cxx_compiler_version
  - fortran_compiler_version

I don't see the mpich pin at 3 there and I think it should be. We haven't shipped a new major MPI version in a long time and so this bug has been silent.

Installed packages

https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=467822&view=logs&j=4f922444-fdfe-5dcf-b824-02f86439ef14&t=b2a8456a-fb11-5506-ca32-5ccd32538dc0&l=169

Environment info

https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=467822&view=logs&j=4f922444-fdfe-5dcf-b824-02f86439ef14&t=b2a8456a-fb11-5506-ca32-5ccd32538dc0&l=350
beckermr commented 2 years ago

conda render works correctly if the pin in present, so this is a bug in smithy itself.

beckermr commented 2 years ago

According to @isuruf we need to change smithy to take two passes at recipes to pull out all pins, variables, etc. instead of the one pass it does now. IDK exactly where to make the change yet.

isuruf commented 2 years ago

I think this is as simple as adding mpich and openmpi to the all_used_vars set if meta.get_used_vars() include mpi. See https://github.com/conda-forge/conda-smithy/blob/main/conda_smithy/configure_feedstock.py#L273