Skip to content

test TMB #101

@eeholmes

Description

@eeholmes

Trying repo2docker-r. Not working.

https://kaskr.github.io/adcomp/Introduction.html

Not happy

library(TMB)
> compile("linreg.cpp")
using C++ compiler: ‘g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0’
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I"/usr/lib/R/site-library/TMB/include" -I"/usr/lib/R/site-library/RcppEigen/include"  -DTMB_SAFEBOUNDS -DTMB_EIGEN_DISABLE_WARNINGS -DLIB_UNLOAD=R_unload_linreg  -DTMB_LIB_INIT=R_init_linreg  -DCPPAD_FRAMEWORK      -fpic  -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/r-base-YnquTi/r-base-4.4.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/r-base-YnquTi/r-base-4.4.1=/usr/src/r-base-4.4.1-3.2404.0 -Wdate-time -D_FORTIFY_SOURCE=3   -c linreg.cpp -o linreg.o
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:204: linreg.o] Error 1
Error in compile("linreg.cpp") : Compilation failed

Simple linreg example

linreg.cpp

// Simple linear regression.
#include <[TMB.hpp](https://kaskr.github.io/adcomp/TMB_8hpp.html)>
template<class Type>
Type objective_function<Type>::operator() ()
{
  [DATA_VECTOR](https://kaskr.github.io/adcomp/group__macros.html#gad334262a7679f343bdc919ae35810161)(Y);
  [DATA_VECTOR](https://kaskr.github.io/adcomp/group__macros.html#gad334262a7679f343bdc919ae35810161)(x);
  [PARAMETER](https://kaskr.github.io/adcomp/group__macros.html#ga70b2d449f7c53e87abee7d5fb71dc4c0)(a);
  [PARAMETER](https://kaskr.github.io/adcomp/group__macros.html#ga70b2d449f7c53e87abee7d5fb71dc4c0)(b);
  [PARAMETER](https://kaskr.github.io/adcomp/group__macros.html#ga70b2d449f7c53e87abee7d5fb71dc4c0)(logSigma);
  [ADREPORT](https://kaskr.github.io/adcomp/group__macros.html#ga43a13c435127491364e4a167478f4992)(exp(2*logSigma));
  Type nll = -[sum](https://kaskr.github.io/adcomp/convenience_8hpp.html#a1fe3cb777e8fd8080385579ab87600e3)([dnorm](https://kaskr.github.io/adcomp/group__R__style__distribution.html#ga5eb914782c488bd3ec4a50d4e4a73394)(Y, a+b*x, exp(logSigma), true));
  return nll;
}

Test

library(TMB)
compile("linreg.cpp")

Metadata

Metadata

Assignees

Labels

tasksgeneral to do tasks

Type

No type

Projects

Status

Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions