简体   繁体   中英

How do I configure/make/install against an older version of a library?

I'm trying to install a piece of software ( moddims ) that depends on "Imagemagick 6.3.9+" - I tried installing the latest version of ImageMagick (6.5.4-5) but got the following error when I tried to "make" moddims:

mod_dims_ops.c: In function ‘dims_smart_crop_operation’:
mod_dims_ops.c:34: error: too few arguments to function ‘ParseGravityGeometry’

Presumably the function signature changed somewhere between ImageMagick 6.3.9 and the current version.

I'd like to try installing moddims against the older version of ImageMagick - but I want to install ImageMagick 6.3.9 without interfering with the already-installed 6.5.4-5 version.

What ./configure incantations can I use to a) install the older version of ImageMagick in such a way that it won't over-write or otherwise interfere with my modern version and b) compile moddims to use that older version?

I'm on OSX, but I anticipate having the same problem for when I later need to install moddims on a Linux production server.

Clearly, you have to obtain, compile and install the older version of ImageMagick.

Faced with this problem - especially since it is at an experimental phase (you don't know for sure you want to keep this version of ImageMagick around) - I would:

  • Create a new directory to install ImageMagick:

     /opt/ImageMagick 
  • Configure ImageMagick 6.3.9 to install in there - probably:

     ./configure --prefix=/opt/ImageMagick 
  • Build, test, and install it.

  • Configure moddims to look in the ImageMagick location before standard places:

     export LDFLAGS=-L/opt/ImageMagick/lib export CPPFLAGS=-I/opt/ImageMagick/include ./configure .... 
  • Check that the produced moddims code uses your preferred libraries:

     otool -L ...moddims-progam-or-library... # MacOS X ldd ...moddims-program-or-library... # Linux, etc. 

The first check will be "does moddims compile when configured"; if it doesn't, you are probably using the 'standard' version of the moddims header file despite this attempt to avoid doing so.

There might also be configure options to specify where the ImageMagick library should be pulled from - check with ' ./configure --help ' (and/or ' grep -i image configure ').

Since ImageMagick uses pkg-config. All you need to do is adjust your PKG_CONFIG_PATH to reference the old version. (This assumes that your package invokes PKG_CHECK_MODULES to configure itself for ImageMagick. If your package does not do that, you should modify it so that it does.)

Basically, you want to grab the old ImageMagick and install it somewhere (eg ./configure --prefix=$HOME/obsolete && make install), then go to your package and configure with the argument PKG_CONFIG_PATH=$HOME/obsolete/lib/pkgconfig. Unfortunately, ImageMagick will install files outside of your specified prefix (eg in /Library/perl ), so this is not guaranteed to not modify your current library. (IMO, this is an ImageMagick packaging bug.)

Check the pkg-config documentation for details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM