{% set version = "2020-3.2" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-lbfgsb3c
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/lbfgsb3c_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/lbfgsb3c/lbfgsb3c_{{ version }}.tar.gz
  sha256: 2f7797c290d5325b04f67f299ac22216eb07193fff8e5f0c2baa4a09bb8ab01e

build:
  merge_build_host: true  # [win]
  number: 2
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ compiler('fortran') }}        # [not win]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-rcpp >=0.12.3
    - r-rcpparmadillo
    - r-numderiv
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=0.12.3
    - r-rcpparmadillo
    - r-numderiv

test:
  commands:
    - $R -e "library('lbfgsb3c')"           # [not win]
    - "\"%R%\" -e \"library('lbfgsb3c')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=lbfgsb3c
  license: GPL-2.0-only
  summary: Interfacing to Nocedal et al. L-BFGS-B.3.0 (2011 <doi:10.1145/2049662.2049669>) limited memory BFGS minimizer with bounds on parameters. This is a fork
    of 'lbfgsb3'.  This registers a 'R' compatible 'C' interface to L-BFGS-B.3.0 that uses the same function types and optimization as the optim() function (see writing
    'R' extensions and source for details).  Ths package also adds more stopping criterion as well as allows adjusting more tolerances.
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

extra:
  recipe-maintainers:
    - conda-forge/r


# Package: lbfgsb3c
# Type: Package
# Title: Limited Memory BFGS Minimizer with Bounds on Parameters with optim() 'C' Interface
# Version: 2018-2.13-1
# Authors@R: c(person(given = c("Matthew", "L"), family = "Fidler", role = c("aut", "cre"), email = "matthew.fidler@gmail.com"), person(given = c("John", "C"), family = "Nash", role = c("aut"), email = "nashjc@uottawa.ca"), person(given = "Ciyou", family = "Zhu", role = "aut"), person(given = "Richard", family = "Byrd", role = "aut"), person(given = "Jorge", family = "Nocedal", role = "aut"), person(given = c("Jose", "Luis"), family = "Morales", role = "aut"))
# Maintainer: Matthew L Fidler <matthew.fidler@gmail.com>
# Description: Interfacing to Nocedal et al. L-BFGS-B.3.0 (2011 <doi:10.1145/2049662.2049669>) limited memory BFGS minimizer with bounds on parameters. This is a fork of 'lbfgsb3'.  This registers a 'R' compatible 'C' interface to L-BFGS-B.3.0 that uses the same function types and optimization as the optim() function (see writing 'R' extensions and source for details).  Ths package also adds more stopping criterion as well as allows adjusting more tolerances.
# License: GPL-2
# Depends: R (>= 3.0.2)
# Imports: Rcpp (>= 0.12.3), numDeriv, methods
# LinkingTo: Rcpp (>= 0.12.3), RcppArmadillo
# NeedsCompilation: yes
# RoxygenNote: 6.1.1
# Suggests: testthat
# Packaged: 2018-12-01 02:38:25 UTC; matt
# Author: Matthew L Fidler [aut, cre], John C Nash [aut], Ciyou Zhu [aut], Richard Byrd [aut], Jorge Nocedal [aut], Jose Luis Morales [aut]
# Repository: CRAN
# Date/Publication: 2018-12-01 05:20:04 UTC
