Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Draft saved
Draft discarded
Cancel
6
  • building in terminal ubuntu 18.04 I get the following: -I/home/chris/R-361/R-3.6.1/src/include simplex_reg.cpp: In instantiation of ‘Type objective_function<Type>::operator()() [with Type = CppAD::AD<double>]’: tmb_core.hpp:1135:7: required from here simplex_reg.cpp:28:16: error: no match for call to ‘(std::__cxx11::string {aka std::__cxx11::basic_string<char>}) (CppAD::AD<double>)’ d0 = -0.5*log(2*pi) -0.5*log(sd) - (3/2)*log(Y*(1-Y)) - (1/(2*sd))*d0; as first error. And same within R using your > compile('simplex_reg.cpp', '-O0 -ggdb'). Is as far as I've gotten. Commented Apr 13, 2020 at 21:46
  • 1
    Tks Chris! Did you look through all the compilation messages to find this message? (I already solved this problem, but I want to know for the next day). When you said "building in terminal ubuntu", which commands did you use? If you reply in the answer section I will give you the credits, thanks in advance! Commented Apr 14, 2020 at 12:24
  • I haven't gotten near solving it, you should post your solution to guide the blind. Commented Apr 14, 2020 at 15:47
  • I got the solution via commenting the code and running smaller parts of it. But I didn't understand the workflow of gdbsource(). For example, I didn't manage to find the error message that you found, this is the path that I need. Commented Apr 14, 2020 at 17:18
  • gdbsource() only comes into play after simplex_reg.o or .so has been fully compiled, like working with with an R script in debug. You can str() objects and values and watch execution, but without the .o, nothing happens. This is what is misleading about the Program exited without error after running >gdbsource(simplex_reg.cpp), because the message refers to gdb, not simplex_reg.cpp. While nonsensical, I ran it many times. My approach to c++ is akin to 1000 monkeys with typewriters attempting Rilke poems. And I'd lost my path to your Teste.R, alas. Commented Apr 14, 2020 at 21:28

lang-r

AltStyle によって変換されたページ (->オリジナル) /