Displaying 20 results from an estimated 3000 matches similar to: "How to use a C code in R"
2005 Mar 09
2
How to use a R package with C code
Hello, everybody,
I created a R package which includes C code. But I load this package, and carry
out the R function in it. It shows C function is not in load table as follows.
Would you tell me what is the problem? Where do I make mistake?
Maggie
[Previously saved workspace restored]
> library(var)
Attaching package 'var':
The following object(s) are masked _by_
2005 Jan 05
2
How to connect R with a C code which includes Atlas
Hello, everybody,
Happy New Year!
I am a graduate student from Concordia University. I meet a problem when I am
working on my thesis. I hope I will get help from you.
I have a mathematical model which was already implemented by using R language.
However, part of this model includes fixed point iteration algorithm and
calculation of large linear equations which n will get to 5000. Because of
2007 May 13
1
Help understanding LAPACK symbol resolution
R developers,
I am trying to understand how symbols are resolved, so that I can
configure a package that I contributed to, and so that I can provide
guidance to (linux / OSX) users of the package. To be concrete, my
package uses the LAPACK Fortran symbol zsysv. This is not in
libRlapack, but is defined on my system in the library
/usr/lib64/liblapack.so.
* I suspect that the reason the symbol is
2015 Jun 03
2
Problem with shared library and lapack under windows
Hi all,
I have a C function, say Cfun, that calls Lapack's DGEMM routine and I need
to create a shared library to use Cfun inside R. The C file is the following
#include<stdio.h>
#include<R.h>
#include<R_ext/Lapack.h>
void Cfun(double *res, double *X, int *n, int *q)
{
char *ptr_TRANSA, TRANSA='T', *ptr_TRANSB, TRANSB='N';
ptr_TRANSA=&TRANSA;
2004 Apr 14
1
question about /nmath/standalone
Hello,
I can't link a c code with Mathlib according to introduction of R
manual "Writing R Extensions", page 60.
It is written :
"It is possible to build Mathlib, the R set of mathematical functions
documented in
'Rmath.h?, as a standalone library 'libRmath? under Unix and Windows. (This
includes
the functions documented in Section 5.7 [Numerical analysis
2020 Oct 08
1
Installing package fails at "testing if installed package can be loaded from temporary location"
Dirk, thank you a thousand times.
Indeed, src/Makevars was wrong. I modified Makevars so that now looks like
the below and the package now compiled and linked properly.
CXX_STD = CXX11
PKG_LIBS += $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
$(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -I../inst/include
2004 May 31
1
Question about building library and BLAS
Dear helpers,
I am trying to create a library which uses some Fortran source files and Lapack and Blas
subroutines. The Fortran source files from the original author contain subroutines
isamax.f, sgefa.f and sgesl.f, which are part of BLAS subroutines on my Linux computer,
but maybe different (old) versions. So in addition to these subroutines, there are other
Lapack and Blas subroutines
2014 Sep 26
1
Why is my R package still compiling with the O2 flag?
When I install an R package with cpp codes such as rrcov via CRAN (under
R 3.1.1, using no Makevars file and under Ubuntu 14.04 using GCC 4.8),
the cpp code is compiled with the -o3 flag (in fact, looking at the
Makeconf file this seem to again be the default since R 3.1.1) But when
I install my own package via CRAN it is compiled with the -o2 flag.
My questions are what is causing my
2004 Jun 09
2
Building package on Windows: No rule to make target '-llapack'
Dear all,
I have a problem to build a package on Windows XP while there is no problem on Linux. The Makefile is something like:
###########
LIBNAME=cts
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
OBJS=file1.o ... file20.o -llapack -lblas
$(LIBNAME)$(SHLIB_EXT): $(OBJS)
$(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS) $(FLIBS)
clean:
@rm -f *.o *.$(SHLIB_EXT)
realclean: clean
2007 Jun 14
1
LAPACK Headers
Hey Everyone,
I'm running R 2.4.0 on Debian etch 4.0, and I'm trying to call some
LAPACK functions from the C code in my package. Actually, to be
honest I'm not really having trouble using commands such as La_dgesv
from within my C code, but I do get warning when compiling the package
saying:
***.c: In function '***':
***.c:37: warning: implicit declaration of function
2007 May 29
1
LAPACK and BLAS libraries
Hi,
I don't know if I'm sending this to the right place but I've looked throught
tens and tens of topics on http://tolstoy.newcastle.edu.au/ and finally
found that email address where I can maybe find some help.
Well my main goal is to get to use the lapack library within my R package
(which can be done using calls from C). But in order to do this I have to
create a file src/Makevars
2007 May 29
1
LAPACK and BLAS libraries
Hi,
I don't know if I'm sending this to the right place but I've looked throught
tens and tens of topics on http://tolstoy.newcastle.edu.au/ and finally
found that email address where I can maybe find some help.
Well my main goal is to get to use the lapack library within my R package
(which can be done using calls from C). But in order to do this I have to
create a file src/Makevars
2004 Apr 22
2
Urgent:again question about nmath/standalone
Hello, all,
I have the same question as the last mail I sent. I have installed libRmath in
my system. But I still can not link Rmath through -lRmath. The whole process
is as follow.Is there anybody who is so kind to help me find out the problem?
I will appreciate very much.
[credsim at confsys ~]$ cd /usr/lib
[credsim at confsys lib]$ ls -l libR*
-rw------- 1 bcdesai bcdesai 237828 Apr
2004 Mar 26
0
SUMMARY: Using R's LAPACK & Related files in Visual C++
The following were the replies to my question
about using R's LAPACK and other .h files in
some of my C programs. From what was
said, it appears that buying a ready-made
library (MKL = $200, for example)
or using CLapack according to the Shumway lecture
notes are the best approaches:
--------------------------------
>From Andy Liaw:
(1) If you just want linear algebra routines in your C
2004 May 13
1
question about dyn.load()
Hello, everybody,
I met a big problem. What I want is to use c code in R. I have load a test
code "conv.c" in R and run it successfully. However, in my real code, I use
matlab c library (Matrix Inverse function). After I use command "R CMD SHLIB"
to share library, I can not use "dyn.load" to load the object in
R. "undefined symbol:
2009 Sep 04
1
calling Lapack and BLAS routines from C
Hi,
I am working on a UNIX machine and I am interfacing R and C with the .C
function. I am trying to call LAPACK and BLAS routines, but am running
into a problem where, while I am able to run the BLAS routines, I cannot
run the LAPACK routines.
I compile my .c file (at end of email) in the following way:
[mhitczen at jlogin2 ~/Cstuff]$ R CMD SHLIB testmore.c
gcc -std=gnu99
2006 Sep 20
1
alpha, portable use
When I build one of my packages with alpha from yesterday I am getting
* checking for portable use of $BLAS_LIBS ... WARNING
apparently missing $(FLIBS) in 'PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS)'
Is this something I should worry about? (Possibly I got this before and
didn't notice.)
Paul Gilbert
====================================================================================
2007 Apr 11
1
Calling LAPACK functions directly from R
I am interested in tapping into LAPACK functionality directly from R.
Using R-2.4.1 for Windows, I was able to do so ala:
dyn.load("bin/Rlapack.dll")
is.loaded("dstebz") # returns TRUE
N <- 100
NW <- 4
n.tapers <- 5
tpW <- (2 * pi * NW)/N
otNmo <- 1:N
D <- as.double(cos(tpW) * ((N - 1 - 2 * (0:(N - 1)))/2)^2)
E <- as.double((otNmo * (N - otNmo))/2)
z
2006 Apr 03
1
Integration of C and Fortran
Dear all,
I am running R : Copyright 2005,
Version 2.2.1 (2005-12-20 r36812)
ISBN 3-900051-07-0
On a mac 10.4.5
I am having trouble with my package.
The trouble is the following:
In my package I have integrated three files in my src folder.
1- simplematch.C a .C file
2- ordering.f a fortran file
3- Makevars : PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
I am not sure if that last file is
2004 Apr 01
1
Use R function in C code
I want to use R function Matrix inverse in my c code, please tell me how I can.
If there is a sample which can tell me how it works. It will be fantastic.