[OpenJPEG] CONFIGURE does not work

324 views
Skip to first unread message

szuk...@arcor.de

unread,
Aug 13, 2011, 2:41:37 AM8/13/11
to open...@googlegroups.com
For Issue 79, I tried to compile OpenJPEG-1.5.0-revision-863.

I used MinGW on WindowsXP.

No pkg-config is installed for/by MinGW.

C:/usr/lib contains the libs for PNG,TIFF,LCMS2,ZLIB.
C:/usr/include contains the headers for these libs.

The following file has been used to activate 'configure'.
-------------- start --------------
flags=CPPFLAGS='-IC:/usr/include' LDFLAGS='-LC:/usr/lib' PNG_CFLAGS='-IC:/usr/include' PNG_LIBS='-LC:/usr/lib' TIFF_CFLAGS='-IC:/usr/include' TIFF_LIBS='-LC:/usr/lib' LCMS2_CFLAGS='-IC:/usr/include' LCMS2_LIBS='-LC:/usr/lib'

do_configure:
$(flags) \
./configure \
--prefix=C:/usr \
--enable-jpwl \
--enable-mj2 \
--enable-lcms2 \
--disable-dependency-tracking
-------------- end --------------

STDOUT output of 'configure':

-------------- start --------------
checking whether to build with PNG support... yes
checking for PNG... yes
checking whether PNG is available... yes
checking whether to build with TIFF support... yes
checking tiff.h usability... no
checking tiff.h presence... yes
checking for tiff.h... no
checking for tiff.h... (cached) no
checking for tiff.h... (cached) no
checking whether TIFF is available... no
checking whether to build with LCMS-2 support... yes
checking for LCMS2... yes
checking whether LCMS-2 is available... yes

---------------------------------------------------
openjpeg 1.4.99
---------------------------------------------------


Configuration Options Summary:

Debug...............: no

Optional support:
libpng............: yes
libtiff...........: no
libcms............: lcms version 2.x

Documentation.......: yes
Build.............: make doc

mj2.................: yes
jpwl................: yes
jpip................: no
-------------- end --------------

STDERR output of 'configure':

-------------- start --------------

./configure: line 12905: --atleast-pkgconfig-version: command not found
configure: WARNING: tiff.h: present but cannot be compiled
configure: WARNING: tiff.h: check for missing prerequisite headers?
configure: WARNING: tiff.h: see the Autoconf documentation
configure: WARNING: tiff.h: section "Present But Cannot Be Compiled"
configure: WARNING: tiff.h: proceeding with the compiler's result
configure: WARNING: ## ---------------------------------------- ##
configure: WARNING: ## Report this to open...@googlegroups.com ##
configure: WARNING: ## ---------------------------------------- ##
configure: WARNING: Can not find a usuable TIFF library. Make sure that CPPFLAGS and LDFLAGS are correctly set.

-------------- end --------------

STDERR output of compilation:

-------------- start --------------
j2k_to_image-color.o: In function `color_apply_icc_profile':
C:\MinGW\msys\1.0\home\User\OpenJPEG-1.5.0-revision-863\applications\codec/../common/color.c:290:
undefined reference to `cmsOpenProfileFromMem'
(...)
j2k_to_image-convert.o: In function `pngtoimage':
C:\MinGW\msys\1.0\home\User\OpenJPEG-1.5.0-revision-863\applications\codec/convert.c:3062:
undefined reference to `png_destroy_read_struct'
(...)
-------------- end --------------

LCMS2 uses CONFIGURE on MinGW to find TIFF libs and headers:
no problems.

winfried

Configure.opj.gz
compiler.txt.gz
configure1.txt.gz
configure2.txt.gz

Vincent Torri

unread,
Aug 13, 2011, 2:49:32 AM8/13/11
to open...@googlegroups.com
On Sat, Aug 13, 2011 at 8:41 AM, <szuk...@arcor.de> wrote:
For Issue 79, I tried to compile OpenJPEG-1.5.0-revision-863.

I used MinGW on WindowsXP.

I guess you're using MSYS, right ? Or are you using another terminal emulator ?
 

No pkg-config is installed for/by MinGW.

C:/usr/lib     contains the libs for PNG,TIFF,LCMS2,ZLIB.
C:/usr/include contains the headers for these libs.

give the list of files in c:/usr/include.

Vincent

 

--
You are subscribed to the mailing-list of the OpenJPEG project (www.openjpeg.org)
To post: email to open...@googlegroups.com
To unsubscribe: email to openjpeg+u...@googlegroups.com
For more options: visit http://groups.google.com/group/openjpeg
For more info about OpenJPEG main partners : visit  www.tele.ucl.ac.be (UCL) and www.intopix.com

szuk...@arcor.de

unread,
Aug 13, 2011, 3:10:04 AM8/13/11
to open...@googlegroups.com
On Sat, 13 Aug 2011 08:49:32 +0200, Vincent Torri wrote:

>give the list of files in c:/usr/include

Here they are.
winfried
-------------------------------------
C:/usr/lib
1214592 2010-12-10 16:09 libjpeg.a
1097289 2010-12-10 16:09 libjpeg.dll
109560 2010-12-10 16:09 libjpeg.dll.a
1000804 2011-08-13 07:32 liblcms2.a
872736 2010-12-10 17:51 liblcms2.dll
235330 2011-08-13 07:31 liblcms2.dll.a
931 2011-08-13 07:31 liblcms2.la
276338 2011-08-13 07:20 libpng.a
354287 2010-12-10 16:42 libpng.dll
124040 2011-08-13 07:20 libpng.dll.a
276338 2010-12-10 16:42 libpng14.a
300148 2011-08-13 07:20 libpng14.dll
124040 2010-12-10 16:42 libpng14.dll.a
1404180 2011-08-13 06:57 libtiff.a
1245763 2010-12-12 04:54 libtiff.dll
154512 2011-08-13 06:57 libtiff.dll.a
919 2011-08-13 06:57 libtiff.la
88530 2011-08-13 07:02 libz.a
103424 2010-12-10 15:58 libz.dll
40166 2010-12-11 02:11 libz.dll.a
40166 2011-08-13 07:02 libzdll.a

C:/usr/include
1616 2010-12-10 16:09 jconfig.h
14581 2010-12-10 16:09 jerror.h
12714 2010-12-10 16:09 jmorecfg.h
48475 2010-12-10 16:09 jpeglib.h
91214 2011-08-13 07:32 lcms2.h
24622 2011-08-13 07:32 lcms2_plugin.h
117599 2011-08-13 07:25 png.h
46355 2011-08-13 07:17 pngconf.h
33815 2011-08-13 06:57 tiff.h
3442 2011-08-13 06:57 tiffconf.h
22674 2011-08-13 06:57 tiffio.h
415 2011-08-13 06:57 tiffvers.h
13375 2010-04-18 19:58 zconf.h
79564 2010-04-20 06:12 zlib.h

Vincent Torri

unread,
Aug 13, 2011, 4:03:12 AM8/13/11
to open...@googlegroups.com

ok, attach the file config.log

Vincent

Vincent Torri

unread,
Aug 13, 2011, 9:32:18 AM8/13/11
to open...@googlegroups.com
On Sat, Aug 13, 2011 at 8:41 AM, <szuk...@arcor.de> wrote:
For Issue 79, I tried to compile OpenJPEG-1.5.0-revision-863.

I used MinGW on WindowsXP.

No pkg-config is installed for/by MinGW.

C:/usr/lib     contains the libs for PNG,TIFF,LCMS2,ZLIB.
C:/usr/include contains the headers for these libs.

The following file has been used to activate 'configure'.
-------------- start --------------
flags=CPPFLAGS='-IC:/usr/include' LDFLAGS='-LC:/usr/lib' PNG_CFLAGS='-IC:/usr/include' PNG_LIBS='-LC:/usr/lib' TIFF_CFLAGS='-IC:/usr/include' TIFF_LIBS='-LC:/usr/lib' LCMS2_CFLAGS='-IC:/usr/include' LCMS2_LIBS='-LC:/usr/lib'

Btw, just setting ***_LIBS with -L/some/path is insufficient. You have to also pass the -l option.

The problem is that -lthelibmane is not sufficient

For example, for png, with the last version, it's -lpng15, with libpng 1.4.*, it's -lpng14, etc.... Also, the name can completely change one version to another one, and from one OS to another one (example: lua).

That's why, if there are .pc files, one really should use them.

I've attached a patch that fixes some problems, in addition to a factorisation of the m4 macro. There is some kind of "autodetection" of the -l option to pass to gcc, but it could not work. Please test it. With your installation above:

PNG_CFLAGS='-IC:/usr/include' PNG_LIBS='-LC:/usr/lib -lpng15' TIFF_CFLAGS='-IC:/usr/include' TIFF_LIBS='-LC:/usr/lib -ltiff' LCMS2_CFLAGS='-IC:/usr/
include' LCMS2_LIBS='-LC:/usr/lib -llcms2' ./configure

(not sure for -llcms2, i don't have it on my system right now)

regards

Vincent
opj_conf_jpip_4.diff

Bob Friesenhahn

unread,
Aug 13, 2011, 10:27:17 AM8/13/11
to open...@googlegroups.com
On Sat, 13 Aug 2011, Vincent Torri wrote:
>
> Btw, just setting ***_LIBS with -L/some/path is insufficient. You have to also pass the -l option.
>
> The problem is that -lthelibmane is not sufficient
>
> For example, for png, with the last version, it's -lpng15, with libpng 1.4.*, it's -lpng14, etc.... Also, the name can completely
> change one version to another one, and from one OS to another one (example: lua).

Development GraphicsMagick (in Mercurial) has updates (by Glenn
Randers-Pehrson) in configure.ac so that configure knows about the
libpng major library version numbering and it finds a coherent set of
headers and library which works (starting with the most recent major
release). My own system is a good test case because before these
fixes, the libpng headers and library used were from different release
versions and so the software failed during execution. Feel free to
take a look at what Glenn did and borrow as required.

Note that all of the libraries using libpng need to be using the same
libpng major version so that linking the various libpng-dependent
libraries into another library or application will still work
properly.

Bob
--
Bob Friesenhahn
bfri...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/

Vincent Torri

unread,
Aug 13, 2011, 11:39:26 AM8/13/11
to open...@googlegroups.com
On Sat, Aug 13, 2011 at 4:27 PM, Bob Friesenhahn <bfri...@simple.dallas.tx.us> wrote:
On Sat, 13 Aug 2011, Vincent Torri wrote:

Btw, just setting ***_LIBS with -L/some/path is insufficient. You have to also pass the -l option.

The problem is that -lthelibmane is not sufficient

For example, for png, with the last version, it's -lpng15, with libpng 1.4.*, it's -lpng14, etc.... Also, the name can completely
change one version to another one, and from one OS to another one (example: lua).

Development GraphicsMagick (in Mercurial) has updates (by Glenn Randers-Pehrson) in configure.ac so that configure knows about the libpng major library version numbering and it finds a coherent set of headers and library which works (starting with the most recent major release).  My own system is a good test case because before these fixes, the libpng headers and library used were from different release versions and so the software failed during execution.  Feel free to take a look at what Glenn did and borrow as required.

For me, the best way to detect libpng availability on a sane system is still the .pc files. Of course, it requires a sane system, but 99% of the users have a distro with well written packages.

I've just had a quick look at the way libpng is detected in GraphicsMagick. You run AC_CHECK_LIB successively on libpng15, libpng14, etc... Also it is possible to have such tests in openjpeg, i think that .pc files are still a lot easier to use and must be used if available.

Note that all of the libraries using libpng need to be using the same libpng major version so that linking the various libpng-dependent libraries into another library or application will still work properly.

Hmmm, libpng is used only for binaries, and not libraries. See:

http://code.google.com/p/openjpeg/wiki/FolderReorgProposal#Executables

so I think that there will be no problem wrt linking.

Btw, you're talking about major version of libpng. Isn't it 'always 1' ?

Vincent

Bob Friesenhahn

unread,
Aug 13, 2011, 12:55:24 PM8/13/11
to open...@googlegroups.com
On Sat, 13 Aug 2011, Vincent Torri wrote:
>
> For me, the best way to detect libpng availability on a sane system is still the .pc files. Of course, it requires a sane system, but
> 99% of the users have a distro with well written packages.

For my "insane" system, I intentionally installed a recent libpng
(from source) and intentionally installed the most current libpng 1.2
version after that. I did that so software which is not prepared for
newer libpng would still compile by default. I am not sure if .pc
files would handle that well. There are quite a few directories
containing .pc files on my system.

> Hmmm, libpng is used only for binaries, and not libraries. See:

Good.

> Btw, you're talking about major version of libpng. Isn't it 'always 1' ?

I guess that depends on what you consider a major version. To me,
1.2, 1.4, and 1.5 are different major versions since they are not API
compatible. It seems doubtful that there will ever be a libpng 2.0.

szuk...@arcor.de

unread,
Aug 13, 2011, 2:11:15 PM8/13/11
to open...@googlegroups.com
On Sat, 13 Aug 2011 10:03:12 +0200, Vincent Torri wrote:

>ok, attach the file config.log

In the meantime I tried to configure and compile the
openjpeg_v1_4_sources_r697 archive on MinGW.

I created an 'm4' directory, added the resp. statements
in 'configure.ac' and 'Makefile.am'.

All headers and libs were found. After removing the
'mj2' from the SUBDIR list: compilation was successful.

Using 'j2k_to_image': success.

winfried

config.log.gz

szuk...@arcor.de

unread,
Aug 13, 2011, 3:31:52 PM8/13/11
to open...@googlegroups.com
On Sat, 13 Aug 2011 15:32:18 +0200, Vincent Torri wrote:
>I've attached a patch that fixes some problems

I have applied your patch.

First I used the previous style:

PNG_LIBS='-LC:/usr/lib'
TIFF_LIBS='-LC:/usr/lib'
LCMS2_LIBS='-LC:/usr/lib'

and got:

libpng............: yes
libtiff...........: yes
libcms............: lcms version 2.x

But the compilation failed as before, now additionally with

undefined reference to `TIFFOpen'

etc.

Then I used:

PNG_LIBS='-LC:/usr/lib -lpng14'
TIFF_LIBS='-LC:/usr/lib -ltiff'
LCMS2_LIBS='-LC:/usr/lib -llcms2'

and got:

libpng............: yes
libtiff...........: yes
libcms............: lcms version 2.x

Now the compilation succeeded.

winfried

Vincent Torri

unread,
Aug 14, 2011, 3:02:59 AM8/14/11
to open...@googlegroups.com
On Sat, Aug 13, 2011 at 9:31 PM, <szuk...@arcor.de> wrote:
On Sat, 13 Aug 2011 15:32:18 +0200, Vincent Torri wrote:
>I've attached a patch that fixes some problems

I have applied your patch.

First I used the previous style:

PNG_LIBS='-LC:/usr/lib'
TIFF_LIBS='-LC:/usr/lib'
LCMS2_LIBS='-LC:/usr/lib'

and got:

   libpng............: yes
   libtiff...........: yes
   libcms............: lcms version 2.x

But the compilation failed as before, now additionally with

  undefined reference to `TIFFOpen'

etc.

Then I used:

PNG_LIBS='-LC:/usr/lib -lpng14'
TIFF_LIBS='-LC:/usr/lib -ltiff'
LCMS2_LIBS='-LC:/usr/lib -llcms2'

yep. If you set **_LIBS, you must pass the lib name (through -l option) and must say where the lib is with -L option. Both are needed.

Vincent
 
Reply all
Reply to author
Forward
0 new messages