Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test TMB #101

Open
eeholmes opened this issue Oct 26, 2024 · 0 comments
Open

test TMB #101

eeholmes opened this issue Oct 26, 2024 · 0 comments
Assignees
Labels
tasks general to do tasks
Milestone

Comments

@eeholmes
Copy link
Member

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")
@eeholmes eeholmes modified the milestones: applications, py-rocket Oct 30, 2024
@eeholmes eeholmes added the tasks general to do tasks label Oct 30, 2024
@eeholmes eeholmes moved this to Backlog in py-rocket 3.0 Oct 30, 2024
@eeholmes eeholmes modified the milestones: py-rocket, py-rocket 2 Oct 30, 2024
@eeholmes eeholmes self-assigned this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks general to do tasks
Projects
Status: Backlog
Development

No branches or pull requests

1 participant