Dear R-help, I'm having problem creating a dll using Rcmd SHLIB with R-1.3.1 on WinNT4: C:\TEMP>Rcmd SHLIB tryf.o make[1]: `libR.a' is up to date. make: *** No rule to make target `'tryf.o', needed by `tryf.a'. Stop. 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. I compiled R from source, so I'm quite sure I've got all the right tools. Can anyone explain what I'm missing? The FAQ only mentioned compiling C code. I'd imagine that Fortran code works the same way, no? Any help/hint are much appreciated! Cheers, Andy Andy I. Liaw Biometrics Research Phone: (732) 594-0820 Merck & Co., Inc. Fax: (732) 594-1565 P.O. Box 2000, RY70-38 Rahway, NJ 07065 mailto:andy_liaw at merck. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
it should and does work with Fortran (and C++) files. The right format is 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 R-1.3.1 on WinNT4: > > C:\TEMP>Rcmd SHLIB tryf.o > make[1]: `libR.a' is up to date. > make: *** No rule to make target `'tryf.o', needed by `tryf.a'. Stop. > > 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. > > I compiled R from source, so I'm quite sure I've got all the right tools. > Can anyone explain what I'm missing? The FAQ only mentioned compiling C > code. I'd imagine that Fortran code works the same way, no? > > Any help/hint are much appreciated! > > Cheers, > Andy > Andy I. Liaw > Biometrics Research Phone: (732) 594-0820 > Merck & Co., Inc. Fax: (732) 594-1565 > P.O. Box 2000, RY70-38 Rahway, NJ 07065 > mailto:andy_liaw at merck. > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
[moved to R-devel] Prof Brian Ripley wrote:> > it should and does work with Fortran (and C++) files. The right format is > > 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 R-1.3.1 on WinNT4: > > > > C:\TEMP>Rcmd SHLIB tryf.o > > make[1]: `libR.a' is up to date. > > make: *** No rule to make target `'tryf.o', needed by `tryf.a'. Stop. > > > > 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='' RCOBJmake: *** 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= RCOBJmake: *** 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='' RCOBJg77 -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= RCOBJrm -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 >> pan.def 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 the right tools. > > Can anyone explain what I'm missing? The FAQ only mentioned compiling C > > code. I'd imagine that Fortran code works the same way, no? > > > > Any help/hint are much appreciated!Uwe -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._