When compiling R 1.9.1 on a Linux system with the environment variable LANG=3Dno_NO, I get a similar error as reported in PR#6958: ## FACTS: $ locale LANG=3Dno_NO LC_CTYPE=3D"no_NO" LC_NUMERIC=3D"no_NO" LC_TIME=3D"no_NO" LC_COLLATE=3D"no_NO" LC_MONETARY=3D"no_NO" LC_MESSAGES=3D"no_NO" LC_PAPER=3D"no_NO" LC_NAME=3D"no_NO" LC_ADDRESS=3D"no_NO" LC_TELEPHONE=3D"no_NO" LC_MEASUREMENT=3D"no_NO" LC_IDENTIFICATION=3D"no_NO" LC_ALL=3D $ cd /usr/src/R/R-1.9.1 $ ./configure [...] $ make [...] make[3]: Entering directory `/usr/src/R/R-1.9.1/src/library/stats4' building package 'stats4' mkdir -p -- ../../../library/stats4/R mkdir -p -- ../../../library/stats4/man make[4]: Entering directory `/usr/src/R/R-1.9.1/src/library/stats4' dumping R code in package 'stats4' Error in eval(expr, envir, enclos) : couldn't find function "setGeneric" Execution halted If unset LANG before running make, the error doesn't appear, and the build passes make check. I've tried this on a Debian 3.0 stable system and a Red Hat 9 system, with identical results. ## HYPOTHESIS:>From Professor Ripley's answer to the original PR#6958, I would guessthe problem is that LC_COLLATE (in effect) is no_NO. This matters for the line cat `ls $(srcdir)/R/*.R` >> $${f}; \ in ${R_HOME}/src/library/stats4/Makefile. With LC_COLLATE=3Dno_NO, ls will list the files in the order BIC.R mle.R AAA.R, making the require(methods) in AAA.R come last instead of first in $${f}. (In Norwegian, Aa is an old (but still often used in names) way of writing the letter =C5, and lately, ls(1) has become "intelligent" enough to sort them together, at the end of the alphabet.) ## IDEA/SUGGESTION/RAMBLING: Instead of relying on getting LC_COLLATE correct all places where that is needed, perhaps one could use something like 111.R instead of AAA.R (what to use instead of zzz.R I don't know). Or perhaps use a mechanism not based on sorting to ensure a file is read first or last? --=20 Bj=F8rn-Helge Mevik
b-h@mevik.net writes:> With LC_COLLATE=3Dno_NO, ls will list the files in the order BIC.R > mle.R AAA.R, making the require(methods) in AAA.R come last instead > of first in $${f}. (In Norwegian, Aa is an old (but still often used in > names) way of writing the letter =C5, and lately, ls(1) has become > "intelligent" enough to sort them together, at the end of the > alphabet.)Oh great... Same thing in da_DK actually, and for the same reason (witness my surname).> ## IDEA/SUGGESTION/RAMBLING: > > Instead of relying on getting LC_COLLATE correct all places where that > is needed, perhaps one could use something like 111.R instead of AAA.R > (what to use instead of zzz.R I don't know). Or perhaps use a > mechanism not based on sorting to ensure a file is read first or last?The cynic will say that some locale will probably have the idea of sorting numerals after letters. Anyways, the right way of fixing it is to prefix all those ls-constructs with LC_COLLATE=C, which really isn't harder to enforce than any naming convention. BTW, we just had two weeks of alpha and beta releases in which to find this sort of stuff, you know.... BTW2, what happened to your mail? Been a while since I saw quoted-unreadable damage like that. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
On 24 Jun 2004, Peter Dalgaard wrote:> b-h@mevik.net writes: > > > With LC_COLLATE=3Dno_NO, ls will list the files in the order BIC.R > > mle.R AAA.R, making the require(methods) in AAA.R come last instead > > of first in $${f}. (In Norwegian, Aa is an old (but still often used in > > names) way of writing the letter =C5, and lately, ls(1) has become > > "intelligent" enough to sort them together, at the end of the > > alphabet.) > > Oh great... Same thing in da_DK actually, and for the same reason > (witness my surname). > > > ## IDEA/SUGGESTION/RAMBLING: > > > > Instead of relying on getting LC_COLLATE correct all places where that > > is needed, perhaps one could use something like 111.R instead of AAA.R > > (what to use instead of zzz.R I don't know). Or perhaps use a > > mechanism not based on sorting to ensure a file is read first or last? > > The cynic will say that some locale will probably have the idea of > sorting numerals after letters. Anyways, the right way of fixing it is > to prefix all those ls-constructs with LC_COLLATE=C, which really > isn't harder to enforce than any naming convention.Right, but hard to find. This works on Windows: unfortunately Unix has a separate Makefile for every standard package and they are not even in the same style so my pattern-matching failed. It seems I missed just one (some others are in stub packages which only have one file).> BTW, we just had two weeks of alpha and beta releases in which to > find this sort of stuff, you know....Ye...s! -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:> > BTW, we just had two weeks of alpha and beta releases in which to > > find this sort of stuff, you know.... > > Ye...s![I even might have found it myself, but I set LANG=C, LC_CTYPE=da_DK in my shells because I otherwise go nuts from the semi-translated system messages ("hiding the randomness frog", etc..)] -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907