Hi, this relates to R-devel of 1999/July/18. I will outline what I had to change to get R to compile with cc then with gcc. Note that R compiled with cc works, R compiled with gcc is broken. --> Compile with cc: 1) Edit src/main/saveload.c: disable the undefine! With the #undef _XOPEN_SOURCE_EXTENDED the compilation dies an untimely death. (And the header files are not as badly broken for cc!) 2) Edit src/appl/sock.c: dto. 3) Edit src/unix/system.c: need a "break;" after default: in line 752 (yes, won't compile without) 4) Edit src/main/builtin.c: line 318 should read "#endif /* NOT_used */" (get rids of the warning) 5) CC=cc ../configure Note this is broken for the dependency check (ld barfs the error message to stdout instead of the log file?) checking whether cc accepts -M for generating dependencies... ld: 0711-317 ERROR : Undefined symbol: .main ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. no Note 2 that configure leaves a file called "-fp-no-toc" behind. Oops. 6) make && make check and everything looks ok. --> Compile with gcc: 1) 2) 3) 4) like above Additionally edit *sock.c: 5b) In appl/Rsock.c and appl/sock.c added `#include "Rconfig.h"' (This doesn't hurt the cc compilation.) 6b) CC=gcc ../configure Surprises: this finds libcurses and libz. I don't know where, though. So I manually remove -lreadline -lz -lcurses from the LIBS line in Makeconf. Note that I add my private readline with the help of CPPFLAGS and LIBS in config.site (thanks, Kurt). 7b) edit Rconfig.h: #ifdef __GNUC__ typedef long blkcnt_t; #endif Yes, I NEED this for gcc 2.8.1. This is a gcc bug, because gcc -I/usr/include will compile. What I've learned is that it is essential to verify which include files the compiler finds, these are not always the ones in /usr/include! Maybe configure can pick this up? This gets you to a point where things will compile. What remains is the NaN and Inf problem. I've tried to disable the finite function by overriding the configure result (a la finite=no). But then R core dumps. And uh, those ugly tick marks... I'm afraid this all doesn't make too much sense, it's a mess. Lemme know, if there is something you want me to try. -tom -- mailto:tov@ece.cmu.edu (Tom Vogels) Tel: (412) 268-6638 FAX: -3204 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 19 Jul 1999, Thomas Vogels wrote:> > Hi, > > this relates to R-devel of 1999/July/18. I will outline what I had > to change to get R to compile with cc then with gcc. Note that R > compiled with cc works, R compiled with gcc is broken.> 3) Edit src/unix/system.c: need a "break;" after default: in line 752 > (yes, won't compile without)There is no longer a line 752, but this was added (by Kurt) in the current sources (line 317). When I saw this I checked my books and all my lint-like tools: the code I wrote does seem valid C according to all my checks. Would just ";" satisfy your compiler?> --> Compile with gcc: > > 1) 2) 3) 4) like aboveWill gcc really not accept 3) on your platform? It does on all of mine, in all the versions of gcc I tried. It would be a surprise for gcc's parser to be platform-specific. -- Brian D. Ripley, ripley@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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> Thomas Vogels writes:> Hi,> this relates to R-devel of 1999/July/18. I will outline what I had > to change to get R to compile with cc then with gcc. Note that R > compiled with cc works, R compiled with gcc is broken.> --> Compile with cc:> 1) Edit src/main/saveload.c: disable the undefine! With the #undef > _XOPEN_SOURCE_EXTENDED the compilation dies an untimely death. > (And the header files are not as badly broken for cc!)> 2) Edit src/appl/sock.c: dto.Done.> 3) Edit src/unix/system.c: need a "break;" after default: in line 752 > (yes, won't compile without)Already taken care of> 4) Edit src/main/builtin.c: line 318 should read "#endif /* NOT_used */" > (get rids of the warning)???> 5) CC=cc ../configure> Note this is broken for the dependency check (ld barfs the error > message to stdout instead of the log file?) > checking whether cc accepts -M for generating dependencies... ld: > 0711-317 ERROR > : Undefined symbol: .main > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more > information. > noFixed, hopefully.> Note 2 that configure leaves a file called "-fp-no-toc" behind. Oops.???> 6) make && make check and everything looks ok.> --> Compile with gcc:> 1) 2) 3) 4) like above> Additionally edit *sock.c:> 5b) In appl/Rsock.c and appl/sock.c added `#include "Rconfig.h"' > (This doesn't hurt the cc compilation.)> 6b) CC=gcc ../configure> Surprises: this finds libcurses and libz. I don't know where, > though. So I manually remove -lreadline -lz -lcurses from the LIBS > line in Makeconf. Note that I add my private readline with the help > of CPPFLAGS and LIBS in config.site (thanks, Kurt).:-)> 7b) edit Rconfig.h: > #ifdef __GNUC__ > typedef long blkcnt_t; > #endif> Yes, I NEED this for gcc 2.8.1. This is a gcc bug, because gcc > -I/usr/include will compile. What I've learned is that it is > essential to verify which include files the compiler finds, these are > not always the ones in /usr/include! Maybe configure can pick this > up?It does now.> This gets you to a point where things will compile. What remains is > the NaN and Inf problem. I've tried to disable the finite function by > overriding the configure result (a la finite=no). But then R core > dumps. And uh, those ugly tick marks...> I'm afraid this all doesn't make too much sense, it's a mess.> Lemme know, if there is something you want me to try.Work in progress ... -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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._