Displaying 20 results from an estimated 6000 matches similar to: "About dll from c++ routine"
2008 Mar 17
1
how to get access to C++ Objects
In the "Writing R Extensions" manual appears this example, to get access to C++ function using the R commands:
R> dyn.load(paste("X", .Platform$dynlib.ext, sep = ""))
constructor Y
R> .C("X_main")
constructor X
destructor X
list()
That gives me access to the function "X_main", but how to get access to methods and properties
2006 Mar 13
1
Help on interfacing C++ with R
Hi, I am trying to set up a C++ library for my R code. I followed the
R-extension manual but found out that the example of "X.cpp, X_main.cpp"
is somewhat too simple. Here is my code:
//lib4R.h testing for interfacing C++ with R -- using C++ library in R
#include <iostream>
using namespace std;
class lib4R {
public:
lib4R();
~lib4R();
int
2003 Jul 07
1
Problems with a dll under windows
I am trying to get a dll compiled for use with dyn.load. I use R.1.7.1
under Windows.
I have tried the following trivial example based on the "Writing R
extensions" manual.
rtest.h
--------
class X {
public:
X ();
~X ();
void Give7(double*);
};
class Y {
public: Y (); ~Y ();
};
rtest.cpp
---------
#include <iostream.h>
#include "rtest.h"
static Y y;
2007 May 31
1
Problems when linking to R shared library
Folks,
I'm fairly sure that I'm doing something stupid, but I'm getting a few
really strange results from *some* of the distributions, but by no means
all,
when I link directly to the R shared library.
I've tried this on both Windows with the precompiled Mingw binary of R-2.5.0
(compiling my code with MinGW-3.4.2), and by building R-2.5.0 on Mandriva
Linux with gcc-3.4.4 and
2004 May 31
1
Several libraries won't load with rw1090pat (PR#6926)
# Your mailer is set to "none" (default on Windows),
# hence we cannot send the bug report directly from R.
# Please copy the bug report (after finishing it) to
# your favorite email program and send it to
#
# r-bugs@r-project.org
#
######################################################
Several libraries won't load with rw1090pat.
MASS, which is included with the distribution,
2018 Dec 09
2
Parse LLVM IR
Hello,
I am a newbie to LLVM and right now I am on the hook to parse some IR code
and do some instrumentations. However, my problem is that no matter how I
tweak my parsing code, it simply cannot print out anything.
So here is my C code:
int your_fun(int arg2) {
int x = arg2;
return x+2;
}
And here is my parsing code:
#include <llvm/IR/Module.h>
#include
2013 Jan 26
1
[LLVMdev] MCJIT/interpreter and iostream
As of LLVM 3.2, is it possible to use iostream with the MCJIT or interpreter execution engines? I'm getting some errors...
Each of these commands correctly prints "hello":
echo -e '#include <stdio.h>\nint main(){ printf("hello"); }' | clang -cc1 -emit-llvm-bc -x c++ | lli -use-mcjit
echo -e '#include <iostream>\nint main(){ std::cout <<
2012 Sep 03
1
[LLVMdev] Selection DAG output as bare DAG, code review
Hello all,
I recently foudn myself wanting to view the basic blocks in the
selection DAG as pure DAGs - so just as a list of edges, with no other
information. I added the below code to the start of the "
void SelectionDAGISel::CodeGenAndEmitDAG()" function. It creates a
separate txt file for each basic block and gives a list of edges
between nodes. The segment of code is below -
2008 Feb 09
2
[LLVMdev] exception handling broken on x86-64?
Hi,
when building the second release candidate of llvm 2.2 I noticed that
exception handling seems to be broken on Linux x86-64. The exception is
thrown but never caught.
This can be seen by this trivial example:
#include <iostream>
using namespace std;
class A { };
int main()
{
cout << "A" << endl;
try {
cout << "B" << endl;
1999 Feb 18
0
Loading C++ libraries
Some time ago, I asked on this list, if it is possible to use C++
libraries
under R. In fact this seems to be very easy (at least under Redhat 5.2,
egcs C++):
e.g.
Suppose we have a library
R_main.cc:
-------------------------------
#include "X.hh"
extern "C" {
void R_main ()
{
X x;
}
}
-------------------------------
X.hh
-------------------------------
class X
{
2009 Mar 17
1
question on "row.names" attribute of dataframe when called from a compiled package
Why does the following show a class attribute of "character" when
using the interpreter:
x <- data.frame(hat=1:10)
class(rownames(x)) ## returns [1] "character"
but when called from c/cpp, the rownames attribute has no class
attribute, and is in fact a vector of INTSXP?
> .Call("print_class_of_rownames", x, package = "test")
length(x): 10
2015 May 30
2
[LLVMdev] Linking modules across contexts crashes
I get a crash when I try to link multiple modules registered in their
individual contexts.
Documentation for Linker::LinkModules doesn't mention anything about
contexts, and the first link succeeds. But the second link crashes.
Is this not the right way to merge such modules? If not, then what is
the right way?
In any case, documentation for Linker::LinkModules should say if
contexts are
2013 Aug 30
1
[LLVMdev] Are instr_iterators invalidated when function inlining is performed?
Hi,
I'm trying to write a small piece of code that inlines all calls to a
particular function. The codes is as follows
Function* klee_check_divF = module->getFunction("klee_div_zero_check");
assert(klee_check_divF != 0 && "Failed to find klee_div_zero_check function");
// Hack inline checks
for (Module::iterator f = module->begin(), fe =
2006 May 23
3
[LLVMdev] Binary output to cout on Windows
The solution (provided in Microsoft's documentation) is to add:
#include <cstdio>
#include <io.h>
#include <fcntl.h>
and run:
int result = _setmode( _fileno(stdin), _O_BINARY );
if( result == -1 )
{ std::cerr<<"Cannot set input mode to binary."<<std::endl; return 1;
}
result = _setmode( _fileno(stdout), _O_BINARY );
if( result == -1 )
{
2014 Jun 02
3
[LLVMdev] -fvisibility=hidden, and typeinfo, and type-erasure
[Was initially posted on cfe-users, sorry.]
Hi,
I'm sorry my message is quite long, the TL;DR version is "g++ and clang++ seem to have different opinions on how RTTI, templates, and ELF visibility should interact".
I can't tell whether this is a bug or not: I have found no relevant documentation that could help me decide whether this behavior is meant, or not. All I can say
2006 Aug 01
2
A problem with R CMD SHLIB
Hi,
I followed the example in "Writing R Extensions" to create a shared
object in Windows, using the command
R CMD SHLIB X.cc X_main.cc
This was encountered:
../src/gnuwin32/MkRules:155: warning: overriding commands for target
'.c.d'
../src/gnuwin32/MkRules:143: warning: ignoring old commands for target
'.c.d'
../src/gnuwin32/MkRules:171: warning: overriding commands
2003 Apr 29
4
Bug in g++ 2.95.4 (Pointer to member functions)
Hi,
I think I have discovered a bug in FreeBSD 4.8-STABLE's system C++ compiler:
% gcc -v
% Using builtin specs.
% gcc version 2.95.4 20020320 [FreeBSD]
Here is a stripped down example that can be used to reproduce the bug:
// ----------- begin bug.cpp -----------
#include <iostream>
class Class {
public:
void M1 (void) { cout << "M1" << endl; };
void M2
2015 Mar 27
1
Channel Device virConnectListAllNodeDevices
Hello,
I've added a Channel Device through virt-manager GUI. virsh dumpxml shows
the device as.
<channel type='unix'>
<source mode='bind'
path='/var/lib/libvirt/qemu/channel/target/ubuntusaucy.marx'/>
<target type='virtio' name='marx'/>
<alias name='channel2'/>
<address
2011 Jul 13
1
[LLVMdev] Is it possible to store some info and use it after emitting the bitcode file?
Hi All,
Specifically, the problem is that I want to insert a string into the source
code. When the source code is compiled by the compiler into bitcode file such
info will be extracted and stored somewhere else, and the compiler only
compiles the original source code.
An example is like:
a1.cpp:
int main()
{
int a = 0;
cout << a << endl;
}
I'd like to
2012 Feb 03
2
[LLVMdev] Invalid bitcode signature
I'm trying to link two modules together using the C++ API, one that's a sort
of library module and one that's being generated from the source language.
If I have something like this:
OwningPtr<MemoryBuffer> owning_ptr;
if (MemoryBuffer::getFile(StringRef("../hello.bc"), owning_ptr))
std::cout << "error opening file" << std::endl;
Module* Lib