Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11 needed #1

Open
jridgway opened this issue Nov 15, 2011 · 18 comments
Open

X11 needed #1

jridgway opened this issue Nov 15, 2011 · 18 comments

Comments

@jridgway
Copy link

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)
@noahhl
Copy link
Owner

noahhl commented Nov 15, 2011

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

@jridgway
Copy link
Author

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

@jeffreyhorner
Copy link

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

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

@jridgway
Copy link
Author

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

@jeffreyhorner
Copy link

What does the output of capabilities() say?

On Tue, Nov 15, 2011 at 2:14 PM, Joseph Ridgway
reply@reply.github.com
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:
#1 (comment)

@jridgway
Copy link
Author

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
Copy link
Author

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

@jeffreyhorner
Copy link

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
reply@reply.github.com
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:
#1 (comment)

@jridgway
Copy link
Author

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

@jeffreyhorner
Copy link

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
reply@reply.github.com
wrote:

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


Reply to this email directly or view it on GitHub:
#1 (comment)

@noahhl
Copy link
Owner

noahhl commented Nov 15, 2011

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.

@jridgway
Copy link
Author

I figured that was the next step. Thanks!

@jridgway
Copy link
Author

Thanks guys!

@jridgway
Copy link
Author

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
Copy link
Author

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

@fengtality
Copy link

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

@riebeekn
Copy link

riebeekn commented Mar 3, 2013

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?

@metalaureate
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants