[R] question about Rcmd SHLIB
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sun Oct 17 23:29:47 CEST 2004
On Sun, 17 Oct 2004 16:08:04 -0400, "Liqiang Ni" <lni at mail.ucf.edu>
wrote:
>I tried to create a shared library in Windows XP. However I got error
>messages which attached below:
>
>C:\lasso>Rcmd SHLIB all.f cox.f
>gcc all.o libR makeMakedeps all.dll -o all
>gcc.exe: libR: No such file or directory
>gcc.exe: makeMakedeps: No such file or directory
>make: *** [all] Error 1
>
>I have created shard libraries successfully before. Also for the same
>fortran files: all.f cox.f, I can create the object all.so successfully
>in Linux using R SHLIB. Any suggestion? Thanks.
The problem is the name all.f. Try another name.
`all' is a target in the Makefile and some implicit rule is being
triggered. Given that no one has reported this in all the years it has
been done this way, it just seems an unlucky choice of name. Adding
.PHONY : all libR makeMakedeps
to src/gnuwin32/MakeDll will fix it, at least with my make.
Incidentally, it would have helped if you had given the correct output,
which was something like
[c:/R/svn/trunk/src/gnuwin32/tmp]% rcmd SHLIB all.f cox.f
g77 -O2 -Wall -c all.f -o all.o
g77 -O2 -Wall -c cox.f -o cox.o
ar cr all.a all.o cox.o
ranlib all.a
gcc --shared -s -o all.dll all.def all.a -Lc:/R/svn/trunk/src/gnuwin32
-lg2c -lR
gcc all.o libR makeMakedeps all.dll -o all
gcc.exe: libR: No such file or directory
gcc.exe: makeMakedeps: No such file or directory
make: *** [all] Error 1
so this did in fact work! I think the output given is from a second run.
--
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 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list