Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6956 Discussions

"dlopen" warning when using "-static"

may_ka
Beginner
5,779 Views

Hi there,

with the makefile

FC =ifort -mkl -warn nounused -warn declarations -static -O3 -parallel
SRC :=
OwnFlag = $(LibPath)$(Own)OwnLib_ifort.a
LibPath = ~/.local/lib/Fortran/
Own = OwnFunctions/
MKLPATH=$(MKLROOT)/lib/intel64/
MKLINCLUDE=$(MKLPATH)/include/

MKL= -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a $(MKLPATH)/libmkl_intel_thread.a $(MKLPATH)/libmkl_core.a -Wl,--end-group -liomp5 -lpthread

.SUFFIXES: 
.SUFFIXES: .f90 .f .for

include ../Moduls/Moduls.mk
include Main.mk

OBJS = $(subst .f90,.o,$(SRC))

%.o: %.f90
	$(FC) -c -o $@ $< -I $(LibPath)$(Own)

aPROGRAM: $(OBJS)
	$(FC) -o $@ $^ $(OwnFlag) $(MKL)


clean:
	$(MAKE) -C ../Moduls
	rm *.mod
	rm *.o
tags:
	etags Main.f90 ../Moduls/*.f90

 

I am getting the error message:

 

opt/intel/composer_xe_2013_sp1.3.174/mkl/lib/intel64//libmkl_core.a(mkl_aa_fw_load_orsl_lite_lib.o): In function `mkl_aa_fw_load_orsl_lite_lib':
../../../../serv/offload/framework/core/mkl_aa_fw_load_orsl_lite_lib.c:(.text+0xbe): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

I want to have a fully statically linked application, and it occurs to me that this is not the case.

Am I right, and if yes, any suggestions to solve that???

I am using ifort 14.0.3.

Thanks you very much.

Cheers

 

0 Kudos
6 Replies
TimP
Honored Contributor III
5,779 Views

All you could do in addition is to assure that you have installed all possible relevant static libraries for your OS.  If you have available libiomp5.a, you would include it specifically, or, if avoiding shared library is more important than -parallel, you would remove that option.and use mkl sequential.

0 Kudos
Steven_L_Intel1
Employee
5,779 Views

MKL uses dlopen to dynamically load different code depending on the environment. ld is noticing this and giving you the warning since if there are different glibc versions floating around in an application there may be issues.

I am going to move this thread to the MKL forum where they may have other comments, but I will say that in general full static linking is becoming increasingly unattainable.

0 Kudos
TimP
Honored Contributor III
5,779 Views
Mkl link advisor gives sample build commands for static linkable mkl libraries.
0 Kudos
Laszlo_Ladanyi
Beginner
5,779 Views

Steve Lionel (Intel) wrote:

MKL uses dlopen to dynamically load different code depending on the environment. ld is noticing this and giving you the warning since if there are different glibc versions floating around in an application there may be issues.

I am going to move this thread to the MKL forum where they may have other comments, but I will say that in general full static linking is becoming increasingly unattainable.

I'm in the same shoe as the original poster: I need to create a fully static executable. While I realize that fully static linking is becoming harder, it is in general not impossible. But if I want to use MKL then it seems it is :-(.

I have looked at the content of the static mkl libs with nm, and all functions for all hardware are there (libmkl_core.a is >400MB). What is the need for dlopen in this case?

Thanks,

--Laci

0 Kudos
Marius_D_
Beginner
5,779 Views

I used the MKL link advisor, but still get the above mentioned warning. However, the executable seems to work fine.  `ldd` on the executable says that it's not a dynamically linked binary.  So I can ignore the warning?

0 Kudos
Ying_H_Intel
Employee
5,779 Views

Dear all, 

Yes,  the warning as  can be safely ignored when the executable work fine.  We will remove such warning in static library in further release. 

Thanks

Ying 

0 Kudos
Reply