1

I'm trying to run a racket "universe" program on an x virtual frame buffer and I keep getting this error:

ffi-lib: couldn't open "libfontconfig.so.1" (libfontconfig.so.1: cannot open shared object file: No such file or directory)
  context...:
   /usr/share/racket/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt: [running body]
   /usr/share/racket/pkgs/draw-lib/racket/draw/unsafe/cairo.rkt: [traversing imports]
   /usr/share/racket/pkgs/draw-lib/racket/draw/unsafe/pango.rkt: [traversing imports]
   /usr/share/racket/pkgs/draw-lib/racket/draw/private/font.rkt: [traversing imports]
   /usr/share/racket/pkgs/draw-lib/racket/draw/private/contract.rkt: [traversing imports]
   /usr/share/racket/pkgs/draw-lib/racket/draw.rkt: [traversing imports]

The command I'm running is xvfb-run racket myprogram.rkt

Any idea why this might be happening?

Leif Andersen
  • 21,580
  • 20
  • 67
  • 100
rmacnz
  • 61
  • 2

1 Answers1

0

The problem here is that you don't have libfontconfig installed, and Racket relies on it to run gui programs.1

The Linux version of Racket relies on a bunch of libraries if you want to use graphics in Racket, but are not necessarily if don't plan on having any gui component of your program. If you are running desktop linux you almost certainly already have the libraries installed, but if you are on a server it's probably much less likely.

Probably the easiest way to install all of the libraries you need is to just install the Gnome Desktop. The way you do this will differ depending on your distro, but for ubuntu it would be:

sudo apt-get install ubuntu-gnome-desktop

And for CentOS it would be:

yum -y groups install "GNOME Desktop" 

(You could alternatively install all of the libraries one at a time if you don't want to install a full desktop environment.)

1I presume your program uses graphic libraries. given that you are running your program in Xvfb.

Leif Andersen
  • 21,580
  • 20
  • 67
  • 100