faheem@email.unc.edu
2003-Mar-16 21:44 UTC
[Rd] R CMD SHLIB uses foo.c instead of foo.cc if both are present (PR#2645)
On Sun, 16 Mar 2003, Duncan Temple Lang wrote:> The "fix" is relatively simple. One can change the order of the > suffixes listed in $R_HOME/etc/Makeconf (i.e. the Makeconf.in version) > to alter the precedence. If one changes the line > > .SUFFIXES: .c .cc .cpp .C .d .f .lo .o > > to place the '.c' after the '.cc', your example will work as you want it.Just to clarify. Is this something that you (ie. R developers) are planning to change, or are you just recommending that I change it? If so, it will break on every upgrade. Wonder if I can put this in Makevars as a local override, though... Hmm. Perhaps using makefiles would be easier, really.> While the behavior is not desirable since you specified foo.cc on the > command line for R CMD SHLIB, I don't think it is a good idea to be > using files named x.c and x.cc in the same directory. I would think > that this will lead to confusions with other tools and I can't think > of a context in which it is necessary.Mmm. Certainly not *necessary*. I still think it is a bug, though. Faheem.
Kurt Hornik
2003-Mar-17 22:35 UTC
[Rd] R CMD SHLIB uses foo.c instead of foo.cc if both are present (PR#2645)
>>>>> faheem writes:> On Sun, 16 Mar 2003, Duncan Temple Lang wrote:>> The "fix" is relatively simple. One can change the order of the >> suffixes listed in $R_HOME/etc/Makeconf (i.e. the Makeconf.in version) >> to alter the precedence. If one changes the line >> >> .SUFFIXES: .c .cc .cpp .C .d .f .lo .o >> >> to place the '.c' after the '.cc', your example will work as you want it.> Just to clarify. Is this something that you (ie. R developers) are > planning to change, or are you just recommending that I change it? If > so, it will break on every upgrade. Wonder if I can put this in > Makevars as a local override, though...> Hmm. Perhaps using makefiles would be easier, really.It may be possible to work around this from your end using R CMD COMPILE first and then calling R CMD SHLIB only for the linking part.>> While the behavior is not desirable since you specified foo.cc on the >> command line for R CMD SHLIB, I don't think it is a good idea to be >> using files named x.c and x.cc in the same directory. I would think >> that this will lead to confusions with other tools and I can't think >> of a context in which it is necessary.> Mmm. Certainly not *necessary*. I still think it is a bug, though.Actually, if you have foo.c and foo.cc in the same dir and compile these for linking into a shared library they would both compile into foo.o ... -k
Reasonably Related Threads
- R CMD SHLIB uses foo.c instead of foo.cc if both are present (PR#2648)
- R CMD SHLIB uses foo.c instead of foo.cc if both are present (PR#2644)
- R CMD SHLIB in Windows XP - No output at all
- passing arguments to R CMD SHLIB
- problem in compililng c code using R CMD SHLIB