From axionator at gmail.com  Sun Sep  7 12:30:11 2014
From: axionator at gmail.com (axionator)
Date: Sun, 7 Sep 2014 12:30:11 +0200
Subject: [Rd] lbfgsb from C/C++
Message-ID: <CAGopM69bK3H+7MbOQroaMu-A8ydzOiXNY0sV+MR1ijzny_aBmA@mail.gmail.com>

Hi,

I would like to call R's lbfgsb function from my C/C++ code by including
R_ext/Applic.h and linking against libR.
Currently, I am allocating memory for x (and the other input arrays for
lbfgsb) in my C/C++ code via malloc/new. However, this gives a segmentation
fault when executing the program.
I tried to allocate x via PROTECT(x = NEW_NUMERIC(n)); x_p =
NUMERIC_POINTER(x);.
This compiles but also gives a segmentation fault.
Is there a way to use lbfgsb from C/C++ directly (without an intermediate
call of R)? Did I miss any compile flags?

Thanks

	[[alternative HTML version deleted]]



[Rd] lbfgsb from C/C++
axionator