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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/lbfgs_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/lbfgs/lbfgs_{{ version }}.tar.gz
  sha256: 7b09d886c377c8b5eb812085cd2aacb2c5ce7e38b77f9460023623dbc24edd11

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

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

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

about:
  home: https://CRAN.R-project.org/package=lbfgs
  license: GPL-2.0-or-later
  summary: A wrapper built around the libLBFGS optimization library by Naoaki Okazaki. The lbfgs package implements both the Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) and the Orthant-Wise Quasi-Newton Limited-Memory (OWL-QN) optimization algorithms. The L-BFGS algorithm solves the problem of minimizing an
    objective, given its gradient, by iteratively computing approximations of the inverse Hessian matrix. The OWL-QN algorithm finds the optimum of an objective plus the L1-norm of the problem's parameters. The package offers a fast and memory-efficient implementation of these optimization routines, which is particularly
    suited for high-dimensional problems.
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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

# Package: lbfgs
# Type: Package
# Title: Limited-memory BFGS Optimization
# Version: 1.2.1
# Date: 2014-07-08
# Authors@R: c(person("Antonio", "Coppola", role = c("aut", "cre", "cph"), email = "acoppola@college.harvard.edu"), person("Brandon", "Stewart", role = c("aut", "cph")), person("Naoaki", "Okazaki", role = c("aut", "cph")), person("David", "Ardia", role = c("ctb", "cph")), person("Dirk", "Eddelbuettel", role = c("ctb", "cph")), person("Katharine", "Mullen", role = c("ctb", "cph")), person("Jorge", "Nocedal", role = c("ctb", "cph")))
# Maintainer: Antonio Coppola <acoppola@college.harvard.edu>
# Description: A wrapper built around the libLBFGS optimization library by Naoaki Okazaki. The lbfgs package implements both the Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) and the Orthant-Wise Quasi-Newton Limited-Memory (OWL-QN) optimization algorithms. The L-BFGS algorithm solves the problem of minimizing an objective, given its gradient, by iteratively computing approximations of the inverse Hessian matrix. The OWL-QN algorithm finds the optimum of an objective plus the L1-norm of the problem's parameters. The package offers a fast and memory-efficient implementation of these optimization routines, which is particularly suited for high-dimensional problems.
# License: GPL (>= 2)
# Imports: Rcpp (>= 0.11.2)
# LinkingTo: Rcpp
# Packaged: 2014-08-30 10:14:37 UTC; antonio12
# Author: Antonio Coppola [aut, cre, cph], Brandon Stewart [aut, cph], Naoaki Okazaki [aut, cph], David Ardia [ctb, cph], Dirk Eddelbuettel [ctb, cph], Katharine Mullen [ctb, cph], Jorge Nocedal [ctb, cph]
# NeedsCompilation: yes
# Repository: CRAN
# Date/Publication: 2014-08-31 11:23:32
