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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/TMB_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/TMB/TMB_{{ version }}.tar.gz
  sha256: 2c9dd281d911c2cb1cc01c6a8e114826891280f15e0ed4a00b4f195e15df25d7

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]
    - llvm-openmp  # [osx]
  host:
    - libblas
    - liblapack
    - r-base
    - r-matrix >=1.0_12
    - r-rcppeigen
  run:
    - llvm-openmp  # [osx]
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-matrix >=1.0_12
    - r-rcppeigen

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

about:
  home: http://tmb-project.org
  license: GPL-2.0-only
  summary: "With this tool, a user should be able to quickly implement complex random effect models through simple C++ templates. The package combines 'CppAD' (C++ automatic differentiation), 'Eigen' (templated matrix-vector library) and 'CHOLMOD' (sparse matrix routines available from R) to obtain an efficient implementation\
    \ of the applied Laplace approximation with exact derivatives. Key features are: Automatic sparseness detection, parallelism through 'BLAS' and parallel user templates."
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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

# Package: TMB
# Type: Package
# Title: Template Model Builder: A General Random Effect Tool Inspired by 'ADMB'
# Version: 1.7.15
# Date: 2018-11-08
# Authors@R: c(person("Kasper","Kristensen",role=c("aut","cre","cph"),email="kaskr@dtu.dk"), person("Brad","Bell",role="cph"), person("Hans","Skaug",role="ctb"), person("Arni","Magnusson",role="ctb"), person("Casper","Berg",role="ctb"), person("Anders","Nielsen",role="ctb"), person("Martin","Maechler",role="ctb"), person("Theo","Michelot",role="ctb"), person("Mollie","Brooks",role="ctb"), person("Alex","Forrence",role="ctb"), person("Christoffer","Moesgaard Albertsen",role="ctb"), person("Cole","Monnahan",role="ctb") )
# Maintainer: Kasper Kristensen <kaskr@dtu.dk>
# Author: Kasper Kristensen [aut, cre, cph], Brad Bell [cph], Hans Skaug [ctb], Arni Magnusson [ctb], Casper Berg [ctb], Anders Nielsen [ctb], Martin Maechler [ctb], Theo Michelot [ctb], Mollie Brooks [ctb], Alex Forrence [ctb], Christoffer Moesgaard Albertsen [ctb], Cole Monnahan [ctb]
# Copyright: See the file COPYRIGHTS
# Description: With this tool, a user should be able to quickly implement complex random effect models through simple C++ templates. The package combines 'CppAD' (C++ automatic differentiation), 'Eigen' (templated matrix-vector library) and 'CHOLMOD' (sparse matrix routines available from R) to obtain an efficient implementation of the applied Laplace approximation with exact derivatives. Key features are: Automatic sparseness detection, parallelism through 'BLAS' and parallel user templates.
# License: GPL-2
# URL: http://tmb-project.org
# BugReports: https://github.com/kaskr/adcomp/issues
# Depends: R (>= 3.0.0)
# Imports: graphics, methods, stats, utils, Matrix (>= 1.0-12)
# LinkingTo: Matrix, RcppEigen
# Suggests: numDeriv, parallel
# RoxygenNote: 6.0.1
# NeedsCompilation: yes
# Packaged: 2018-11-08 21:40:08 UTC; kaskr
# Repository: CRAN
# Date/Publication: 2018-11-09 16:40:14 UTC
