Re: [Rd] call fortran in R

2005-08-04 Thread Ales Ziberna
If I understand correctly, you used
.Fortran("wrapper",)

The problem might be that the function name ("wrapper") was changed in the 
compilation of the code! See the mail bellow for clues (a previous post on 
R-help by Duncan Murdoch)

Natalie Hawkins wrote:
> Using R 2.0.1 on Windows XP, I am getting an error
> msg:
>
> Error in .Fortran("conic", nxy = nxy, npt = npt, CP =
> cp, EP1 = ep1, EP2 = ep2,  :
>
> Fortran function name not in load table
>
> I am wondering if there is a way to see what function
> names are in the load table?  Maybe the function name
> has been altered?

You need to look at the DLL to see what name it is exporting. I believe
R would be looking for "conic_".  If your Fortran compiler doesn't
append underscores, you'll get this error.

You might want to look at this page

http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/index.html#badname

or this one

http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/fortran.html

for more help.

Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Which TEX for Wiindows

2005-08-23 Thread Ales Ziberna
I am intending to instal TEX (for use with R - building, checking packages) 
on my WinXP SP2. I read that fptex is recomended, however 
http://www.fptex.org/ is not not available. Is MiKTeX the next best choice?

Thanks in advance for any suggestions!
Ales Ziberna

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Free-form to fixed-form Fortran

2005-08-27 Thread Ales Ziberna
Thank you for your reply!

I know I can use g77 with -ffree-form. However, I do not know how to make a 
package so that when others would build a package, these subrutines would 
compile with "-ffree-form". I heard of "makevars" and flags, however I read 
on the mailing list archives that they are ignored on Windows.

Ales


- Original Message - 
From: "Simon Urbanek" <[EMAIL PROTECTED]>
To: "Aleš Žiberna" <[EMAIL PROTECTED]>
Cc: "R Development Mailing List" 
Sent: Friday, August 26, 2005 8:29 PM
Subject: Re: [Rd] Free-form to fixed-form Fortran


Aleši,

On Aug 26, 2005, at 10:36 AM, Aleš Žiberna wrote:

> I have writen some subrutines in Free-form Fortran. I would like to
> includ
> them in a package, which I would like to build on WinXP. I have all
> suggested tools/programs for bulding R packages on Windows (except
> latex).
>
> What is the best way of using these subrutines? Does sombody mybe
> know any
> translation tools for converting Free-form to fixed-form Fortran?

If your only concern is to build it, you may try using g77 with -
ffree-form. This should work with GNU Fortran. However, that limits
the availability of your package to GNU compilers only.

Cheers,
Šimon

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Buliding a package (on Windows) does not produce libs directory

2005-11-25 Thread Ales Ziberna
Dear expeRts!



I have produced a package and I would like to compile it on windows to build 
a binary package. The package also includes Fortran code. This is where I 
have problems.



The package compiles fine, however the Fortran code seams to be ignored. I 
have the Fortran code in src subdirectory. I have all the compilers 
installed. Actually, if I compile the Fortran subroutines manually and then 
place them in the libs subdirectory (which I have to create) in the zip 
file, the package loads nicely and the Fortran subroutines can be used.



At the bottom of the mail is the output I get when calling R CMD build (if I 
call install the result is similar).



I apologize if this has been answered previously, since I have not found it.


C:\Ales\Statistika>R CMD build --binary --docs="none" blockmodeling
* checking for file 'blockmodeling/DESCRIPTION' ... OK
* preparing 'blockmodeling':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* removing junk files
* checking for LF line-endings in source files
* checking for empty directories
* building binary distribution
 WARNING
* some HTML links may not be found
installing R.css in C:/TEMP/Rinst.1696



Using auto-selected zip options ' blockmodeling-HELP=ziponly'



-- Making package blockmodeling 
  adding build stamp to DESCRIPTION
  installing R files
  installing man source files
  installing indices
  preparing package blockmodeling for lazy loading
  adding MD5 sums



packaged installation of package 'blockmodeling' as blockmodeling_0.1.0.zip
* DONE (blockmodeling)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Problems with sending data to FORTRAN subrutine

2005-12-12 Thread Ales Ziberna
Dear ExpeRts!

I have problem with sending data to FORTRAN subroutine on Windows XP and R 
2.1.1. When I call it using .Fortran, I get the following error:

R for Windows GUI front-end has encountered a problem and needs to close. We 
are sorry for the inconvenience.

Error signature
AppName: rgui.exe  AppVer: 2.11.50620.0   ModName: read.dll
ModVer: 0.0.0.0  Offset: 1683


It seams that the error is somehow related to the size of the data. Here are
the calls:
dyn.load("C:/ales/b_for/read.dll")
#The FORTRUN subroutine used to create the "read.dll" ("read.f") is attached 
(and in case something happens to the attachment also at the end of the 
mail.

n<-as.integer(134);k<-as.integer(2);M<-matrix(as.double(rnorm(n=n^2)),nrow=n,ncol=n);.Fortran("read",M=M,n=as.integer(n),clu=as.integer(sample(1:k,size=n,replace=TRUE)),
 
k=as.integer(k),diag=as.integer(1),err=as.double(0.0),E=matrix(as.double(0),ncol=k,nrow=k),
 
BM=matrix(as.double(0),ncol=k,nrow=k))
#This works ok

n<-as.integer(134);k<-as.integer(4);M<-matrix(as.double(rnorm(n=n^2)), 
nrow=n,ncol=n);.Fortran("read",M=M,n=as.integer(n),clu=as.integer(sample(1:k,size=n,replace=TRUE)),
 
k=as.integer(k),diag=as.integer(1),err=as.double(0.0),E=matrix(as.double(0),ncol=k,nrow=k),
 
BM=matrix(as.double(0),ncol=k,nrow=k))
#Now the k is incrised form 2 to 4 and the error occours.

n<-as.integer(40);k<-as.integer(4);M<-matrix(as.double(rnorm(n=n^2)),nrow=n,ncol=n);.Fortran("read",M=M,n=as.integer(n),clu=as.integer(sample(1:k,size=n,replace=TRUE)),
 
k=as.integer(k),diag=as.integer(1),err=as.double(0.0),E=matrix(as.double(0),ncol=k,nrow=k),
 
BM=matrix(as.double(0),ncol=k,nrow=k))
#If I leave the k at 4 and reduce the n to 40, then it works.


Any suggestions are welcomed. Thank you in advance!


Best regards,
Ales Ziberna


The commands used to generate "read.dll".
g77 -c read.f
R CMD SHLIB read.o


The FORTRAN subroutine ("read.f"):
subroutine read(M,n,clu,k,diag,err,E,BM)
INTEGER n, clu, k, i, j, ii, nA, nAD
DOUBLE PRECISION M, E, BM, A, AD, vecA, vecAD, err, mean, temp, ss
LOGICAL diag
DIMENSION M(n,n), clu(n), E(k,k), BM(k,k), A(k,k,n*n), AD(k,n), 
nA(k,k), nAD(k), vecA(n*n), vecAD(n)

end
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel