Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

undefined reference to `__intel_skx_avx512_memcpy'

Henrique_M_
Beginner
2,723 Views

Hi everybody,

I've received an error when trying to compile with the Fortran Compiler of Intel® Parallel Studio XE 2019.

Error

INFO: 1> Linking CCubeApp
ERROR: 1> /opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64_lin/libirng.so: undefined reference to `__intel_skx_avx512_memcpy'
ERROR: 1> collect2: error: ld returned 1 exit status

I tried to define: export LD_PRELOAD=/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64/libirc.so, since this is the library where I have the reference symbol available but got the same error.

Any clue on what is happening and any possible workaround?

Best regards,

-- 

Henrique Mageste

0 Kudos
9 Replies
Juergen_R_R
Valued Contributor I
2,723 Views

If you have a normal PC, then the correct path to be put into the LD_LIBRARY_PATH variable is

/local/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64

 

0 Kudos
Henrique_M_
Beginner
2,723 Views

Juergen R. wrote:

If you have a normal PC, then the correct path to be put into the LD_LIBRARY_PATH variable is

/local/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64

Maybe you meant /usr/local, right? In any case I don't have the intel compilers there. I have installed them in the default path: /opt/intel

0 Kudos
Juergen_R_R
Valued Contributor I
2,723 Views

Yes, /opt/intel, whatever it is, did you put it into the LD_LIBRARY_PATH? 

0 Kudos
Henrique_M_
Beginner
2,723 Views

Juergen R. wrote:

Yes, /opt/intel, whatever it is, did you put it into the LD_LIBRARY_PATH? 

Same error.

0 Kudos
Juergen_R_R
Valued Contributor I
2,723 Views

Well, first of all the compilation seems completely working, right? It is only the linking that fails. What is your exact link command? Maybe just use ifort for the linking step instead of ld?

 

0 Kudos
Henrique_M_
Beginner
2,723 Views

Juergen R. wrote:

Well, first of all the compilation seems completely working, right? It is only the linking that fails. What is your exact link command? Maybe just use ifort for the linking step instead of ld?

The problem is indeed in the linker, since it did not present any problem in the compilation.

I managed to make it link passing the path of the library where I have the symbol defined (libirc.so) directly to the linker. Just to let it documented here, I have used:

g++ -o executable -L/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64/ -L...

I don't know if this is actually a solution or a workaroud. Perhaps I'll need to change some Makefiles to make sure that I have the correct Intel libraries in the path when the linker comes in play.

0 Kudos
Juergen_R_R
Valued Contributor I
2,723 Views

Hi Henrique,

I think this is not a trick but the proper solution. If you use g++ for linking, it doesn't know anything about the Fortran libraries of ifort, so you have to include them explictly. We do this actually by using a variable FCLIBS into which we set the Fortran libraries needed for linking if we build a C/C++ executable into which we link our code as a Fortran library.

Cheers,

     JRR

0 Kudos
Henrique_M_
Beginner
2,723 Views

Thanks for the answer Juergen,

Shouldn't the /opt/intel/bin/compilervars.sh do that for me?

Regards,

-- 

Henrique

0 Kudos
Juergen_R_R
Valued Contributor I
2,723 Views

Somehow I never use the compilervars.sh scripts but rather set my environment variables by myself. Also I am not sure whether the things are sufficient when you have a mixed C++/Fortran project where you compile with one compiler and link with another. 

0 Kudos
Reply