Kyeongmi Cheon
2008-Apr-18 04:23 UTC
[Rd] R-extension in unix system -- help to locate header files
Hi list, To call C, I used to use R-extension in windows but I'm moving to unix system because my PC doesn't have enough memory. My C codes requires to include the following header files: #include <stdlib.h> #include <R.h> #include <Rdefines.h> #include <Rmath.h> #include <R_ext/Applic.h> #include <R_ext/PrtUtil.h> In windows, I had no problem with it because I set the path for Rtools and R etc. But in unix system, these header files call other header files and they call other header files... And some files are not in R folders so I have to manually find them and give path and it takes for ever. For example, #include </usr/include/stdlib.h> #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/R.h> #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/Rmath.h> #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/Rdefines.h> #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/R_ext/Applic.h> #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/R_ext/PrtUtil.h> but now <R_ext/Memory.h> calls <stddef.h> and I have to search the whole directory of my school computer to find it. Same for other header files... Is there better way to do it? Or is there any package for unix that has "all" the needed header files so that I can download them only once and don't have to search for them? I appreciate your help in advance. Kyeongmi University of memphis
Prof Brian Ripley
2008-Apr-18 05:13 UTC
[Rd] R-extension in unix system -- help to locate header files
You should never give full paths in #include statements. The search paths for include ('header') files are set by the compiler and supplemented by -I flags on the command line. If your C compiler is unable to find <stdlib.h> something is badly wrong, and you need to ask your 'unix' advisor for help. (BTW, these header files are OS-specific, and some of them will be compiler-specific -- on my Solaris Unix box cc and gcc use different versions of some of these headers.) On Thu, 17 Apr 2008, Kyeongmi Cheon wrote:> Hi list, > To call C, I used to use R-extension in windows but I'm moving to unix system > because my PC doesn't have enough memory. My C codes requires to include the > following header files: > > #include <stdlib.h> > #include <R.h> > #include <Rdefines.h> > #include <Rmath.h> > #include <R_ext/Applic.h> > #include <R_ext/PrtUtil.h> > > In windows, I had no problem with it because I set the path for Rtools > and R etc. > But in unix system, these header files call other header files and > they call other > header files... And some files are not in R folders so I have to > manually find them > and give path and it takes for ever. For example, > > > #include </usr/include/stdlib.h> > #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/R.h> > #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/Rmath.h> > #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/Rdefines.h> > #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/R_ext/Applic.h> > #include </gpfs/data/local/linux/R-2.6.2/lib64/R/include/R_ext/PrtUtil.h> > > but now > <R_ext/Memory.h> calls <stddef.h> and I have to search the whole > directory of my > school computer to find it. Same for other header files... > > Is there better way to do it? Or is there any package for unix that > has "all" the > needed header files so that I can download them only once and don't > have to search > for them? I appreciate your help in advance. > Kyeongmi > > University of memphis > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- 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