Jonathan Li
2001-Dec-05 02:20 UTC
[R] trouble with R CMD INSTALL for building my own library
Hi, I have built a library that consists of a piece of C code and some R functions. To build it into a library that I can load using library() command, I have followed "Writing R Extensions" and made sub-directories such as mylib/R and mylib/src. But when I run R CMD INSTALL mylib, nothing seems to be happening with src directory, i.e., no C compiling. I have probably missed some key steps. But after reading very carefully "Writing R Extension", I conclude that I don't need to write my own Makefile in src since R CMD INSTALL will use the default in /usr/lib/R/etc/Makeconf Here is a copy of Makeconf file. In addition, R CMD check and R CMD build all ran without running "make". Is this the way it is supposed to be? (no error messages encountered). Where is the problem? Thanks in advance! BLAS_LIBS = -L. -lblas CC = gcc CFLAGS = -g -O2 CPICFLAGS = -fPIC CPPFLAGS = -I/usr/local/include CXX = c++ CXXCPP = c++ -E CXXFLAGS = -g -O2 CXXPICFLAGS = -fPIC ECHO_C = ECHO_N = -n ECHO_T = FC = g77 FFLAGS = -g -O2 FLIBS = -lg2c -lm -L/usr/lib/gcc-lib/i386-linux/2.95.4 -lm FPICFLAGS = -fPIC F2C = F2CFLAGS = LIBM = -lm LIBR = -L$(R_HOME)/bin -lR LIBS = -L/usr/local/lib -lz -lreadline -ldl -lncurses -lm LIBPATHS = -L/usr/local/lib LIBTOOL = $(SHELL) $(R_HOME)/bin/libtool SHELL = /bin/sh SHLIB_CFLAGS = SHLIB_CXXFLAGS = SHLIB_CXXLD = c++ SHLIB_CXXLDFLAGS = -shared SHLIB_EXT = so SHLIB_FFLAGS = SHLIB_LD = gcc SHLIB_LDFLAGS = -shared SHLIB_LIBADD = SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LDFLAGS) -- Jonathan Q. Li, PhD Agilent Technologies Laboratory Palo Alto, California, USA -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Kurt Hornik
2001-Dec-05 07:22 UTC
[R] trouble with R CMD INSTALL for building my own library
>>>>> Jonathan Li writes:> Hi,> I have built a library that consists of a piece of C code and some R > functions. To build it into a library that I can load using library() > command, I have followed "Writing R Extensions" and made > sub-directories such as mylib/R and mylib/src.It actually is 'package' and not 'library'.> But when I run R CMD INSTALL mylib, nothing seems to be happening with > src directory, i.e., no C compiling. I have probably missed some key > steps. But after reading very carefully "Writing R Extension", I > conclude that I don't need to write my own Makefile in src since R CMD > INSTALL will use the default in /usr/lib/R/etc/Makeconf Here is a copy > of Makeconf file. In addition, R CMD check and R CMD build all ran > without running "make". Is this the way it is supposed to be? (no > error messages encountered).Sounds strange. You really have mylib/src/foo.c (note the extension!) and nothing happens? -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
jonathan_li@agilent.com
2001-Dec-05 20:38 UTC
[R] trouble with R CMD INSTALL for building my own library
Hi all, Problem solved! Thanks to a suggestion by Robert Gentleman, I realized that there may be something that makes R think that mylib is a binary rather than source package. I downloaded Brian Ripley's tree source package and basically copied each directory. As it turns out, I have not put in a mylib/man subdirectory (I thought I could add it any time later.) and R was then tricked to believe that mylib is a binary! Once I add an empty mylib/man subdirectory, things become normal with compiling etc. Timothy, I think that your problem is likely to be the same source then. Regards, Jonathan -----Original Message----- From: Kurt Hornik [mailto:Kurt.Hornik at ci.tuwien.ac.at] Sent: Tuesday, December 04, 2001 11:22 PM To: Jonathan Li Cc: r-help at stat.math.ethz.ch Subject: Re: [R] trouble with R CMD INSTALL for building my own library>>>>> Jonathan Li writes:> Hi,> I have built a library that consists of a piece of C code and some R > functions. To build it into a library that I can load using library() > command, I have followed "Writing R Extensions" and made > sub-directories such as mylib/R and mylib/src.It actually is 'package' and not 'library'.> But when I run R CMD INSTALL mylib, nothing seems to be happening with > src directory, i.e., no C compiling. I have probably missed some key > steps. But after reading very carefully "Writing R Extension", I > conclude that I don't need to write my own Makefile in src since R CMD > INSTALL will use the default in /usr/lib/R/etc/Makeconf Here is a copy > of Makeconf file. In addition, R CMD check and R CMD build all ran > without running "make". Is this the way it is supposed to be? (no > error messages encountered).Sounds strange. You really have mylib/src/foo.c (note the extension!) and nothing happens? -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Kurt Hornik
2001-Dec-06 08:09 UTC
[Rd] RE: [R] trouble with R CMD INSTALL for building my own library
>>>>> jonathan li writes:> Hi all, > Problem solved!> Thanks to a suggestion by Robert Gentleman, I realized that there may > be something that makes R think that mylib is a binary rather than > source package. I downloaded Brian Ripley's tree source package and > basically copied each directory. As it turns out, I have not put in a > mylib/man subdirectory (I thought I could add it any time later.) and > R was then tricked to believe that mylib is a binary! Once I add an > empty mylib/man subdirectory, things become normal with compiling > etc. Timothy, I think that your problem is likely to be the same > source then.Jonathan: In that case, does not R CMD INSTALL start by saying "Installing binary package ..."? -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._