[Rd] gfortran Makefile for windows

2005-09-28 Thread Joel Bremson
Hi all,

(Originally posted to r-help)

I'm porting a package that I've worked on for OS X to Windows.
The package is written in F95 so I need to compile it with gfortran
and link it with gcc4.

I've been trying to build an R with gcc4 without luck so far. If there is
a binary of such a thing info would be appreciated.

This package requires a Makefile. My question is, how can I find out
(or what is), the link command?

Here is the OS X Makefile:


RLIB_LOC=${R_HOME}

F90_FILES=\
class_data_frame.f90 \
class_old_dbest.f90 \
class_cm_data.f90 \
class_cm.f90 \
class_bgw.f90 \
class_cm_mle.f90 \
cme.f90


FORTRAN_FILES=\
dgletc.f \
dglfgb.f\
dglfg.f\
dmdc.f\
mecdf.f


%.o: %.f90
gfortran -c -g $<

%.o: %.f
gfortran -c -g $<

bpkg.so: $(F90_FILES:%.f90=%.o) $(FORTRAN_FILES:%.f=%.o)
gcc -Wall -bundle -flat_namespace -undefined suppress -L/sw/lib
-L/usr/local/lib -o $@ $^ \
-L$(RLIB_LOC)/lib -lR

###EOF

The -L lib dirs are not correct. On a *nix platform I would do something
like this

sh -x R CMD SHLIB ...

to get at the R internal link information but I can't get that to work on
Cygwin.

Regards,

Joel

--
Joel Bremson
Graduate Student
Institute for Transportation Studies - UC Davis
http://etrans.blogspot.com

[[alternative HTML version deleted]]

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


[Rd] windows/g95 peculiarity

2005-10-08 Thread Joel Bremson
I'm not looking for an answer here, this is just a report of a
peculiar event I've observed
and can reproduce.

I'm developing a g95 (20050129) compiled package on windows xp pro
using R-2.1.1, and gcc-3.4.2 (mingw special). An older version of the
F95 package compiled and ran without problems. The new version of the
package includes extensive changes in the code.

The package has a test function, rtest(), which sets up a testing
scenario and runs it.

If I try to immediately load the library after starting up R and
running rtest(), the following
occurs:

> library("bpkg")
.onLoad: running R_g95_init
> o = rtest()
Testing cm.estimate...
Using short data set (testing)...
 25500.00 2499.000 11.0 300.
...
 5 0.000
 6 0.000
Operating system error: Not enough space
Memory allocation failed

(R exits in terminal, or freezes as GUI)

However, if I import a data element the rtest runs fine. I know
rtest() doesn't need the extra data import because it runs without
problems on our OS X version.

> library("bpkg")
.onLoad: running R_g95_init
> data(yij)
> o = rtest()
Testing cm.estimate...
Using short data set (testing)...
 25500.00 2499.000 11.0 300.
...
 6 0.000
Done

>
(R continues to run without problems)

The default rtest runs a short data set because the full test data set
takes about
30 seconds to compute. When I start off by running the full rtest data
set I also
don't have any problems with R.

This package runs without problems on a G4/Tiger OS X mac with R-2.1.1, although
we do compile it with gfortran on that platform.

This is just a report. If anyone has any questions let me know.

Best,

Joel

--
Joel Bremson
Graduate Student
Institute for Transportation Studies - UC Davis
http://etrans.blogspot.com

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