Displaying 20 results from an estimated 24 matches for "lrmath".
Did you mean:
rmath
2004 Apr 14
1
question about /nmath/standalone
....)
The library is not built automatically when R is installed, but can be built
in the
directory 'src/nmath/standalone? in the R sources: see the file 'README?
there. To use thecode in your own C program include
#define MATHLIB_STANDALONE
#include <Rmath.h>
and link against '-lRmath?. There is an example file 'test.c?."
Have I to do: gcc -lRmath test.c ? In this case I receive this message:
> /usr/bin/ld: cannot find -lRmath
> collect2: ld returned 1 exit status "
what should I do? or I do something before I use "gcc -lRmath test.c" to
compi...
2002 May 24
1
nmath standalone again
...uggestion of Reid, I did control that
/usr/local, in which I copied the dir standalone, is listed in
/etc/ld.so.conf.
However, because of my big ignorance, I don't understand how I have to do
the linkage to Rmath during the compilation of a source.
What does it mean:
"and link against -lRmath" in file README of src/nmath/standalone ?
Have I to do: cc -lRmath test.c ? In this case I receive this message:
/usr/bin/ld: cannot find -lRmath
collect2: ld returned 1 exit status
I ask again your help. Sorry for the disturb.
Thanks in advance,
Paola.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-....
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 15 18:10 libRmath.a
lrwxrwxrwx 1 root root...
2006 Dec 18
1
Rmath: R libraries from C on Mac OS X
Dear R-experts,
I have been having trouble using R's standalone random number generators
from C on my Mac OS X 10.4.8 system.
I try to compile my C program in the following way:
gcc -Wall -o helloMac helloMac.c -lm -lRmath
I get the following error:
/usr/bin/ld: can't locate file for: -lRmath
I am unable to locate Rmath on my machine. The problem appears to be
that no libRmath.a was built on my Mac OS X installation.
Any pointers (perhaps to a step by step guide for a _beginner_ on how to
install this and th...
2004 Apr 14
2
again question about nmath/standalone
Hello,
I forgot to tell you that I am using Linux OS. And I can?t find
directory "src/nmath/standalone". I will send you the test code I am using and
the whole operation process.
[credsim at confsys ~/src]$ gcc test1.c -o test1 -lRmath
test1.c: In function `main':
test1.c:18: warning: assignment makes pointer from integer without a cast
test1.c:19: warning: assignment makes pointer from integer without a cast
test1.c:41: warning: assignment makes pointer from integer without a cast
test1.c: At top level:
test1.c:55: warning:...
2004 Jun 22
1
R mathlib
...This packages provides the libRmath shared and static libraries which
can be called from standalone C or C++ code.
Well, I use runif() function in test_runif.c:
#include <Rmath.h>
main()
{
// ...
printf("%f\n", runif(0, 1));
}
and compile it:
$ gcc -I/usr/lib/R/include -lRmath -lm -o test_runif test_runif.c
/tmp/ccmICWeD.o(.text+0x2d): In function `main':
: undefined reference to `Rf_runif'
collect2: ld returned 1 exit status
Replacing `-lm' with `-lR' solves the problem. So, I need libR.so anyway?
Thanks.
--
WBR,
Timur
2006 Mar 03
1
Fwd: Re: calling R's library using C
...you for matters clearly stated in manuals you continue to
> > ignore.
> >
> > Anyway -- on my Debian system, your file compiles, builds and runs "fine":
> >
> > edd at basebud:/tmp> gcc -o globetrotter -I/usr/share/R/include globetrotter.c
> > -lm -lRmath -L/usr/lib/R/lib -lR
> > edd at basebud:/tmp> LD_LIBRARY_PATH=/usr/lib/R/lib ./globetrotter
> > 0.040160
> > 0.040160
> >
> > That said, I put "fine" in quotes as you shouldn't need either -lR nor the
> > include directive. Witness:
> >
&...
2006 Mar 02
1
calling R's library using C
Hi,
Thanks, everyone for all the help! So, here is my calling function in C
(called
test.c):
#include<stdio.h>
#include<stdlib.h>
#include<Rmath.h>
int main(void) {
printf("%f \n",pchisq(2.,7., 1, 0));
printf("%f \n",pnchisq(2.,7.,0., 1, 0));
return EXIT_SUCCESS;
}
I compile using:
gcc test.c -I/usr/lib/R/include
2012 Jan 27
2
The following code (using rgamma) hangs
...get the following
##########################################################
int main(void)
{
set_seed(0, 0);
cout << "one normal " << norm_rand() << endl;
}
##########################################################
edd at max:/tmp$ g++ -o faheem faheem.cpp -lRmath; ./faheem
one normal -inf
One would expect norm_rand to return finite values, even in edge cases.
If you want me to report this as a bug, let me know. Thanks.
Regards, Faheem
2005 Jun 02
1
could not open libRmath.so
...ogram at another linux box where I don't
have root privilege. That machine only has binary version of R, so I
built R from source in my own directory:
/Users/tib/R
And I also compiled libRmath.so, copied it to /Users/tib/R/bin/
Now I use this to compile my program
g++ engine.cpp -o engine -lm -lRmath -I/Users/tib/R/lib/R/include/
-L/Users/tib/R/bin/
it did not report any error, however as I executed the program
./engine
it reported:
./engine: error while loading shared libraries: libRmath.so: cannot
open shared object file: No such file or directory
Why did it report this error but compile thr...
2008 May 13
1
Catching warning message(stdout) from C
I'm using the 'pnt' C function from Rmath library in some C-code.
How can I catch the warning message: "full precision was not achieved in
'pnt'" in R. I call the function using the .C().
(options(warn=-1) didn't work)
Thanks in advance
--
Maarten van Iterson
Center for Human and Clinical Genetics
Leiden University Medical Center (LUMC)
Research Building,
2004 Mar 19
1
R_qsort_int_I() error
...use R_qsort_int_I() in my C function, but getting the
following error. It looks like there is a conflict between Rmath.h,
which I use to generate random numbers, and R_ext/Boolean.h I would
appreciate any help to fix this problem.
gcc -ansi -g -o Gibbs gibbs.c subroutines.o rand.o vector.o -lm -lRmath
-llapack -lblas -lfrtbegin -lg2c -lm -shared-libgcc
In file included from /usr/include/R_ext/Utils.h:27,
from gibbs.c:7:
/usr/include/R_ext/Boolean.h:29: conflicting types for `FALSE'
/usr/include/Rmath.h:175: previous declaration of `FALSE'
/usr/include/R_ext/Boolean.h:2...
2004 Nov 02
0
how to call function in ../src/main
...double deg );
We use
GetPvalueForT: $(srcdir)/GetPvalueForT.c
swig -perl5 GetPvalueForT.i
gcc $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c GetPvalueForT.c
GetPvalueForT_wrap.c -I$(DCDFLIB)
-I/usr/local/lib/perl5/5.8.2/sun4-solaris-thread-multi/CORE -Im
ld -G GetPvalueForT.o -Im -L. -lRmath -lm GetPvalueForT_wrap.o -o
GetPvalueForT
in Makefile and we got GetPvalueForT.pm and GetPvalueForT and then we can
call it from perl:
test.pl:
#!/usr/local/bin/perl
use strict;
use GetPvalueForT;
sub test {
my ( $t, $deg ) = @ARGV;
my $result;
for( my $i=0; $i<1000000; $i++ ) {
$...
2000 Oct 30
1
unsuccesfully making libRmath.a
...1
make[1]: Leaving directory `/usr/lib/R-patched/src/nmath/standalone' make: ***
[archive] Error 2
I tried directly giving the names of the object files to ar, and it seems to
work... but not really:
> gcc -I/usr/lib/R-patched/src/include-L/usr/lib/R-patched/src/nmath/standalone test.c -lRmath
/tmp/ccJAm46E.o: In function `main':
/tmp/ccJAm46E.o(.text+0x22): undefined reference to `qnorm5'
collect2: ld returned 1 exit status
What am I doing wrong?
Ramon
--
Ramón Díaz-Uriarte
Triana 47
28016 Madrid
Spain
email:ramon-diaz at teleline.es
Phone: +...
2002 May 31
1
Two questions about nmath
Hi !
1) First question.
Excuse me for trouble with the same question. I still have problems
with the compilation of test.c in src/nmath/standalone.
I did follow the instructions you gave me but I still receive this message
[root at my standalone]# cc -o test test.c -L/usr/local -lRmath
/usr/local/libRmath.so: undefined reference to `log'
/usr/local/libRmath.so: undefined reference to `sqrt'
/usr/local/libRmath.so: undefined reference to `ceil'
/usr/local/libRmath.so: undefined reference to `floor'
/usr/local/libRmath.so: undefined reference to `cos'
/usr/local...
2005 Aug 11
1
include C functions from nmath in my own C functions
...e the
libRmath.so file. I also add the directories containg
libRmath.so to LD_LIBRARY_PATH by using command
"export
D_LIBRARY_PATH=$LD_LIBRARY_PATH:$/home/zhliu/Backup/R-2.0.1/src/nmath/standalon
e
"
However, when I try to run the following codes by the
command "gcc test.c -lRmath" on Linux Fedora Core 2,
/***********************************************/
/* file name test.c */
#define MATHLIB_STANDALONE 1
#include <Rmath.h>
int
main()
{
/* something to force the library to be included */
qnorm(0.7, 0.0, 1.0, 0, 0);
return 0;
}
/******************...
2003 Dec 14
1
compile error with C code and standalone R math C library
...(rr-sa.c) follows.
I'm on Debian sarge. I'm running R version 1.8.1. Gcc is version
3.3.1.
Thanks in advance.
Faheem.
**********************************************************************
faheem ~/co/rr/trunk>gcc -o rr rr-sa.c -lRmath -lm
/usr/lib/gcc-lib/i486-linux/3.3.2/../../../libRmath.so: undefined
reference to `Rlog1p'
collect2: ld returned 1 exit status
**********************************************************************
rr-sa.c
**********************************************************************
#include <stdi...
2002 Jan 14
1
trouble using R Mathlib as standalone
...tr[t-1];
else
a = beta*(ctr[t-1] + ctr[t+1]);
GetRNGstate();
u = unif_rand();
PutRNGstate();
y = (1/a)*log( ( exp(a) - exp(-a) )*u + exp(-a) );
return y;
}
****************************************************************************
g++-3.0 -c -Wall -pedantic -Werror -g rand.cc -lRmath
In file included from rand.cc:4:
/usr/include/Rmath.h:520: declaration of `double log1p(double)' throws
different exceptions
/usr/include/bits/mathcalls.h:125: than previous declaration `double
log1p(double) throw ()'
rand.cc: In function `double q_gibbs_rand(Cube&, double&, s...
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
2023 Feb 16
0
User-defined RNG with the standalone Rmath library
...#include <stdio.h>
double unif_rand(void) { return 0.5; }
int main() {
printf("%f\n", unif_rand());
printf("%f\n", runif(0, 1));
return 0;
}
If we compile using -static, then we get the correct result (two values of 0.5):
gcc -static -o test test.c -lRmath -lm
./test
: 0.500000
: 0.500000
Question: does this code work for other users?
Sincerely, Mark.
N?r du skickar e-post till Karolinska Institutet (KI) inneb?r detta att KI kommer att behandla dina personuppgifter. H?r finns information om hur KI behandlar personuppgifter<https://ki.se/meda...