cwatson / brainGraph

Graph theory analysis of brain MRI data
166 stars 48 forks source link

`cairoDevice` installation error on CentOS 7 #3

Closed seantma closed 6 years ago

seantma commented 6 years ago

@cwatson You mentioned brainGraph was mostly developed on CentOS 6/7. I'm having a hard time trying to get pass the cairoDevice installation in RStudio Server. I have installed GTK 2.24 along with cairo-devel and dependencies on my CentOS 7 but it's still giving me errors below. My Ubuntu 16 didn't have this issue. Any thoughts?

R session is headless; GTK+ not initialized. (R:25763): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() Error: package or namespace load failed for ‘cairoDevice’: .onLoad failed in loadNamespace() for 'cairoDevice', details: call: fun(libname, pkgname) error: GDK display not found - please make sure X11 is running Error: loading failed Execution halted

cwatson commented 6 years ago

@seantma Yes, I have been developing the package on CentOS 6 and (for the past ~1.5 years) on CentOS 7. I don't quite remember the exact yum packages I had to install, but you should make sure you have installed the following: (I write the command so you can copy and paste it)

yum install cairo{,-devel,-gobject{,-devel}} ghc-cairo{,-devel}

And also see if the GTK stuff is installed:

yum install gtk+{,-devel} gtk2{,-devel{,-docs},-engines{,-devel}}

I'm not sure if this could be an RStudio issue, as I have never used it on Linux (and very little on Windows).

Finally, I looked at my bash history and you can see if installing the following helps: yum install xorg-x11-server-devel libXt{,-devel} libXpm{,-devel} ghc-cairo-devel \ ncurses-static ghc-gtk-devel gtk+-devel atk-devel

Please let me know if all this works. This could be useful information to add to the User Guide.

seantma commented 6 years ago

@cwatson Thanks for the tips. I will give it a try and report back.

It looks like X11 display might also be an issue for running RGtk on Rstudio server which its interface is through a browser.

Note for self: inside Travis CI (https://travis-ci.org/cwatson/brainGraph) there is a section exporting DISPLAY and starting xfvb. Might be worth checking.

cwatson commented 6 years ago

@seantma Ah, I wasn't aware that RStudio Server was browser-based.

I am not sure if this would be possible unless you can do X11 forwarding; this old StackOverflow answer states that it isn't possible.

There is also this answer (the first comment) on the RStudio support page which suggests changing the DISPLAY variable, so you can try that first.

There is also the rmote package which could help (but looks like it deals with different issues than this specific one).

However, unfortunately this simply will not be possible; see this forum post (unless they have worked on this issue since 2014).

But as I search more for answers, this post might have some useful information.

I think the absolute simplest solution would be to allow brainGraph installation of everything minus the GUI stuff, but I'm not sure how one could do that.

cwatson commented 6 years ago

I'm closing this because the updates in #5 allow installation on headless servers.