Bug 1516976 - dlib pkgconfig doesn't include -lopenblas that is often (always?) required
Summary: dlib pkgconfig doesn't include -lopenblas that is often (always?) required
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dlib
Version: 27
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Dmitry Mikhirev
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-23 18:18 UTC by Chris Lord
Modified: 2018-11-30 18:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 18:50:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Minimal test-acse (183 bytes, text/x-csrc)
2017-12-18 13:09 UTC, Chris Lord
no flags Details

Description Chris Lord 2017-11-23 18:18:30 UTC
Description of problem:

dlib depends on libopenblas at build time, but the pkgconfig file that gets installed with dlib-devel doesn't specify the library in the library flags. Linking an application against dlib and using the ldflags returned by pkgconfig will result in undefined references:

<removed>.cc.o: In function `dlib::lapack::binding::gesdd(char, int, int, double*, int, double*, double*, int, double*, int, double*, int, int*)':
/usr/include/dlib/matrix/lapack/gesdd.h:38: undefined reference to `dgesdd_'
<removed>.cc.o: In function `dlib::lapack::binding::gesvd(char, char, int, int, double*, int, double*, double*, int, double*, int, double*, int)':
/usr/include/dlib/matrix/lapack/gesvd.h:38: undefined reference to `dgesvd_'
<removed>.cc.o: In function `dlib::blas_bindings::cblas_axpy(int, float, float const*, int, float*, int)':
/usr/include/dlib/matrix/matrix_blas_bindings.h:146: undefined reference to `cblas_saxpy'
<removed>.cc.o: In function `dlib::blas_bindings::cblas_scal(int, float, float*)':
/usr/include/dlib/matrix/matrix_blas_bindings.h:175: undefined reference to `cblas_sscal'
<removed>.cc.o: In function `dlib::blas_bindings::cblas_gemm(dlib::blas_bindings::CBLAS_ORDER, dlib::blas_bindings::CBLAS_TRANSPOSE, dlib::blas_bindings::CBLAS_TRANSPOSE, int, int, int, double, double const*, int, double const*, int, double, double*, int)':
/usr/include/dlib/matrix/matrix_blas_bindings.h:216: undefined reference to `cblas_dgemm'

Version-Release number of selected component (if applicable): 19.4


How reproducible: Always


Steps to Reproduce:
1. Write an application that includes and uses dlib face detection
2. Build application using 'c++ app.cc -Wall -O0 -g3 `pkg-config --flags`'

Actual results:

The above mentioned undefined references.

Expected results:

Successful linking.

Additional information:

[cwiiis@cwiiis-razer lib64]$ readelf -a libdlib.so|grep -i needed
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libnsl.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libX11.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libpng16.so.16]
 0x0000000000000001 (NEEDED)             Shared library: [libjpeg.so.62]
 0x0000000000000001 (NEEDED)             Shared library: [libopenblas.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libsqlite3.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
[cwiiis@cwiiis-razer lib64]$ pkg-config --modversion dlib-1
19.4.0
[cwiiis@cwiiis-razer lib64]$ pkg-config --libs dlib-1
-L/usr/usr/lib64 -ldlib -lpng16 -lz

Comment 1 Dmitry Mikhirev 2017-11-26 17:15:09 UTC
Normally you don't need to explicitly specify all recursively required shared libraries. Can you provide a code example to reproduce this issue?

> 2. Build application using 'c++ app.cc -Wall -O0 -g3 `pkg-config --flags`'

pkg-config command has no option '--flags'.

Comment 2 Chris Lord 2017-12-18 13:09:10 UTC
Created attachment 1369486 [details]
Minimal test-acse

Comment 3 Chris Lord 2017-12-18 13:11:27 UTC
Sorry, hit return by accident and that submits the form...

Attachment #1369486 [details] is a minimal application that exposes the error in dlib's pkg-config. Build it with:

c++ dlib-pkgconfig-error.cc -Wall -O0 -g3 `pkg-config --cflags --libs dlib-1`

Error output:

/usr/bin/ld: /tmp/ccF9CxzX.o: undefined reference to symbol 'dgesvd_'
//usr/lib64/libopenblas.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Comment 4 Ben Cotton 2018-11-27 17:45:16 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2018-11-30 18:50:59 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.