1

I am attempting to install GraphicsMagick in a hosting account...

I used this info to get it to work in most cases:

How do you specify the location of libraries to a binary? (linux)

However, it still cannot find the delegates.mgk (which is in ./lib/GraphicsMagick-1.3.14/delegates.mgk) as witnessed in this error:

gm-bin convert: Unable to access configuration file (delegates.mgk) [No such file or directory].

Either, a) how do find out where the binary thinks this file should be, or b) how do I extend the wrapper script to help it out?

1 Answer 1

3

Figured it out after looking through the binary for /PATH/

The binaries require these additional path variables:

$MAGICK_CONFIG_PATH
$MAGICK_CODER_MODULE_PATH
$MAGICK_FILTER_MODULE_PATH

...here is the resulting script modification form my setup:

#!/bin/sh
if [ -n "$LD_LIBRARY_PATH" ]; then
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/USER/lib
else
  LD_LIBRARY_PATH=/home/USER/lib
fi
[ -z "${MAGICK_CONFIGURE_PATH}" ] && export MAGICK_CONFIGURE_PATH=/home/USER/lib/GraphicsMagick-1.3.14/config
[ -z "${MAGICK_CODER_MODULE_PATH}" ] && export MAGICK_CODER_MODULE_PATH=/home/USER/lib/GraphicsMagick-1.3.14/modules-Q8/coders
[ -z "${MAGICK_FILTER_MODULE_PATH}" ] && export MAGICK_FILTER_MODULE_PATH=/home/USER/lib/GraphicsMagick-1.3.14/modules-Q8/filters
export LD_LIBRARY_PATH
exec /home/USER/bin/gm-bin "$@"
1
  • It seems in version 1.3.16, the variable is called MAGICK_CONFIGURE_PATH, notice CONFIG vs CONFIGURE. I installed GraphicsMagick with Nix package manager and it fails to start. Just defining this env var as you pointed made it work. I used the following: [[ $(command -v gm) =~ ".nix" ]] && export MAGICK_CONFIGURE_PATH="$(dirname $(command -v gm))/../lib/GraphicsMagick-$(gm -version | head -n1 | cut -d ' ' -f2)/config". DISCLAIMER: It work but I didn't heavy tested it. Nov 23, 2021 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .