[R] Building package on Windows: No rule to make target '-llapack'
Zhu Wang
zhuw at mail.smu.edu
Thu Jun 10 12:06:54 CEST 2004
On Thu, 2004-06-10 at 06:40, Prof Brian Ripley wrote:
> On Wed, 9 Jun 2004, Zhu Wang wrote:
>
> > I have a problem to build a package on Windows XP while there is no
> > problem on Linux. The Makefile is something like:
>
> There would be a problem on Linux, if that Makefile were used. I suspect
> it is not used.
Believe or not, it works.
> > ###########
> > LIBNAME=cts
> >
> > PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
>
> (You should not need $(FLIBS) here.)
>
> > OBJS=file1.o ... file20.o -llapack -lblas
>
> The last two are not objects, and -llapack refers to something like
> liblapack.a. I don't see how this can work anywhere. On the other hand,
> you have lapack and blas selected in PKG_LIBS, but you are not using that
> macro.
I did this because I did not find good examples about how to link Lapack
and Blas using R. So I tried this and it works.
> > $(LIBNAME)$(SHLIB_EXT): $(OBJS)
> > $(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS) $(FLIBS)
> >
> > clean:
> > @rm -f *.o *.$(SHLIB_EXT)
> >
> > realclean: clean
> > #############
> >
> > To build the package on Windows XP, I have followed the instructions to
> > install tools/software required and it seems the 'make' worked fine,
> > except for the error message:
> >
> > make[3]: No rule to make target 'llapack', needed by 'cts.a'. stop.
> >
> > Now I think maybe two problems: one is that maybe I do not have Lapack and Blas installed
> > on Windows XP and second is that I do not set up a correct file, something like 'configure'.
> > Maybe there are more problems. I have read some files in \src\gnuwin32, but I did not find
> > what I needed.
>
> What are you actually trying to do? It is not normal for a package to
> have a Makefile in its src directory, which is what I guess (but only
> guess) you have presented. All that is normally needed is a Makevars
> file. Take a look at e.g. that in mclust.
I did find an R package which uses Makefile in its src directory, and I
just happened to be familiar with. But it was on the author's website
and not on CRAN. Maybe that's a bad example. I will take a look at that
in mclust.
> Is this your package or someone else's (in which case why are you not
> asking the author)? Either you or that author needs to read `Writing R
> Extensions' and look at some of the many examples in CRAN packages.
This is mine. I agree with you. Certainly there are more stuff I need to
know about 'Writing R Extensions'. The package is on my website, see
below. Using the following:
#R CMD check cts
#R CMD INSTALL cts
I have successfully installed the package. Thanks for your advice. On
the other hand, it might be a successful story how R is robust!
--
Zhu Wang
Statistical Science Department
Southern Methodist University
Dallas, TX 75275-0332
Phone:(214)768-2453 Fax:(214)768-4035
zhuw at mail.smu.edu
http://people.smu.edu/zhuw
More information about the R-help
mailing list