From keith.ohara at nyu.edu  Wed May 18 19:35:35 2016
From: keith.ohara at nyu.edu (Keith O'Hara)
Date: Wed, 18 May 2016 13:35:35 -0400
Subject: [Rd] Latest R-devel build failing on OS X
In-Reply-To: <22332.40522.266571.404208@stat.math.ethz.ch>
References: <70CBF2CD-1B4C-48CA-AFFD-E3F1DDBDC073@nyu.edu>
	<1771C0EE-8B59-4921-B648-60DB197824C2@gmail.com>
	<22332.40522.266571.404208@stat.math.ethz.ch>
Message-ID: <0339D461-CBAF-4A3E-9FCE-F33D05EABB17@nyu.edu>

Thanks for the fix, Martin.

The build runs smoothly now, with just a warning remaining:

sys-std.c:1002:7: warning: implicit declaration of function 'rl_resize_terminal' is invalid in C99
      [-Wimplicit-function-declaration]
                    rl_resize_terminal();
                    ^
1 warning generated.

Best,
Keith

> On May 18, 2016, at 12:54 PM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
> 
> 
>> Yes, the nightly build is broken in a similar, but different way. See below.
>> Both seem to be readline related, so Frederick Eaton's patches, which Martin committed yesterday are the likely culprit. I had  actually tested them and things seemed to work, but it was on a different machine and not a completely clean build.
> 
> Indeed a problem.  I'm pretty sure that RL_UNSETSTATE() exists
> in newer versions of readline  but not in older ones (and hence is
> declared in newer versions of readline.h, but not in older
> ones).
> 
> It seems people still do have older versions of readline.h 
> ... and it may be interesting why some versions of OSX (Peter's)
> has a new readline and some (Keith') don't.
> 
> I'm committing an experimental fix using  #if ... s and the
> readline version number.
> It does keep fixing the bug on my platform (Fedora 22 Linux,
> readline 6.3)
> 
> and it may help in Keith' setup.  Please do check it, Keith.
> (svn rev >= 70631)
> 
> Martin 
> 
> 
> 
>> -pd
> 
>> .....
>> ranlib: file: libR.a(printf.o) has no symbols
>> gcc   -L/usr/X11R6/lib -o R.bin Rmain.o CommandLineArgs.o Rdynload.o Renviron.o RNG.o agrep.o apply.o arithmetic.o array.o attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cum.o dcf.o datetime.o debug.o deparse.o devices.o dotcode.o dounzip.o dstruct.o duplicate.o edit.o engine.o envir.o errors.o eval.o format.o gevents.o gram.o gram-ex.o graphics.o grep.o identical.o inlined.o inspect.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o names.o objects.o options.o paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o radixsort.o random.o raw.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o times.o unique.o util.o version.o g_alab_her.o g_cntrlify.o g_fontdb.o g_her_glyph.o xxxpr.o   `ls ../unix/*.o ../appl/*.o ../nmath/*.o` ../extra/
>> tre/libtre.a  ../extra/intl/libintl.a ../extra/tzone/libtz.a -L../../lib/x86_64 -lRblas -L/usr/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/usr/lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/lib -lgfortran    -Wl,-framework -Wl,CoreFoundation -lreadline  -lpcre -llzma -lbz2 -lz -licucore -lm -llzma -liconv
>> Undefined symbols for architecture x86_64:
>> "_rl_mark", referenced from:
>>     _popReadline in sys-std.o
>> "_rl_readline_state", referenced from:
>>     _popReadline in sys-std.o
>> "_rl_resize_terminal", referenced from:
>>     _Rstd_ReadConsole in sys-std.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>> make[3]: *** [R.bin] Error 1
> 
>> On 18 May 2016, at 14:18 , Keith O'Hara <keith.ohara at nyu.edu> wrote:
> 
>>> Dear R-devel,
>>> 
>>> The latest version of R-devel (05-17) is throwing an error for me when building on OS X (v 10.11.4):
>>> 
>>> making Rembedded.d from Rembedded.c
>>> making dynload.d from dynload.c
>>> making system.d from system.c
>>> making sys-unix.d from sys-unix.c
>>> making sys-std.d from sys-std.c
>>> making X11.d from X11.c
>>> clang -I. -I../../src/include -I../../src/include  -I/usr/local/include -DHAVE_CONFIG_H    -fPIC  -Wall -mtune=core2 -g -O2  -c Rembedded.c -o Rembedded.o
>>> clang -I. -I../../src/include -I../../src/include  -I/usr/local/include -DHAVE_CONFIG_H    -fPIC  -Wall -mtune=core2 -g -O2  -c dynload.c -o dynload.o
>>> clang -I. -I../../src/include -I../../src/include  -I/usr/local/include -DHAVE_CONFIG_H    -fPIC  -Wall -mtune=core2 -g -O2  -c system.c -o system.o
>>> clang -I. -I../../src/include -I../../src/include  -I/usr/local/include -DHAVE_CONFIG_H    -fPIC  -Wall -mtune=core2 -g -O2  -c sys-unix.c -o sys-unix.o
>>> clang -I. -I../../src/include -I../../src/include  -I/usr/local/include -DHAVE_CONFIG_H    -fPIC  -Wall -mtune=core2 -g -O2  -c sys-std.c -o sys-std.o
>>> sys-std.c:592:5: warning: implicit declaration of function 'RL_UNSETSTATE' is invalid in C99
>>>    [-Wimplicit-function-declaration]
>>>  RL_UNSETSTATE(RL_STATE_ISEARCH | RL_STATE_NSEARCH | RL_STATE_VIMOTION |
>>>  ^
>>> sys-std.c:592:19: error: use of undeclared identifier 'RL_STATE_ISEARCH'
>>>  RL_UNSETSTATE(RL_STATE_ISEARCH | RL_STATE_NSEARCH | RL_STATE_VIMOTION |
>>>                ^
>>> sys-std.c:592:38: error: use of undeclared identifier 'RL_STATE_NSEARCH'
>>>  RL_UNSETSTATE(RL_STATE_ISEARCH | RL_STATE_NSEARCH | RL_STATE_VIMOTION |
>>>                                   ^
>>> sys-std.c:592:57: error: use of undeclared identifier 'RL_STATE_VIMOTION'
>>>  RL_UNSETSTATE(RL_STATE_ISEARCH | RL_STATE_NSEARCH | RL_STATE_VIMOTION |
>>>                                                      ^
>>> sys-std.c:593:5: error: use of undeclared identifier 'RL_STATE_NUMERICARG'
>>>                RL_STATE_NUMERICARG | RL_STATE_MULTIKEY);
>>>                ^
>>> sys-std.c:593:27: error: use of undeclared identifier 'RL_STATE_MULTIKEY'
>>>                RL_STATE_NUMERICARG | RL_STATE_MULTIKEY);
>>>                                      ^
>>> sys-std.c:596:40: error: use of undeclared identifier 'rl_mark'
>>>  rl_line_buffer[rl_point = rl_end = rl_mark = 0] = 0;
>>>                                     ^
>>> sys-std.c:597:5: error: use of undeclared identifier 'rl_done'
>>>  rl_done = 1;
>>>  ^
>>> sys-std.c:998:7: warning: implicit declaration of function 'rl_resize_terminal' is invalid in C99
>>>    [-Wimplicit-function-declaration]
>>>                  rl_resize_terminal();
>>>                  ^
>>> 2 warnings and 7 errors generated.
>>> make[3]: *** [sys-std.o] Error 1
>>> make[2]: *** [R] Error 2
>>> make[1]: *** [R] Error 1
>>> make: *** [R] Error 1
>>> 
>>> 
>>> 
>>> 
>>> My configuration information:
>>> 
>>> R is now configured for x86_64-apple-darwin15.4.0
>>> 
>>> Source directory:          .
>>> Installation directory:    /Builds/R-devel
>>> 
>>> C compiler:                clang  -Wall -mtune=core2 -g -O2
>>> Fortran 77 compiler:       gfortran-4.8  -g -O2
>>> 
>>> C++ compiler:              clang++  -Wall -mtune=core2 -g -O2
>>> C++11 compiler:            clang++  -std=c++11 -Wall -mtune=core2 -g -O2
>>> Fortran 90/95 compiler:    gfortran-4.8 -Wall -g -O2
>>> Obj-C compiler:	     clang -Wall -mtune=core2 -g -O2 -fobjc-exceptions
>>> 
>>> Interfaces supported:      aqua, tcltk
>>> External libraries:        readline, BLAS(OpenBLAS), LAPACK(in blas), curl
>>> Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
>>> Options enabled:           shared R library, R profiling, memory profiling
>>> 
>>> Capabilities skipped:      
>>> Options not enabled:       shared BLAS
>>> 
>>> Recommended packages:      yes
>>> 
>>> 
>>> Apologies in advance if I have incorrectly formatted the issue or omitted something important.
>>> 
>>> Kind regards,
>>> Keith
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>> -- 
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501
>> Office: A 4.23
>> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] Latest R-devel build failing on OS X
Keith O'Hara