[R-SIG-Mac] compiling from source on ML, tcltk

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed Sep 5 01:46:13 CEST 2012


On Tue, Sep 4, 2012 at 11:05 AM, Simon Urbanek
<simon.urbanek at r-project.org> wrote:
>
> On Sep 4, 2012, at 8:47 AM, Kasper Daniel Hansen <kasperdanielhansen at gmail.com> wrote:
>
>> On Mon, Sep 3, 2012 at 2:22 AM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
>>> On 03/09/2012 01:11, Kasper Daniel Hansen wrote:
>>>>
>>>> On Sun, Sep 2, 2012 at 3:54 PM, Prof Brian Ripley <ripley at stats.ox.ac.uk>
>>>> wrote:
>>>>>
>>>>> Do you need R.app?  If not, I would recommend using ActiveTcl Tcl/Tk by
>>>>> e.g.
>>>>>
>>>>> ./configure ...
>>>>> --with-tcl-config=/Library/Frameworks/Tcl.framework/tclConfig.sh
>>>>> --with-tk-config=/Library/Frameworks/Tk.framework/tkConfig.sh
>>>>
>>>>
>>>> I don't have (Tcl|Tk).framework in /Library/Frameworks.  I seem to
>>>> recall they were there in earlier versions of the OS.
>>>
>>>
>>> On my system, that is where ActiveTcl installed.   Even when Apple shipped
>>> an Aqua Tcl/Tk, it was old and limited and ActiveTcl is quite way to get a
>>> pre-compiled current version.
>>>
>>>
>>>> I did some more investigation.  Following a suggestion on Stack overflow I
>>>> did
>>>>   sudo ln -s /opt/X11/include/X11 /usr/include
>>>> and that suddenly gave me tcltk capabilities.  To be honest, I don't
>>>> understand why. I use
>>>>   --X-Includes=/Usr/X11/Include --X-Libraries=/Usr/X11/Lib
>>>
>>>
>>> If you use /Usr then it may well not work.  These tools are case-sensitive
>>> ....
>>
>> Thanks, the lines I have in my email I wrong - I did some manual
>> editing as I was testing some stuff.
>>
>> So to be clear, I use
>>  --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib\
>> Without the symbolic link I get aqua, X11 support
>>
>> With the symbolic link I get aqua, X11, tcltk support
>>
>> Looking at config.log, it seems that all the test tcl and/or tk
>> programs complaining about missing X11/Xlib.h.  When I look at the gcc
>> command, I see stuff like
>>  /usr/bin/gcc-4.2 -arch x86_64 -std=gnu99 -E -I/usr/local/include
>> -I/usr/local/include conftest.c
>> Include directories depends on on which test we are talking about, but
>> never includes the directory I specified with --x-includes, which
>> seems wrong to me.
>>
>> This could explain why making the symlink (so we have X11/Xlib.h under
>> /usr/include) makes tcltk work.
>>
>
> That's the wrong location, certainly.
> However, could it be that your problem is a missing /usr/X11R6 symlink?

# ls -l /usr/
total 24
lrwxr-xr-x     1 root  wheel     8B Aug 28 16:57 X11 -> /opt/X11
lrwxr-xr-x     1 root  wheel     8B Aug 28 16:57 X11R6 -> /opt/X11
<SNIP> : the rest of the standard directories excluded.

And /opt/X11 seems to have the standard include, lib, bin. etc, ...  Also,

# find  /opt/X11 -name "Xlib.h"
/opt/X11/include/X11/Xlib.h

This is a (pretty) fresh upgrade from Lion to Mountain Lion.  I did
have various stuff installed in Lion of course.

Kasper


>
> Cheers,
> Simon
>
>
>>
>>>
>>>
>>>> in my configure script so I don't fully understand why the presence of
>>>> this symbolic link fixes it.  But it is an empirical fact it does....
>>>>
>>>> Kasper
>>>>
>>>>
>>>>
>>>>>
>>>>> I've been using it for some time, and it has much nicer ttk widgets.
>>>>>
>>>>>
>>>>>
>>>>> On 02/09/2012 19:21, Kasper Daniel Hansen wrote:
>>>>>>
>>>>>>
>>>>>> I now want to get tcltk support working under ML (because I need to
>>>>>> test a few packages).
>>>>>>
>>>>>> I have installed Xquartz and I have just install the new tcltk 8.5.5
>>>>>> from CRAN (which is not signed btw).
>>>>>>
>>>>>> Running configure, I get
>>>>>>
>>>>>> checking for tclConfig.sh... no
>>>>>> checking for tclConfig.sh in library (sub)directories...
>>>>>> /usr/local/lib/tclConfig.sh
>>>>>> checking for tkConfig.sh... no
>>>>>> checking for tkConfig.sh in library (sub)directories...
>>>>>> /usr/local/lib/tkConfig.sh
>>>>>> checking tcl.h usability... yes
>>>>>> checking tcl.h presence... yes
>>>>>> checking for tcl.h... yes
>>>>>> checking tk.h usability... no
>>>>>> checking tk.h presence... no
>>>>>> checking for tk.h... no
>>>>>> checking /usr/local/include/tk8.5/generic/tk.h usability... no
>>>>>> checking /usr/local/include/tk8.5/generic/tk.h presence... no
>>>>>> checking for /usr/local/include/tk8.5/generic/tk.h... no
>>>>>> checking /usr/local/include/tk8.5/tk.h usability... no
>>>>>> checking /usr/local/include/tk8.5/tk.h presence... no
>>>>>> checking for /usr/local/include/tk8.5/tk.h... no
>>>>>> checking /usr/local/include/tcl8.5/tk.h usability... no
>>>>>> checking /usr/local/include/tcl8.5/tk.h presence... no
>>>>>> checking for /usr/local/include/tcl8.5/tk.h... no
>>>>>> checking /usr/local/include/tk.h usability... no
>>>>>> checking /usr/local/include/tk.h presence... no
>>>>>> checking for /usr/local/include/tk.h... no
>>>>>> checking for tk.h... yes
>>>>>>
>>>>>> So it seems to find tcltk.  I get a few warnings when it checks for X11
>>>>>> headers:
>>>>>>
>>>>>> checking X11/Intrinsic.h presence... no
>>>>>> configure: WARNING: X11/Intrinsic.h: accepted by the compiler,
>>>>>> rejected by the preprocessor!
>>>>>> configure: WARNING: X11/Intrinsic.h: proceeding with the compiler's
>>>>>> result
>>>>>>
>>>>>> and
>>>>>>
>>>>>> checking X11/Xmu/Atoms.h presence... no
>>>>>> configure: WARNING: X11/Xmu/Atoms.h: accepted by the compiler,
>>>>>> rejected by the preprocessor!
>>>>>> configure: WARNING: X11/Xmu/Atoms.h: proceeding with the compiler's
>>>>>> result
>>>>>>
>>>>>> I assume these are unrelated.  Although configure seems to find tcltk,
>>>>>> at the end of configure, I get
>>>>>>
>>>>>> R is now configured for x86_64-apple-darwin12.1.0
>>>>>>
>>>>>>    Source directory:          ../R-2.15.x-src
>>>>>>    Installation directory:    /usr/local/R/R-2.15.x
>>>>>>
>>>>>>    C compiler:                /usr/bin/gcc-4.2 -arch x86_64 -std=gnu99
>>>>>> -g -O2 -std=gnu99 -march=nocona
>>>>>>    Fortran 77 compiler:       /usr/bin/gfortran-4.2 -arch x86_64  -g
>>>>>> -O2 -march=nocona
>>>>>>
>>>>>>    C++ compiler:              /usr/bin/g++-4.2 -arch x86_64  -g -O2
>>>>>> -march=nocona
>>>>>>    Fortran 90/95 compiler:    /usr/bin/gfortran-4.2 -arch x86_64 -g -O2
>>>>>> -march=nocona
>>>>>>    Obj-C compiler:            /usr/bin/gcc-4.2 -arch x86_64 -g -O2
>>>>>> -fobjc-exceptions
>>>>>>
>>>>>>    Interfaces supported:      X11, aqua
>>>>>>    External libraries:        readline, BLAS(vecLib), LAPACK(in blas),
>>>>>> ICU
>>>>>>    Additional capabilities:   PNG, JPEG, NLS
>>>>>>    Options enabled:           R profiling, memory profiling, Java
>>>>>>
>>>>>>    Recommended packages:      yes
>>>>>>
>>>>>> which does not mention tcltk support under 'Interfaces supported'.
>>>>>>
>>>>>> This used to work on Lion, and I am wondering what I am doing wrong.
>>>>>
>>>>>
>>>>>
>>>>> I think you should be wondering what Apple is doing wrong ....  But you
>>>>> need
>>>>> to look in config.log to find the root cause.
>>>>>
>>>>>>
>>>>>> My configure script is
>>>>>>
>>>>>> export LANG=en_US.UTF-8
>>>>>> ../${SRCDIR}/configure SHELL='/bin/bash' \
>>>>>>    --prefix=/usr/local/R/R-${R_VERSION} --disable-R-framework\
>>>>>>    CC="/usr/bin/gcc-4.2 -arch x86_64 -std=gnu99" \
>>>>>>    CFLAGS="-g -O2 -std=gnu99 -march=nocona" \
>>>>>>    CXX="/usr/bin/g++-4.2 -arch x86_64" \
>>>>>>    CXXFLAGS="-g -O2 -march=nocona" \
>>>>>>    OBJC="/usr/bin/gcc-4.2 -arch x86_64" \
>>>>>>    F77="/usr/bin/gfortran-4.2 -arch x86_64" \
>>>>>>    FFLAGS="-g -O2 -march=nocona" \
>>>>>>    FC="/usr/bin/gfortran-4.2 -arch x86_64" \
>>>>>>    FCFLAGS="-g -O2 -march=nocona" \
>>>>>>    --enable-memory-profiling\
>>>>>>    --X-Includes=/Usr/X11/Include --X-Libraries=/Usr/X11/Lib\
>>>>>>    --with-system-zlib\
>>>>>>    --with-blas='-framework vecLib' --with-lapack
>>>>>>
>>>>>> Thanks,
>>>>>> Kasper
>>>>>>
>>>>>> _______________________________________________
>>>>>> R-SIG-Mac mailing list
>>>>>> R-SIG-Mac at r-project.org
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Brian D. Ripley,                  ripley at 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
>>>
>>>
>>>
>>> --
>>> Brian D. Ripley,                  ripley at 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
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>>
>



More information about the R-SIG-Mac mailing list