Take the 2-minute tour ×

I'm compiling a large HPC system written in Fortran using the Intel compiler (ifort). There are about several hundred individual modules and they all compile fine, but the linker throws up this error:

phys_grid.o(.text+0x91b2): In function `phys_grid_mp_assign_chunks_':
: undefined reference to `_mm_idivrem_epi32'

The _mm_idivrem_epi32 seems to be a result of the compiler's automatic vectorization, but if the compiler generated it, why am I getting this error? Do I need to link in some additional library?


Using nm, I was able to trace the function to libsvml but linking with that didn't help. Now herein seems to lie the problem: ia32intrin.h declares the function as follows:

__m128i __cdecl _mm_idivrem_epi32(__m128i * r, __m128i v1, __m128i v2); //__svml_idivrem4

But from nm's output, the symbol in the library is __svml_idivrem4. According to the header file, these are the same functions, but can I tell this to the linker?

share|improve this question
add comment

2 Answers

Recourse to Google points me to a file, on my Mac:


which contains a declaration of a symbol


So it does look as if you are missing a linkage or include.

share|improve this answer
Mine doesn't have it, but I'm running version 9.1, and it looks like you have 11.1. Casablanca, what version of the compiler are you running? –  T.E.D. Jul 1 '10 at 18:29
I'm using version 11.1. Indeed the header file Mark mentioned contains the declaration for _mm_idivrem_epi32, but I'm still trying to figure out exactly which library I need to link with. –  casablanca Jul 1 '10 at 18:39
add comment

My guess is that the source file in question (phys_grid.f90?) doesn't have an implicit none statement. Without that, ifort will just assume there must be a routine somewhere matching that profile, and merrily compile it up and hand it to the linker for resolution.

Of course your next job is going to be to go find the code for that missing routine, or to figure out WTH it does so you can rewrite it.

share|improve this answer
add comment

Your Answer


