miriam_e: from my drawing MoonGirl (Default)
miriam_e ([personal profile] miriam_e) wrote2012-06-09 07:52 am

Linux is getting messy

Being an artist I always have lots of graphics programs and am always experimenting with and compiling more. Recently I started having a very annoying problem with ImageMagick (a wonderful program, by the way, which completely deserves the "Magick" in its name).

I compiled the latest version of ImageMagick and found that if I tried to do operations on jpeg images it would refuse, giving this error:
Wrong JPEG library version: library is 62, caller expects 80
The weird thing is, I never explicitly installed any "version 80" of the jpeg libs. Okay, it must have been pulled in by some other program as a dependency.

When I went looking I found two lots of jpeg libraries: version 62 in /usr/lib and version 8 (not 80) in /usr/local/lib. Okay that was annoying. I tried all kinds of trickery to let me keep both sets of libs in the machine to allow whatever had required the later version to continue functioning, but it seems I had to have just one or the other.

Now, I could have removed the older libs but I didn't want to spend the next couple of days re-compiling all my other programs for it. The libs appear to be incompatible. Programs compiled for the earlier one choke on the newer lib. Whats with that?!

So I removed the later, incompatible one and re-installed the headers for the older version, then tried recompiling.

I got the same error! Huh?

I looked in ImageMagick's source and it is non-specific, requiring only that the libs be a later version than 60. So how was my compile getting screwed?

Then it hit me. There are 2 include dirs: /usr/include and /usr/local/include and when I looked inside the second, sure enough, there was a second set of jpeg libs waiting, guerilla-style to jump out and trick my compile.

So, I deleted those and tried again. Now after compiling when I ran make check I found that 2 tests that previously failed (tests/validate-formats-in-memory.sh and tests/validate-formats-on-disk.sh) now passed. Okay, that was encouraging.

Finally it works! Yay!

Now I just have to wait for the bomb to drop when the other pre-compiled program that had pulled the newer lib in fails.

This was the kinda boring crap I do way too often, so why did I bore you by sharing it? Because I did what everybody does when faced with a problem like this: I searched for solutions on the net first.

There were oodles of people with this problem, but only a couple of vague, unsatisfactory answers that went any way toward being useful. And none really commented on the fact that this has grown out of the fact that the Linux filesystem is becoming quite messy, with oodles of bin directories and library directories, at least two include directories, and so on. One of the things I loved about the Amiga was the way the filing system was so damn neat and clean. Much as I dislike MSWindows, I have to admit their filing system is well organised.