Problem with Ifort and drand48()

Problem with Ifort and drand48()

I have C code like such:

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
    double x[10000];
    int i;
    for (i - 0; i<10000; i++){
       x[i] = tan(3.0*drand48());

I compile it with icc:

icc -c rand.c

I link it with ifort:

ifort -nofor-main rand.o -lm

This works with the older ifort 12.0.4 and with gcc 4.4.7, but does not work with ifort 13.0.1

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I get the error "undefined reference to 'simd_drand48_pd64x2'

You probably need to specify some icc libraries that ifort doesn't link to. I am moving this to the Intel C++ forum where C++ experts can advise you.

Steve - Intel Developer Support

The library you need is  You can link your code with ifrort using the command line:

$ ifort -nofor-main rand.o -lirng

(I tracked this down looking at the symbol table of the binary linked with icc.)

That worked Casey.  Thank you for your help!

Leave a Comment

Please sign in to add a comment. Not a member? Join today