{% set version = "3.2.1" %}

package:
  # must not match any outputs for requirements to be handled correctly
  name: mpich-mpi
  version: {{ version }}

source:
    fn: mpich-{{ version }}.tar.gz
    url: http://www.mpich.org/static/downloads/{{ version }}/mpich-{{ version }}.tar.gz
    sha256: 5db53bf2edfaa2238eb6a0a5bc3d2c2ccbfbb1badd79b664a1a919d2ce2330f1

build:
    number: 8
    skip: True  # [win]

outputs:
  - name: mpich
    script: build-mpich.sh
    build:
      run_exports:
        - {{ pin_subpackage('mpich', min_pin='x.x', max_pin='x.x') }}
    requirements:
      build:
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}
        - {{ compiler('fortran') }}
      host: []
      run:
        - mpi 1.0 mpich
    test:
      script: run_test.sh
      files:
        - tests/test_exec.py
      requires:
        - python >=3

  - name: mpi
    version: 1.0
    build:
      string: mpich

  - name: mpich-mpicc
    build:
      script:
        - echo 'ok'  # [not osx]
        # make CONDA_BUILD_SYSROOT a 'used variable'
        # so that conda-build knows to pass it to the test env
        - echo "{{CONDA_BUILD_SYSROOT}}"  # [osx]
    requirements:
      run:
        - {{ pin_subpackage('mpich', exact=True) }}
        # host C compilers work fine (better) on mac
        - {{ compiler('c') }}
    test:
      script: run_test.sh
      files:
        - tests/helloworld.c

  - name: mpich-mpicxx
    build:
      script:
        - echo 'ok'  # [not osx]
        # make CONDA_BUILD_SYSROOT a 'used variable'
        # so that conda-build knows to pass it to the test env
        - echo "{{CONDA_BUILD_SYSROOT}}"  # [osx]
    requirements:
      run:
        - {{ pin_subpackage('mpich', exact=True) }}
        # host C compilers work fine (better) on mac
        - {{ compiler('cxx') }}
    test:
      script: run_test.sh
      files:
        - tests/helloworld.cxx

  - name: mpich-mpifort
    build:
      script:
        - echo 'ok'  # [not osx]
        # make CONDA_BUILD_SYSROOT a 'used variable'
        # so that conda-build knows to pass it to the test env
        - echo "{{CONDA_BUILD_SYSROOT}}"  # [osx]
    requirements:
      run:
        - {{ pin_subpackage('mpich', exact=True) }}
        - {{ compiler('fortran') }}
    test:
      script: run_test.sh
      files:
        - tests/helloworld.f
        - tests/helloworld.f90

about:
    home: http://www.mpich.org/
    license: MPICH
    license_file: COPYRIGHT
    license_family: Other
    summary: 'A high performance widely portable implementation of the MPI standard.'
    description: |
      MPICH is a high performance and widely portable implementation of the
      Message Passing Interface (MPI) standard.
    doc_url: http://www.mpich.org/documentation/guides
    dev_url: https://wiki.mpich.org/mpich/index.php/Main_Page

extra:
    recipe-maintainers:
        - astrofrog-conda-forge
        - bekozi
        - dalcinl
        - minrk
        - msarahan
        - ocefpaf
        - rainwoodman
