{% set name = "coin-or-utils" %}
{% set version = "2.11.6" %}

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

source:
  url: https://github.com/coin-or/CoinUtils/archive/releases/{{ version }}.tar.gz
  sha256: 6ea31d5214f7eb27fa3ffb2bdad7ec96499dd2aaaeb4a7d0abd90ef852fc79ca

build:
  number: 0
  skip: True # [blas_impl == "mkl"]
  run_exports:
    - {{ pin_subpackage(name, min_pin='x.x', max_pin='x.x') }}

requirements:
  build:
    - gnuconfig  # [unix]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ compiler('fortran') }}
    - pkg-config
    - make  # [unix]
  host:
    - zlib
    - bzip2
    # OpenBLAS
    - openblas {{ openblas }}         # [blas_impl == "openblas"]
    # For openblas on win and linux, we don't specify any openmp implementation; it comes from the compiler.
  run:
    # OpenBLAS
    - libopenblas                     # [blas_impl == "openblas"]
    # To stop the compiler pulling in an openmp implementation itself
    - _openmp_mutex                   # [linux]
  run_constrained:
    - coincbc * *_metapackage

test:
  commands:
    - test -f $PREFIX/lib/libCoinUtils${SHLIB_EXT}  # [unix]
    - if not exist %PREFIX%\\Library\\lib\\libCoinUtils.lib exit 1  # [win]
    - test -f $PREFIX/include/coin/CoinSort.hpp  # [unix]
    - if not exist %LIBRARY_INC%\\coin\\CoinSort.hpp exit 1  # [win]

about:
  home: https://www.coin-or.org/
  dev_url: https://github.com/coin-or/CoinUtils
  doc_url: https://coin-or.github.io/CoinUtils/Doxygen/index.html
  license: EPL-2.0
  license_family: OTHER
  license_file: LICENSE
  summary: COIN-OR Utilities (CoinUtils)
  description: |
    CoinUtils (Coin-OR Utilities) is an open-source collection of classes and
    functions that are generally useful to more than one COIN-OR project. These
    utilities include:

      - classes for storing and manipulating sparse matrices and vectors,
      - performing matrix factorization,
      - parsing input files in standard formats, e.g. MPS,
      - building representations of mathematical programs,
      - performing simple presolve operations,
      - warm starting algorithms for mathematical programs, and
      - comparing floating point numbers with a tolerance, among others.

extra:
  recipe-maintainers:
    - wolfv
    - tkralphs
    - jschueller
