-----Original Message-----
From: Uwe Ligges [mailto:ligges@statistik.uni-dortmund.de]
Sent: Wednesday, December 12, 2001 7:29 AM
To: Prof Brian Ripley
Cc: Liaw, Andy; R-devel
Subject: Re: [R] Rcmd SHLIB problem
[moved to R-devel]
Prof Brian Ripley wrote:
it should and does work with Fortran (and C++) files. The
Rcmd SHLIB tryf.f
I've just tested that under rw1031 and the pretest of 1.4.0, so I've
no idea what's up for you.
B
On Mon, 10 Dec 2001, Liaw, Andy wrote:
Dear R-help,
I'm having problem creating a dll using Rcmd SHLIB with
C:\TEMP>Rcmd SHLIB tryf.o
make[1]: `libR.a' is up to date.
make: *** No rule to make target `'tryf.o', needed by
C:\TEMP>Rcmd SHLIB tryf.f
make[1]: `libR.a' is up to date.
make: *** No rule to make target `'tryf.o', needed by
`tryf.a'. Stop.
^^^^
Notice the quotes! Same problem here (R-1.4.0, unstable, NT4).
Not sure if it is a bug in R, in perl or in (what I presume) make.
To debug it, I took the relevant line from SHLIB (inserting the
variables):
make -f d:/uwe-ns/R140-071201/src/gnuwin32/MakeDll
RHOME=d:/uwe-ns/R140-071201 DEBUG=T DLLNAME=pan CFSOURCES='pan.f'
CXXSOURCES='' RCOBJ=
make: *** No rule to make target `'pan.o', needed by `pan.a'. Stop.
Now leaving out quotes at some places:
d:\uwe>make -f d:/uwe-ns/R140-071201/src/gnuwin32/MakeDll
RHOME=d:/uwe-ns/R140-071201 DEBUG=T DLLNAME=pan CFSOURCES='pan.f'
CXXSOURCES= RCOBJ=
make: *** No rule to make target `'pan.o', needed by `pan.a'. Stop.
make -f d:/uwe-ns/R140-071201/src/gnuwin32/MakeDll
RHOME=d:/uwe-ns/R140-071201 DEBUG=T DLLNAME=pan CFSOURCES=pan.f
CXXSOURCES='' RCOBJ=
g77 -O2 -g -Wall -c pan.f -o pan.o
make: *** No rule to make target `''.o', needed by `pan.a'. Stop.
make -f d:/uwe-ns/R140-071201/src/gnuwin32/MakeDll
RHOME=d:/uwe-ns/R140-071201 DEBUG=T DLLNAME=pan CFSOURCES=pan.f
CXXSOURCES= RCOBJ=
rm -f -f pan.a
ar cr pan.a *.o
ranlib pan.a
------- Building pan.dll from pan.a --------
echo LIBRARY pan > pan.def
echo EXPORTS >> pan.def
nm pan.a > Defs
sed -n '/^........ [BCDRT] _/s/^........ [BCDRT] _/ /p' Defs
rm -f Defs
gcc --shared -o pan.dll pan.def pan.a -lg2c
d:/uwe-ns/R140-071201/bin/R.dll
OK. This works now --- without any quotes - but where is the error?
The following line also works (other kind of quotes):
make -f d:/uwe-ns/R140-071201/src/gnuwin32/MakeDll
RHOME=d:/uwe-ns/R140-071201 DEBUG=T DLLNAME=pan CFSOURCES="pan.f"
CXXSOURCES="" RCOBJ=
As a summary: Changing the relevant line in SHLIB to
system("make -f $R_HOME/src/gnuwin32/MakeDll RHOME=$R_HOME $debug
DLLNAME=$dllname CFSOURCES=$srcs CXXSOURCES=$cxx RCOBJ=");
works, but that's not a general solution. And "double-quotes"
cannot be
used two times.
Any ideas?
I compiled R from source, so I'm quite sure I've got all
Can anyone explain what I'm missing? The FAQ only
code. I'd imagine that Fortran code works the same way, no?
Any help/hint are much appreciated!