Compiling IM from source for HDRI

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
toasty
Posts: 16
Joined: 2012-12-06T17:56:02-07:00
Authentication code: 6789

Compiling IM from source for HDRI

Post by toasty »

I've compiled IM from source on LinuxMint 14.0 as I want to include the HDRI (for the fft).

I'm following the instructions from
http://magick.imagemagick.org/script/in ... e.php#unix and
http://magick.imagemagick.org/script/ad ... lation.php

IM is already installed on my system (w/o HDRI), and it does not seem to follow the "standard" installation in /usr/local/bin and /usr/local/lib mentioned in the above-documentation. I want to install a new HDRI-capable version, replacing the existing version.

I ran

Code: Select all

$ configure --enable-hdri
$ make
and that seemed to work. I can run the utilities/convert --version and it confirms with HDRI
Then

Code: Select all

$ sudo make install
after this, I got the following error:

Code: Select all

$ convert --version
convert: error while loading shared libraries: libMagickCore-Q16HDRI.so.7: cannot open shared object file: No such file or directory
I was able to fix this by executing:

Code: Select all

$ sudo /sbin/ldconfig /usr/local/lib
Now convert --version reports:

Code: Select all

$ convert --version
Version: ImageMagick 6.8.1-8 2013-01-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: HDRI OpenMP
Delegates: bzlib djvu mpeg fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr lzma openexr png ps tiff x xml zlib
However when I try to convert a jpg I get:

Code: Select all

$ convert 015817.jpg 015817.png
convert: Empty input file `015817.jpg' @ error/jpeg.c/JPEGErrorHandler/318.
convert: no images defined `015817.png' @ error/convert.c/ConvertImageCommand/3066.
015817.jpg does exist and it's not empty. Does anyone know why it can't seem to read jpeg files?
Hope the following information is helpful to identify the problem:

Code: Select all

$ convert -list configure

Path: /usr/local/lib/ImageMagick-6.8.1//config-Q16HDRI/configure.xml

Name           Value
-------------------------------------------------------------------------------
CC             gcc -std=gnu99 -std=gnu99
CFLAGS         -pthread -I/usr/include/OpenEXR -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -fopenmp -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH     /usr/local/lib/ImageMagick-6.8.1/modules-Q16HDRI/coders
CONFIGURE      ./configure  '--enable-hdri'
CONFIGURE_PATH /usr/local/etc/ImageMagick/
COPYRIGHT      Copyright (C) 1999-2013 ImageMagick Studio LLC
CPPFLAGS       -I/usr/local/include/ImageMagick
CXX            g++
CXXFLAGS       -g -O2 -pthread
DEFS           -DHAVE_CONFIG_H
DELEGATES      bzlib djvu mpeg fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr lzma openexr png ps tiff x xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-gvc=no --with-rsvg=no --with-wmf=no --with-perl=no
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-6.8.1
EXEC-PREFIX    /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES       HDRI OpenMP
FILTER_PATH    /usr/local/lib/ImageMagick-6.8.1/modules-Q16HDRI/filters
HOST           i686-pc-linux-gnu
INCLUDE_PATH   /usr/local/include/ImageMagick
LDFLAGS        -L/usr/local/lib -L/usr/lib
LIB_VERSION    0x681
LIB_VERSION_NUMBER 6,8,1,8
LIBRARY_PATH   /usr/local/lib/ImageMagick-6.8.1
LIBS           -lMagickCore -ljbig -llcms -ltiff -lfreetype -ljasper -ljpeg -llqr-1 -lglib-2.0 -lpng12 -ldjvulibre -lfftw3 -lfontconfig -lXext -lXt -lSM -lICE -lX11 -llzma -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lxml2 -lz -lm -lgomp -lpthread
NAME           ImageMagick
PCFLAGS        -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
PREFIX         /usr/local
QuantumDepth   16
RELEASE_DATE   2013-01-03
SHARE_PATH     /usr/local/share/ImageMagick-6.8.1
SHAREARCH_PATH /usr/local/lib/ImageMagick-6.8.1/config-Q16HDRI
SVN_REVISION   10495
TARGET_CPU     i686
TARGET_OS      linux-gnu
TARGET_VENDOR  pc
VERSION        6.8.1
WEBSITE        http://www.imagemagick.org

Path: [built-in]

Name           Value
-------------------------------------------------------------------------------
FEATURES       OpenMP 
NAME           ImageMagick
QuantumDepth   16
Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling IM from source for HDRI

Post by magick »

Its likely you have a mix of HDRI and non-HDRI modules in your build. Try a 'make clean' first and rebuild and reinstall. Does that fix the problem?
toasty
Posts: 16
Joined: 2012-12-06T17:56:02-07:00
Authentication code: 6789

Re: Compiling IM from source for HDRI

Post by toasty »

Thanks for the advise, but after

Code: Select all

$ sudo make clean
$ ./configure --enable-hdri
$ make
$ sudo make install
$ convert 015817.jpg 015817.png
still produces the same error as above.

Incidentally, if I run

Code: Select all

$ convert --version
in the same window that I did the configure, make and make install, for some reason it finds and runs the original non-HDRI IM. But if I run it in another window (where I was able to run HDRI version previously), it finds and runs the newly installed HDRI version.
toasty
Posts: 16
Joined: 2012-12-06T17:56:02-07:00
Authentication code: 6789

Re: Compiling IM from source for HDRI

Post by toasty »

BTW, the convert command in the utilities sub directory is producing the same error. I recently upgraded to LM 14, in my previous version (LM 12) it was working when I ran it from the utilities directory.

Anyone have some suggestion on what to try next?

Thanks
toasty
Posts: 16
Joined: 2012-12-06T17:56:02-07:00
Authentication code: 6789

Re: Compiling IM from source for HDRI

Post by toasty »

The new HDRI convert program is able to pass some of the basic tests, such as convert logo: logo.jpg. It even can convert logo.jpg to logo.png, so it doesn't seem to be a problem with convert exactly.

However, for some reason, it is not able to convert my particular image although I'm able to view it. The image I'm trying to convert is here:

Image

With the convert command that was already installed on my computer, it works, but when I build IM version 6.8.1, I get the error above.
toasty
Posts: 16
Joined: 2012-12-06T17:56:02-07:00
Authentication code: 6789

Re: Compiling IM from source for HDRI

Post by toasty »

I had an "old" version of IM on my HDD that I saved before reinstalling the OS. It was 6.8.0 (not really that old).

I went back to that directory, re-compiled and installed (I had to do ldconfig /usr/local/lib again) and this version seems to work now.

I'm not sure what is exactly the problem, but I'm going to keep using version 6.8.0 now.
Post Reply