similar to: Calling C from Fortran

Displaying 20 results from an estimated 500 matches similar to: "Calling C from Fortran"

2005 Jun 14
3
Calling C from Fortran
I would like to call C routines from Fortran under linux as suggested in section 5.6 of the "Writing R extensions" documentation. I'm familiar with Fortran but not with C. I understand the example provided in Fortran: subroutine testit() double precision normrnd, x call rndstart() x = normrnd() call dblepr("X was", 5, x, 1) call rndend() end but I don't understand
2009 Dec 29
2
how can I use R functions in Fortran 90
Hi all, Is there a way that I can import R functions into Fortran? Especially, I want to generate random numbers from some not-so-common distributions (e.g. inverted chi square) but did not find any routines written in Fortran that deal with distributions other than uniform and normal. Thanks. Anny [[alternative HTML version deleted]]
2005 Nov 30
2
R binomial RNG stuck at 1 via Fortran call
Hi, I have some trouble with the result of a fortran function calling the R binomial RNG: The C function rbinom is wrapped as in the file attached. My main fortran program starts as call rndstart() and ends as call rndend() I happen to call the binomial RNG within a loop as b = ggrbinom(1.d0,0.5d0) write(*,*) 'b=',b In certain cases, after a few iterations in the loop, b get
2005 Nov 30
1
RNG stuck via Fortran call
Having not much success with my previous question I try to reformulate it: I'm simulating a Markow chain in Fortran interfaced with R. Each loop of my Fortran calls various functions of the R RNG through the wrapper given below. In a run of 100 iterations of the Markov kernel, after 20 iterations, the RNG seems like frozen. For example, the first call to the RNG in my loop is:
2006 Jan 20
3
Troubles with the function rmultinom.c of the R's Random Number Generator
Hi, I'm simulating a Markov chain in Fortran interfaced with R-2.2.1 in order to generate data according to a Markov Random Field called the Potts model. R Version: platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 2.1 year 2005 month 12 day 20 svn rev 36812 Each loop of my Fortran calls the function rmultinom.c
2009 Nov 16
2
(Parallel) Random number seed question...
Hi All, I have k identical parallel pieces of code running, each using n.rand random numbers.? I would like to use the same RNG (for now), and set the seeds so that I can guarantee that there are no overlaps in the random numbers sampled by the k pieces of code.? Another side goal is to have reproducibility of my results.? In?the past I have used C with SPRNG for this task, but I'm hoping
2009 Jun 30
3
Matrix with random number
Hello! I have a program in Fortran and would like to build a matrix with random numbers, I have a function in C. However, I have problems with the use of function in R. Code to compile: R CMD SHLIB mat.f myrbeta.c -o func.so Code in C. #include <R.h> #include <Rmath.h> void F77_SUB(fseedi)(void){   GetRNGstate(); } void F77_SUB(fseedo)(void){   PutRNGstate(); } void
2005 Jul 05
1
calling fortran functions CHOL and DPOTRF form Fortran
Hi all, I'm working out some Fortran code for which I want to compute the Choleski decomposition of a covariance matrix in Fortran. I tried to do it by two methods : 1) Calling the lapack function DPOTRF. I can see the source code and check that my call is correct, but it does not compile with: system("R CMD SHLIB ~/main.f") dyn.load("~/main.so") I get: Error in
2017 May 09
2
registering Fortran routines in R packages
Dear list, I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics. Reading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
2017 May 10
3
registering Fortran routines in R packages
Thanks for your email. I try to change the name in lowercase but it conflicts with a C implementation also named halton. So I rename the C function halton2() and sobol2() while the Fortran function are HALTON() and SOBOL() (I also try lower case in the Fortran code). Unfortunately, it does not help since I get init.c:97:25: error: use of undeclared identifier 'halton_'; did you mean
2001 Jul 14
1
Calling rand_unif() from fortran
What is the necesary incantation to call rand_unif() from a fortran routine? Just inserting rand_unif() into the fortran code compiles OK, but won't dyn.load(): > dyn.load("forest.so") Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library "/home/warnes/R/forest/forest.so": /home/warnes/R/forest/forest.so: undefined symbol:
2000 Aug 11
2
R-devel Aug-09 1.2.0 build on hpux10.20
Hello, I had to set CPPFLAGS and FC=fort77 but configure saw atlas and used it instead of blas. However atlas for hp seems to missing some libs. I had to add -lblas in Makeconf. Everything builds ok. But modreg and tcltk doesn't load. R : Copyright 2000, The R Development Core Team Version 1.2.0 Under development (unstable) (2000-August-9) R is free software and comes with ABSOLUTELY NO
2009 Jan 15
2
Interface to open source Reporting tools
Hi, I am a new user of R 2.8.1. I use Tinn-R for code editing. I use a windows 2003 system with 1 GB RAM. I am interested to generate dashboard and reports based on data from MS Access. These reports need to be posted on a weekly basis to the web. The reporting interface should provide facilities for "what if" scenarios. Is it possible to interface R analysis results to good open
2004 Oct 25
5
building a package under windows
Hi, I have a package of my own which seems to work fine under linux. I want to make a compiled version for windows. (I work with windows 2000 and R 2.0) I have followed the steps described in the file readme.packages (in the top-level directory of the binary installation) and I had a trouble at this step (which aim is not documented): C:\Program Files\R\rw2000\src\gnuwin32>make libR.a
2005 Oct 26
1
pb with dyn.load - fortran code now attached
Hi, here are a couple of strange things happening with R.2.2.0 compiled under Mandrake-10.1 At the begining of the story I have segmentation fault using package RandomFields in conjuction with some Fortran code of mine loaded with dyn.load. One of my fortran programs contains a subroutine named fstat Trying to trace , I simplified the sequence as much as possible and I end up with the the
2002 Jul 03
1
Calling qnorm from Fortran
The R-exts may explicitly state this but I missed it. How do I call qnorm or pnorm from Fortran? Thanks -Frank -- Frank E Harrell Jr Prof. of Biostatistics & Statistics Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences U. Virginia School of Medicine http://hesweb1.med.virginia.edu/biostat
2017 May 10
1
registering Fortran routines in R packages
Have you tried using tools:::package_native_routine_registration_skeleton()? If you don't like its output, you can easily edit its results and still avoid most pitfalls. Cheers, Jari Oksanen ________________________________________ From: R-devel <r-devel-bounces at r-project.org> on behalf of Berend Hasselman <bhh at xs4all.nl> Sent: 10 May 2017 09:48 To: Christophe Dutang Cc:
2001 May 09
1
Fortran subroutines dblepr, realpr, intpr
I am making my first attempts at using some Fortran code with R, and so far it's going OK. To print from my Fortran programs, it seems I need subroutines dblepr, realpr and intpr. From the excellent "Writing R Extensions" document: "Three subroutines are provided to ease the output of information from FORTRAN code. subroutine dblepr(label, nchar, data, ndata)
2009 Feb 13
2
Generate random numbers in Fortran
Hi!!! It would like to know if it exists a form to use the functions to generate variates in FORTRAN with the same easiness I use that them in C? Or not? If yes. They would have some example? I would like to use the functions rbeta, rlnorm and others! Sorry my english..rsrsrs Thanks!!!              Fábio Mathias Corrêa    University Federal of the Lavras - Brazil Veja quais são os
2005 Nov 08
1
R build under mandriva 10.2
After upgrading from mandrake 10.1 to mandriva 10.2 I can't build shared archive with R 2.2.0 [guillot at laplace src]$ R CMD SHLIB main.f sub.f wrapper.c gcc -shared -L/usr/local/lib -o main.so main.o sub.o wrapper.o -lg2c -lm -lgcc_s /usr//bin/ld: cannot find -lg2c collect2: ld returned 1 exit status make: *** [main.so] Erreur 1 I guess the information in