I tried to compile R (current R-patched to be more precise) with gcc
3.5 by Apple (which will be probably shipped with Tiger) and here's how
far I got:
1) compilation itself was fine except for one exception:
../../../../../../R-patched/src/library/stats/src/starma.c: In function
`forkal':
../../../../../../R-patched/src/library/stats/src/starma.c:384: error:
invalid lvalue in assignment
relevant code:
for (j = 0; j < nt; j++)
if(!ISNAN(tmp = G->resid[j])) { nu++; sigma2 += tmp * tmp; }
problem: ISNAN changed obviously as the pre-processing result shows:
if(!(( ( sizeof ( tmp = G->resid[j] ) == sizeof(double) ) ? __isnand (
(double)tmp = G->resid[j] ) : ( sizeof ( tmp = G->resid[j] ) == sizeof(
float) ) ? __isnanf ( (float)tmp = G->resid[j] ) : __isnan ( ( long
double )tmp = G->resid[j] ) )!=0)) { nu++; sigma2 += tmp * tmp; }
fix: get the assignment out of ISNAN:
for (j = 0; j < nt; j++) {
tmp = G->resid[j];
if(!ISNAN(tmp)) { nu++; sigma2 += tmp * tmp; }
}
2) DYLD_LIBRARY_PATH shouldn't be too eagerly changed - R segfaulted
with the default setting. Unfortunately it segfaulted in a weird place
(in code responsible for loading a shared library somewhere in non-R
code). Removing all unnecessary stuff (such as /usr/local) from the
path helped (i.e. the path is now just ${R_HOME}/bin).
3) problem with saved images. I can't quite figure out this one:
basically R isn't able to load images stored during the package
installation phase. I get this error:
Error: bad restore file magic number (file may be corrupted)-- no data
loaded
for example with stats:
> library(stats)
Error: bad restore file magic number (file may be corrupted)-- no data
loaded
Error in library(stats) : package/namespace load failed
same if you try to load .../stats/R/all.rda manually.
I put the rda file in http://www.rosuda.org/misc/all.rda (it comes from
the stats package) for anyone who can have a look at it...
using save/load manually on arbitrary objects worked for me, however I
don't know how to re-create the all.rda manually, so I'm stuck here.
Any ideas?
Cheers,
Simon
I tried R-devel (07/31/04) with
setenv CC gcc-3.5
setenv F77 gfortran
setenv CXX g++-3.5
Here gfortran is g-95, version 3.5, from Gaurav's site.
Configure goes fine, build goes fine, except for problems with
macro-expansion
in plot.c, similar to the one you mention in starma.c. After clobbering
those, the
compile is allright, the base package builds fine, and the binary runs.
There
is a problem with loading packages, however (see below).
=================================================================
[cabledoc70:Developer/R/R-devel] deleeuw% bin/R
Error in lazyLoadDBfetch(key, datafile, compressed, envhook) :
internal error in decompress1
R : Copyright 2004, The R Foundation for Statistical Computing
Version 2.0.0 Under development (unstable) (2004-07-30), ISBN
3-900051-00-3
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for a HTML browser interface to help.
Type 'q()' to quit R.
> library()
Error in lazyLoadDBfetch(key, datafile, compressed, envhook) :
internal error in decompress1
=================================================================
With R-patched (07/31/04) there are no problems with plot.c, but there
is the
problem with starma.c (I guess a cpp-3.5 bug). Even when fixing starma.c
the package stats still refuses to build because of
=================================================================
gfortran -fno-common -g -O2 -c ppr.f -o ppr.o
/var/tmp//ccSqEJAf.s:8241:FATAL:Symbol __BLOCK_DATA____ already defined.
make[5]: *** [ppr.o] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all] Error 1
make[2]: *** [R] Error 1
make[1]: *** [R] Error 1
make: *** [R] Error 1
and the "bad restore file magic number" errors are there as well.
=================================================================
[