rookonheroku icon indicating copy to clipboard operation
rookonheroku copied to clipboard

X11 needed

Open jridgway opened this issue 13 years ago • 18 comments

I'm unable to generate graphics, because X11 isn't available on Heroku. Have you run into this problem? I get "Error in png(file=t) : X11 is not available" with the following code:

t <- tempfile()
png(file=t)
png(t,type="cairo",width=200,height=200)

jridgway avatar Nov 15 '11 19:11 jridgway

I actually haven't tried to do any graphing with it, but let me try some things out.

noahhl avatar Nov 15 '11 19:11 noahhl

PDF work fine, but no luck for PNG and SVG. I'm not sure about others.

jridgway avatar Nov 15 '11 19:11 jridgway

Don't call png twice. Just once like so:

pnt(file=t,type='cairo',...)

jeffreyhorner avatar Nov 15 '11 20:11 jeffreyhorner

Well I still get the same error but with the second call only:

Error in png(t, type = "cairo", width = 200, height = 200) : X11 is not available

jridgway avatar Nov 15 '11 20:11 jridgway

What does the output of capabilities() say?

On Tue, Nov 15, 2011 at 2:14 PM, Joseph Ridgway [email protected] wrote:

Well I still get the same error but with the second call only:

Error in png(t, type = "cairo", width = 200, height = 200) : X11 is not available


Reply to this email directly or view it on GitHub: https://github.com/noahhl/rookonheroku/issues/1#issuecomment-2750528

jeffreyhorner avatar Nov 15 '11 20:11 jeffreyhorner

capabilities() jpeg png tiff tcltk X11 aqua http/ftp sockets FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE libxml fifo cledit iconv NLS profmem cairo TRUE TRUE TRUE TRUE TRUE FALSE FALSE

jridgway avatar Nov 15 '11 20:11 jridgway

Is that too hard to read? :) Looks like all graphics are false.

jridgway avatar Nov 15 '11 20:11 jridgway

There you go: no png, no cairo capabilities() so you won't be able to create graphics.

On Tue, Nov 15, 2011 at 2:18 PM, Joseph Ridgway [email protected] wrote:

capabilities()    jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets   FALSE    FALSE    FALSE    FALSE    FALSE    FALSE     TRUE     TRUE  libxml     fifo   cledit    iconv      NLS  profmem    cairo    TRUE     TRUE     TRUE     TRUE     TRUE    FALSE    FALSE


Reply to this email directly or view it on GitHub: https://github.com/noahhl/rookonheroku/issues/1#issuecomment-2750608

jeffreyhorner avatar Nov 15 '11 20:11 jeffreyhorner

Do you have any idea how I can install cairo, png etc?

jridgway avatar Nov 15 '11 20:11 jridgway

Oh, if you can install R from source, then you can install cairo and png. I'm not familiar with the Heroku platform, so you got me there. The configure flags for R are --with-cairo and --with-libpng.

On Tue, Nov 15, 2011 at 2:22 PM, Joseph Ridgway [email protected] wrote:

Do you have any idea how I can install cairo, png etc?


Reply to this email directly or view it on GitHub: https://github.com/noahhl/rookonheroku/issues/1#issuecomment-2750658

jeffreyhorner avatar Nov 15 '11 20:11 jeffreyhorner

Heroku already has libcairo installed, so it should just be a matter of the right config flags as Jeff said. You can look at https://github.com/noahhl/rookonheroku/blob/master/bin/installR.sh and try adjusting accordingly and building from a heroku run bash session. I'll try to get it to work later and update the build script accordingly.

noahhl avatar Nov 15 '11 20:11 noahhl

I figured that was the next step. Thanks!

jridgway avatar Nov 15 '11 20:11 jridgway

Thanks guys!

jridgway avatar Nov 15 '11 20:11 jridgway

I've finally recompiled with the --with-cairo and --with-libpng flags but capabilities() still returns false for cairo:

jpeg png tiff tcltk X11 aqua http/ftp sockets FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE libxml fifo cledit iconv NLS profmem cairo TRUE TRUE TRUE TRUE TRUE FALSE FALSE

Any idea what I should try next?

jridgway avatar Nov 15 '11 23:11 jridgway

Noah, what makes you think Heroku has Cairo installed already? All I can find is /usr/lib/libcairo.so.2 and /usr/lib/libcairo.so.2.10800.10. Also, while compiling R, I get:

checking whether pkg-config knows about cairo and pango... no checking whether pkg-config knows about cairo... no

jridgway avatar Nov 16 '11 15:11 jridgway

I got this working after a lot of trial and error - I installed cairo, which also entailed fontconfig and pixman. It was a while back, so I don't remember each and every step, but here are the rough steps I jotted down (run from Heroku):

export PKG_CONFIG_PATH=/app/bin/lib/pkgconfig export LDFLAGS=/app/bin/lib

fontconfig

curl fontconfig ./configure --prefix=/app/bin make make install

pixman

curl pixman ./configure --prefix=/app/bin make make install

cairo

curl cairo ./configure --prefix=/app/bin make make install

configure cairo

./configure --prefix=/app/bin make make install -i

fengtality avatar Aug 15 '12 19:08 fengtality

I'm looking to get PNG, Cairo etc. working on Heroku with R... trying to get my mind wrapped around custom buildpacks... so the installation of fontconfig, pixmand, cairo etc. you included as part of your vulcan build?

riebeekn avatar Mar 03 '13 16:03 riebeekn

I have the same problem, "so the installation of fontconfig, pixmand, cairo etc. you included as part of your vulcan build?" I don't understand how to do that.

metalaureate avatar Jul 25 '13 00:07 metalaureate