Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#15416 closed defect (fixed)

R 2.7 Port (gnu-r): Tk interface does not work

Reported by: mark.m.fredrickson@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: konis@…, simon@…
Port:

Description

The R 2.6.2 port worked with no special effort with the Tk interface. The 2.7 port does not work on my system.

> install.packages("xtable")
Warning in install.packages("xtable") :
  'lib = "/opt/local/lib/R/library"' is not writable
Would you like to create a personal library
'~/R/i386-apple-darwin9.2.2-library/2.6'
to install packages into?  (y/n) 
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... Error in fun(...) : couldn't connect to display "0.0"
Error: .onLoad failed in 'loadNamespace' for 'tcltk'

I have

tk @8.5.2 x11/tk tcl @8.5.2 lang/tcl

installed.

I have also tried the other drivers that my $ r --help lists with similar results.

On a similar note: why is --without-aqua a required option? What would it take to build a version that uses Quartz?

Thank, -Mark

Change History (5)

comment:1 Changed 16 years ago by jmroot (Joshua Root)

Cc: konis@… added
Milestone: Port Bugs

Cc maintainer.

comment:2 Changed 16 years ago by mark.m.fredrickson@…

It would seem this bug is documented (at least to some degree): http://www.nabble.com/tcltk-issue-remains-td16541839.html

I followed the solution mentioned there:

> Sys.setenv("DISPLAY"=":0")

Loading the Tcl/TK library then works. Knowing the problem was caused by an environment variable, I looked a little closer at what I had been doing before I launched R. I've been using R for less than a week and after launching X11, I think I had always loaded R using its complete path. However, by coincidence, after I upgraded I had been reading in my ~/.profile file to get my usual bash settings.

bash-3.2$ source ~/.profile
$ r

My .profile explicitly sets the DISPLAY=0.0. It seems OS X x11 needs DISPLAY=:0. Changing this in my .profile solves the problem.

So, in conclusion, this may not be a bug with the port per-se, but rather good old user error. I'll leave it to wiser heads to close the ticket or keep it open.

Cheers, -Mark

comment:3 Changed 16 years ago by konis@…

I'm afraid this one is user error. If you are using Leopard (10.5) then you are probably better off not setting DISPLAY and instead using default value. With this setup the OS will automatically start X11 if it is not running before trying to open any X11 devices.

comment:4 Changed 16 years ago by simon@…

Cc: simon@… added
Resolution: fixed
Status: newclosed

As everything works fine now, I'm closing the ticket. If you have any problems just reopen the ticket/add a new comment.

Simon

comment:5 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.