Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#5473 closed defect (wontfix)

Can't build 3.0.1 (32bit on 64bit): configure links against openjpeg2 even if 32bit library not installed

Reported by: Oxalin Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Using ArchLinux? 64.

Building ffmpeg from lib32-ffmpeg package (available under AUR) fails with:
libavcodec/libavcodec.so: undefined reference to `opj_stream_default_create'
libavcodec/libavcodec.so: undefined reference to `opj_destroy_codec'
libavcodec/libavcodec.so: undefined reference to `opj_read_header'
libavcodec/libavcodec.so: undefined reference to `opj_end_compress'
libavcodec/libavcodec.so: undefined reference to `opj_stream_destroy'
libavcodec/libavcodec.so: undefined reference to `opj_stream_set_skip_function'
libavcodec/libavcodec.so: undefined reference to `opj_stream_set_read_function'
libavcodec/libavcodec.so: undefined reference to `opj_set_error_handler'
libavcodec/libavcodec.so: undefined reference to `opj_stream_set_write_function'
libavcodec/libavcodec.so: undefined reference to `opj_set_warning_handler'
libavcodec/libavcodec.so: undefined reference to `opj_stream_set_user_data'
libavcodec/libavcodec.so: undefined reference to `opj_start_compress'
libavcodec/libavcodec.so: undefined reference to `opj_stream_set_user_data_length'
libavcodec/libavcodec.so: undefined reference to `opj_set_info_handler'
libavcodec/libavcodec.so: undefined reference to `opj_stream_set_seek_function'
collect2: error: ld returned 1 exit status
Makefile:128: recipe for target 'ffserver_g' failed
make: * [ffserver_g] Error 1
[...]

Building against lib32-openjpeg 1.5.2. All the undefined references seem related OpenJPEG 2.0.X (functions undefined under 1.5.2 but introduced under 2.X)

Manually launched ./configure (with options), then "make" and it failed the same way. Here is the option list:

./configure \

--prefix='/usr' \
--libdir=/usr/lib32 \
--shlibdir=/usr/lib32 \
--cc="gcc -m32" \
--disable-debug \
--disable-static \
--disable-stripping \
--enable-avisynth \
--enable-avresample \
--enable-fontconfig \
--enable-gnutls \
--enable-gpl \
--enable-ladspa \
--enable-libass \
--enable-libbluray \
--enable-libfreetype \
--enable-libfribidi \
--enable-libgsm \
--enable-libiec61883 \
--enable-libmodplug \
--enable-libmp3lame \
--enable-libopencore_amrnb \
--enable-libopencore_amrwb \
--disable-libopenjpeg \
--enable-libopus \
--enable-libpulse \
--enable-libschroedinger \
--enable-libspeex \
--enable-libtheora \
--enable-libv4l2 \
--enable-libvorbis \
--enable-libvpx \
--enable-libwebp \
--enable-libx264 \
--enable-libxvid \
--enable-shared \
--enable-version3 \
--enable-x11grab

Now, disabling libopenjpeg fix the error and the build finishes correctly (obviously).

Change History (5)

comment:1 in reply to: ↑ description ; follow-up: Changed 2 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

Replying to Oxalin:

Building against lib32-openjpeg 1.5.2. All the undefined references seem related OpenJPEG 2.0.X (functions undefined under 1.5.2 but introduced under 2.X)

This indicates that the versions of your instealled header and your installed library are different, I just tested compilation with openjpeg 1.5.2 and it works fine here.

If you believe there is a bug that can be fixed in FFmpeg, please test current FFmpeg git head with a minimal configure line, run make several times and provide the complete, uncut console output of an additional make V=1 ffmpeg run.
You can get installation support on the user mailing list.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 2 years ago by Oxalin

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Summary changed from Can't build 3.0.1: libavcodec.so: undefined reference to `opj_stream_default_create' to Can't build 3.0.1 (32bit on 64bit): configure links against openjpeg2 even if 32bit library not installed

Replying to cehoyos:

Replying to Oxalin:

Building against lib32-openjpeg 1.5.2. All the undefined references seem related OpenJPEG 2.0.X (functions undefined under 1.5.2 but introduced under 2.X)

This indicates that the versions of your instealled header and your installed library are different, I just tested compilation with openjpeg 1.5.2 and it works fine here.

If you believe there is a bug that can be fixed in FFmpeg, please test current FFmpeg git head with a minimal configure line, run make several times and provide the complete, uncut console output of an additional make V=1 ffmpeg run.
You can get installation support on the user mailing list.

The ticket may have been closed a bit early. The problem seems to be related on how the library is being detected. I have the following installed:
openjpeg2 library (64 bit + headers)
openjpeg 1.5 (64 bit + headers)
openjpeg 1.5 (32 bit + headers provided by the 64 bit package)

The configuration should be able to detect that the openjpeg2 library (32 bit) is not available, even if the headers are available from the 64 bit version (and then move to testing version 1.5). 64 bit packages are always required by the 32 bit packages because of it is the 64 bit package that contains the header files. They are installed under /usr/include.

By the way, I use the following (as does the PKGBUILD) before calling "configure".
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

comment:3 follow-up: Changed 2 years ago by cehoyos

  • Resolution set to wontfix
  • Status changed from reopened to closed

I oppose supporting your installation: Remove one of the headers so that exactly one is installed.

Last edited 2 years ago by cehoyos (previous) (diff)

comment:4 in reply to: ↑ 3 Changed 2 years ago by Oxalin

Replying to cehoyos:

I oppose supporting your installation: Remove one of the headers so that exactly one is installed.

Impossible, openjpeg 1.5 is a depency for some packages, while openjpeg 2 is a depency to others. Since the headers are included in each packages, I have no control over the thing (I could manually delete a file). I'm sure there is a different way of selecting the right library only if it is actually installed. I'll dig a bit more on the thing.

comment:5 in reply to: ↑ 2 Changed 2 years ago by Cigaes

Replying to Oxalin:

By the way, I use the following (as does the PKGBUILD) before calling "configure".
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"


PKG_CONFIG_PATH is for adding directories to the search path. You need to override the search path. See the documentation.

Note: See TracTickets for help on using tickets.