Displaying 20 results from an estimated 6000 matches similar to: "interfacing R and c++"
2005 May 18
2
R Include File Guards
R 2.1.0/src/include from 2005/04/18 download
Naming inconsistent for guards as well but that's pedantic.
Simple convention:
file <foo.h>
#ifndef R_FOO_H
file <R_ext/bar.h>
#ifndef R_EXT_BAR_H
Missing guards:
<IOStuff.h>
<Internal.h>
<Parse.h>
<R_ext/GraphicsBase.h>
<R_ext/GraphicsDevice.h>
<R_ext/GraphicsEngine.h>
2009 Feb 20
1
C function calling in R
Dear all,
I have a problem in calling my C code from R. If I do not need to use
#include<R.h>, the codes work properly. But when I need to use it, my
codes produce an error as:
logpostCLM.cpp:7:15: error: R.h: No such file or directory
logpostCLM.cpp:8:24: error: Rinternals.h: No such file or directory
logpostCLM.cpp:9:19: error: Rmath.h: No such file or directory
logpostCLM.cpp:10:24:
2007 Mar 19
3
Rinternals.h and undefined symbols
Hi,
I'm trying to register my native routines using R_registerRoutines
(...). I can compile the code, but the loader cannot resolve the symbol:
undefined symbol:
_Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6
_
$ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutines
U
_Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6
2014 Feb 06
3
C headers
Dear list,
Just upgraded to MacOS Mavericks, fresh install of R 3.0.2 and trying to
install a previous version of my QCA package (the most recent one source
file, which passed the R CMD check --as-cran with R 3.0.1)
I seem to have some difficulties in the C code, apparently it doesn't find
some headers (please see below):
============
$ R CMD INSTALL --no-multiarch
2024 Jul 29
1
Minor inconsistencies in tools:::funAPI()
Hi Ivan
Can you please clarify what input files should be used with your
proposed function? I tried a few files in r-svn/src/include and one of
them gave me an error.
> getdecl("~/R/r-svn/src/include/R.h")
[1] "R_FlushConsole" "R_ProcessEvents" "R_WaitEvent"
> getdecl("~/R/r-svn/src/include/Rdefines.h")
Error in regmatches(lines,
2011 Dec 12
2
Problems in building a DLL in 64-bit Windows
I am trying to build a C language DLL and it works well with i386 but when I compile with it substituted
by x64, like the FAQ page says, the result is an error message:
C:/PROGRA~1/R/R-214~1.0/bin/x64/R.ddl: file not recognized : File format not recognized
collect2: ld returned 1 exit status
How can I solve this? The problem is with R 2-14.0 and 2-13.0
The complete source code is
/*
* myfun.c
2003 May 16
1
Reloading a shared library with dyn.load
Hi,
I'm using dyn.load to load a shared library (compiled from C
code) into R. If I dyn.unload it and then dyn.load it again, I
get an hourglass icon in Rgui (R 1.7.0, Win 2000), and it
just sits there forever. I can't press Escape to stop the
current computation, but I can close Rgui without resorting to
using the Task Manager.
Is it a problem with my use of R_alloc? Do I need
2013 Jul 04
1
R-devel Digest, Vol 125, Issue 2
Hi all,
I have a problem but i am not sure that this is the right mailing list.
I'm writing a R program which call a C++ program, through the function .Call. I use to compile the c++ script with the command
R CMD SHLIB SpTempWrapC.cpp -Wall -l covmodel.h -l util.h
Everything works fine since, for mistake, i paste in the terminal the content of the r-script. Now, when i try to compile,
2012 Jun 21
2
debug R objects at C level
Dear R-devel,
I am now at a debugging phase, and would like to inspect the
(individual) values in an arbitrary R vector. It should be simple, but
after hours of reading I am simply unable to find the right
information.
A possible C code is:
?????????????????
# include <R.h>
# include <Rinternals.h>
# include <R_ext/Rdynload.h>
SEXP foo(SEXP x) // where x is a vector passed by
2007 Jun 01
1
Calling C routine in anther package in C code (R_RegisterCCallable)
Hi,
I want to make use of some C routines from other packages to write extensions
in C.
In "Writing R Extensions", it says there is an experimental interface to
support this in (or from ?) R 2.4.0.
I had a dummy library containing src/dummy.cpp and R/zzz.R:
====== src/dummy.cpp ====
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
2004 Mar 03
1
why is rcmd shlib including files not in the list?
I've been trying to create a shlib file (using mingw instead of the
cygwin -- after reconfiguring my machine, yet again) and I'm getting the
following behaviour that I think is incorrect:
When using rcmd shlib and explicitly listing the files to include in the
build such as:
C:\Sequential\Code>rcmd shlib --output=optflikam flikam.c as47.f as154.f
as197.f
making corrAdaptiveSim.d from
2004 Mar 03
1
why is rcmd shlib including files not in the list?
I've been trying to create a shlib file (using mingw instead of the
cygwin -- after reconfiguring my machine, yet again) and I'm getting the
following behaviour that I think is incorrect:
When using rcmd shlib and explicitly listing the files to include in the
build such as:
C:\Sequential\Code>rcmd shlib --output=optflikam flikam.c as47.f as154.f
as197.f
making corrAdaptiveSim.d from
2001 Apr 07
2
silent extern error (PR#898)
Full_Name: Byron Ellis
Version: 1.2.2
OS: all
Submission from: (NULL) (140.247.105.95)
R_ext/Arith.h
#ifdef MAIN
#define extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
these two should be reversed. Its never a problem because builds aren't done
against C++ compilers, but its still an error (just a low priority one).
also, you could change that to
#ifdef __cplusplus
extern
2013 May 24
1
Problem with Rboolean in c++ code
I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is
properly deleted after use. However, I run into some problems when
trying to pass in the third argument which is an Rboolean. The line
'R_RegisterCFinalizerEx(p, finalizer, TRUE);' generates the following
error when trying to compile using R CMD SHLIB:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O2 -pipe
2007 Apr 07
2
Rf_PrintValue problem with methods::show
Hi,
I think this is a bug (even though I can't find documentation
explicitly saying that it should work). Basically, Rf_PrintValue(obj)
fails when 'obj' is an S4 object that should be printed using show()
rather than print(). From the error message I'm guessing that the need
to use show is detected correctly but then show is not found.
"cbind2" in the code below is just
2009 Jan 08
1
Callbacks seems to get GCed.
Dear list,
I am trying to implement a publish-subscribe mechanism in for an embedded
R interpreter. But somehow my registered closures seem to get collected by
the GC, even though I have protected them. I have reducted my code to the
following sample. Sorry if it is a little verbose.
The first couple of call of calls still work, but at some point one of the
callbacks (callback1 in my
2013 Oct 21
4
About integrating R inside a C++ software
Hi,
We are a company developing a software mainly in C++.
We want to integrate R inside our software in order to use mainly the
engine (usual stats as mean, sigma, Pearson, outlier detection, CPA,
multivariate, ...) and probably later the chart solution.
Of course we don''t want to temporary write the data to some csv files
and then do an ugly system() call :
2013 Oct 21
4
About integrating R inside a C++ software
Hi,
We are a company developing a software mainly in C++.
We want to integrate R inside our software in order to use mainly the
engine (usual stats as mean, sigma, Pearson, outlier detection, CPA,
multivariate, ...) and probably later the chart solution.
Of course we don''t want to temporary write the data to some csv files
and then do an ugly system() call :
2008 Oct 11
1
defines in Rmath.h and R_NO_REMAP
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
I'm programming with R 2.7.2 and had some trouble including
Rmath.h for its random variates generation routines: Although
I define R_NO_REMAP (which works fine for Rinternals.h stuff),
Rmath.h defines "beta" as "Rf_beta" etc., so that my "beta" strings
get redefined as well! Is this a feature?
I found an old
2013 Sep 27
1
LENGTH function causing name conflict
I am attempting to bring R-3.0.2 functionality into a project with a very
large C++ codebase. The existing codebase already has a LENGTH function
defined. R also defines a LENGTH function.
I first compiled R as a shared library and linked it into this existing
codebase, along with RInside. When I run a parseEvalQ with a linear model
command it will stack dump. Looking at the backtrace, what is