{% set version = "1.11.3" %}

package:
  name: numpy-split
  version: {{ version }}

source:
  url: https://github.com/numpy/numpy/archive/v{{ version }}.tar.gz
  sha256: 956afdeb9b5600e873326e410e9379684dac8f8f47ea569151a417984e7799cf
  patches:
    - mklfft.patch
    # customize gfortran executable that gets looked for to use our GFORTRAN env var
    - gfortran_alias.patch    # [linux]
    # fix fortran regex for ctng compilers
    - fortran_regex.patch     # [linux]
    # these tests only fail on linux32
    - disable_einsum_int16_test.patch   # [linux32]
    # Power provides high precision longdoubles which causes some test errors
    # see https://github.com/numpy/numpy/pull/8656
    - 8656.patch  # [ppc64le]

build:
  number: 10
  skip: True  # [blas_impl == 'openblas' and win]
  force_use_keys:
    - python

outputs:
  # this one has all the actual contents
  - name: numpy-base
    script: install_base.sh   # [unix]
    script: install_base.bat  # [win]
    requirements:
      build:
        - {{ compiler('c') }}
        - {{ compiler('fortran') }}
        # libgcc-ng should be a dependecy of libgfortran
        # until this is fixed add libgcc explicitly
        - libgcc-ng         # [linux and blas_impl == 'openblas']
      host:
        - cython
        - python
        - mkl-devel  {{ mkl }}  # [blas_impl == 'mkl']
        - openblas-devel {{ openblas }}  # [blas_impl == 'openblas']
        - setuptools
      run:
        - python
    test:
      commands:
        - test -e $SP_DIR/numpy/distutils/site.cfg     # [unix]
        - IF NOT EXIST %SP_DIR%\numpy\distutils\site.cfg exit 1  # [win]

  # devel exists mostly to add the run_exports info.
  - name: numpy-devel
    build:
      run_exports:
        - {{ pin_subpackage('numpy') }}
    requirements:
      host:
        - python
        # these import blas metapackages to ensure consistency with downstream libs that also use blas
        - mkl-devel  {{ mkl }}  # [blas_impl == 'mkl']
        - openblas-devel {{ openblas }}  # [blas_impl == 'openblas']
      run:
        - python
        - {{ pin_subpackage('numpy-base', exact=True) }}

  # metapackage for things that don't use numpy's C interface, or things
  - name: numpy
    requirements:
      build:
        # for runtime alignment
        - {{ compiler('c') }}
        - {{ compiler('fortran') }}
      host:
        - python
        # these are here to ensure that the appropriate mkl or openblas version gets baked into the hash
        - mkl-devel  {{ mkl }}  # [blas_impl == 'mkl']
        - openblas-devel {{ openblas }}  # [blas_impl == 'openblas']
      run:
        - python
        - {{ pin_subpackage('numpy-base', exact=True) }}

    test:
      script: numpy_test.py
      requires:
        - nose
        - {{ compiler('c') }}
        - {{ compiler('fortran') }}
        - nomkl  # [x86 and blas_impl != 'mkl']
      commands:
        - f2py -h
        - python -c "import numpy; numpy.show_config()"
        - conda inspect linkages -p $PREFIX numpy  # [not win]
        - conda inspect objects -p $PREFIX numpy  # [osx]
      imports:
        - numpy
        - numpy.linalg.lapack_lite

    about:
      home: http://numpy.scipy.org/
      license: BSD 3-Clause
      license_file: LICENSE.txt
      summary: 'Array processing for numbers, strings, records, and objects.'
      description: |
        NumPy is the fundamental package needed for scientific computing with Python.
      doc_url: https://docs.scipy.org/doc/numpy-1.11.0/reference/
      dev_url: https://github.com/numpy/numpy
      dev_source_url: https://github.com/numpy/numpy/tree/master/doc

extra:
  recipe-maintainers:
    - jakirkham
    - msarahan
    - pelson
    - rgommers
    - ocefpaf
