samth
2017-12-28 16:04:15

@mflatt I assume you noticed the current DrDr failure — is there a change that would make it stop failing to run all the other tests?


mflatt
2017-12-28 16:27:53

No, I forgot to check after recent changes. I’ll fix the compiler warnings(?) when I can this afternoon


elias.schulze
2017-12-28 16:46:48

@elias.schulze has joined the channel


lexi.lambda
2017-12-28 18:12:43

@mflatt I’m having a weird issue in which Racket installed on Ubuntu can’t load a .so put in its lib directory via ffi-lib, complaining it doesn’t even exist: root@d82c5e3ffd27:/# ls /racket/lib/libMagick* /racket/lib/libMagickCore-7.Q16HDRI.so /racket/lib/libMagickWand-7.Q16HDRI.so root@d82c5e3ffd27:/# racket -e '(require ffi/unsafe) (ffi-lib "libMagickWand-7.Q16HDRI")' ffi-lib: couldn't open "libMagickWand-7.Q16HDRI.so" (libMagickWand-7.Q16HDRI.so: cannot open shared object file: No such file or directory) However, if I set LD_LIBRARY_PATH to /racket/lib, then ffi-lib loads it correctly, so somehow the OS can find it, but Racket can’t. Do you know how I could debug this?


mflatt
2017-12-28 19:08:20

It sounds like that shared object depends on others that are on only found if you set LD_LIBRARY_PATH


mflatt
2017-12-28 19:09:17

Wand needs Core?


lexi.lambda
2017-12-28 19:10:41

That seems likely, yes. What is the proper way to express that dependency to Racket?


mflatt
2017-12-28 19:10:47

I forget how it goes on Linux, but does loading Core first help?


lexi.lambda
2017-12-28 19:10:56

Hmm, let me see.


lexi.lambda
2017-12-28 19:14:14

@mflatt Annoyingly, Core depends on symbols in Wand, so loading it first produces an undefined symbol error. However, that still only happens with LD_LIBRARY_PATH set… doing it without it set still fails with libMagickCore-7.Q16HDRI.so: cannot open shared object file: No such file or directory.


mflatt
2017-12-28 19:22:15

What does ldd say for the two ".so"s?


lexi.lambda
2017-12-28 19:24:50

mflatt
2017-12-28 19:35:34

The ldd output makes sense, but the undefined symbol error doesn’t make sense to me. So, I don’t understand why libMagickCore doesn’t load, either.


lexi.lambda
2017-12-28 19:41:07

Well, to be clear, I get the undefined symbol error if I do this: ~ $ LD_LIBRARY_PATH=/app/racket/lib racket -e '(require ffi/unsafe) (ffi-lib "libMagickCore-7.Q16HDRI")' ffi-lib: couldn't open "libMagickCore-7.Q16HDRI.so" (/app/racket/lib/libMagickCore-7.Q16HDRI.so: undefined symbol: DrawPathStart) since apparently libMagickCore uses symbols from libMagickWand for whatever reason.


lexi.lambda
2017-12-28 19:41:54

That makes sense to me. What I don’t understand is why omitting LD_LIBRARY_PATH causes that to fail with a different error, namely No such file or directory.


mflatt
2017-12-28 19:42:54

Oh, maybe the issue is the dependencies on other libraries (like freetype) that have different builds in “lib”


mflatt
2017-12-28 19:45:19

Or does Core use dlopen to implement mutual dependencies?


mflatt
2017-12-28 19:45:52

(But I don’t see how that would fail at load time.)


lexi.lambda
2017-12-28 19:46:43

Right… both those things don’t seem to reflect the error message I’m seeing, which is ffi-lib: couldn't open "libMagickCore-7.Q16HDRI.so" (libMagickCore-7.Q16HDRI.so: cannot open shared object file: No such file or directory)


lexi.lambda
2017-12-28 19:47:15

…which seems to indicate to me that for some reason Racket can’t find the .so at all. But I don’t know how that could be possible.


mflatt
2017-12-28 19:52:33

I suppose I’m not going to be able to guess the problem at this point. I can tell you that the recipe for success has been to (1) make sure all the relevant libraries are built together (really: make sure the load-time library is compatible with the build-time one); (2) adjust the dependencies to have no path, so that the right library really will be used at load time; and (3) load libraries that are dependencies before the libraries that depend on them. As far as I know, shared libraries cannot have direct mutual dependencies, so that’s why step 3 has seemed well-defined.


lexi.lambda
2017-12-28 19:54:51

Alright, I’ll keep fiddling with knobs. ImageMagick is very complicated… and I’m still not sure I’m configuring it properly when I build it.


lexi.lambda
2017-12-28 21:00:19

@mflatt FWIW, I managed to get ImageMagick to build in such a way that libMagickCore stopped referencing symbols in libMagickWand, and that plus your suggestion of explicitly loading Core before Wand seems to have solved the problem. Thanks!


lexi.lambda
2017-12-28 21:01:23

The error message when I load Wand without first loading Core is still perplexing… but I am willing to be happy with this now that it works. :)