libomp5 packaging problem: *.so are in -dev package

Bug #1804762 reported by Dmitriy Geels
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openmprtl (Ubuntu)
New
Undecided
Unassigned

Bug Description

Recently I built a library with Intel MKL as a dependency (libmkl-dev package). Trying to run an application threw me an error message: "undefined symbol: omp_get_num_procs". The problem turned up to be old and known (https://software.intel.com/en-us/forums/intel-system-studio/topic/611682) -- missing libiomp5.so.

Examining dependencies of libmkl-dev leads to chain: libmkl-dev -> libmkl-rt -> libomp5 which must contain libiomp5.so. The last one depends only on libc6.

But package libomp5 only contains documentation, not the library:
$ apt-file show libomp5
libomp5: /usr/lib/x86_64-linux-gnu/libomp.so.5
libomp5: /usr/share/doc/libomp5/changelog.Debian.gz
libomp5: /usr/share/doc/libomp5/copyright
libomp5: /usr/share/lintian/overrides/libomp5

All libraries are packed into libomp-dev:
$ apt-file show libomp-dev
libomp-dev: /usr/include/omp.h
libomp-dev: /usr/include/ompt.h
libomp-dev: /usr/lib/x86_64-linux-gnu/libgomp.so
libomp-dev: /usr/lib/x86_64-linux-gnu/libiomp5.so
libomp-dev: /usr/lib/x86_64-linux-gnu/libomp.so
libomp-dev: /usr/lib/x86_64-linux-gnu/libomptarget.so
libomp-dev: /usr/share/doc/libomp-dev/changelog.Debian.gz
libomp-dev: /usr/share/doc/libomp-dev/copyright

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: libomp5 6.0.1-1build1
Uname: Linux 4.18.19-041819-generic x86_64
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Nov 23 13:04:04 2018
Dependencies:
 gcc-8-base 8.2.0-7ubuntu1
 libc6 2.28-0ubuntu1
 libgcc1 1:8.2.0-7ubuntu1
 libidn2-0 2.0.5-1
 libunistring2 0.9.10-1ubuntu1
InstallationDate: Installed on 2018-03-27 (240 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180327)
SourcePackage: openmprtl
UpgradeStatus: Upgraded to cosmic on 2018-10-19 (34 days ago)

Revision history for this message
Dmitriy Geels (dmig) wrote :
Revision history for this message
Juhani Numminen (jsonic) wrote :

Hi,

please provide some information about your library and application. What is the linker command to produce the application? What is the full output of your failing application? What does ldd tell about your executable?

Revision history for this message
Dmitriy Geels (dmig) wrote :

Hi!

This doesn't really matter.
I'm building dlib (http://dlib.net/) with Intel MKL libraries. One of them loads libiomp5.so dynamically and that causes "undefined symbol" error. Real reason or error -- wrong packaging.

Revision history for this message
Juhani Numminen (jsonic) wrote :

Hi!

I'm asking for the details because I think they do matter. It could be that the problem is resolved by changing your link flags.

Libomp's packaging looks to be arranged in the correct way. The -dev package contains files ending in .so. Those are symbolic links to a file ending in .so.5 that is contained in the libomp5 package. Usually a compiled program only requires the .so.5 file to be present. This is how it's described in Debian policy: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html

My perception is that when I link a program with -liomp5, I get this dependency: "libomp.so.5 => /usr/lib/x86_64-linux-gnu/libomp.so.5 (0x00007f78ae8b2000)".

Because *.so in -dev package is usually the correct thing to do in Ubuntu, I believe your conclusion that the packaging is wrong, might not be true.

Regards,
Juhani

Revision history for this message
Dmitriy Geels (dmig) wrote :

Ok, I got it.

In my case error was thrown by libmkl_intel_thread.so, it dlopen() libiomp5.so. This thread describes the reason:
https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/402497

So I chose the wrong package, must be libmkl-rt.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.