[racket] copy-shared-files and different platforms

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Aug 25 12:07:36 EDT 2014

At Mon, 25 Aug 2014 17:52:03 +0200, Jens Axel Søgaard wrote:
> 2014-08-25 16:11 GMT+02:00 Matthew Flatt <mflatt at cs.utah.edu>:
> > At Mon, 25 Aug 2014 16:06:15 +0200, Jens Axel Søgaard wrote:
> >> 2014-08-23 20:12 GMT+02:00 Matthew Flatt <mflatt at cs.utah.edu>:
> 
> > package-source format:
> >
> >   git://github.com/soegaard/poppler-libs?path=poppler-i386-macosx
> 
> Thanks! Getting closer...
> 
> The libraries are now copied in to /Users/soegaard/Library/Racket/6.1/lib/
> 
> But for some reason ffi-lib can't find them?
> 
> The following is from newly installed Racket 6.1. downloaded
> from the racket-lang.org after installing the package poppler-i386-macosx
> via the package manager.
> 
> Running:
> 
>     #lang racket
>     (require ffi/unsafe setup/dirs)
>     (directory-list (find-user-lib-dir))
>     (ffi-lib "libpoppler-glib" '("8"))
> 
> The output:
> 
>     Welcome to DrRacket, version 6.1 [3m].
>     Language: racket [custom]; memory limit: 512 MB.
>     '(#<path:libpoppler-glib.8.dylib> #<path:libpoppler.44.dylib>
> #<path:libs.rktd>)
>     . ffi-lib: couldn't open "libpoppler-glib.8.dylib"
> (dlopen(libpoppler-glib.8.dylib, 6): image not found)
> 
> Am I missing something?

Does it work if you install the package in installation scope, instead
of user scope?

I think the problem is "@loader_path/libgio-2.0.0.dylib" and similar
references in the ".dylib" files. That is, the
"libpoppler-glib.8.dylib" library is found by `ffil-lib`, but the load
fails because libraries referenced by "libpoppler-glib.8.dylib" are not
found in the expected location.

The "@loader_path" references mean that the shared libraries as
currently compiled work only when installed in the same scope as the
`racket/draw` libraries. Offhand, I don't have a good idea for solving
this problem. (FWIW, Windows installations won't have this problem.)



Posted on the users mailing list.