I downloaded and built the latest version of the intel c/c++ compilers yesterday and have been trying to do some simple random number generation examples, but keep getting the compile error:
icpc test.cpp -o test -lmkl_rt >> test.cpp(40): error: identifier "VSL_METHOD_DGAUSSIAN_ICDF" is undefined >> errcode = vdRngGaussian( METHOD, stream, N, A, a, sigma );
My example code is given below. If I uncomment out the line redefining method to be 2, the constant from mkl_vsl_defines.h, the code compiles and runs as expected.
Does anybody know why this could be happening? And if in the meantime, is it possible to add a dynamically linked library to workaround not finding these constants.
#include <mkl.h> #include <iostream> #define SEED 0 #define BRNG VSL_BRNG_MCG31 #define METHOD VSL_METHOD_DGAUSSIAN_ICDF //#define METHOD 2 using namespace std; int main(int argc, char **argv) { const int N = 1000; double A[N] __attribute__((aligned(64))); int status; double a = 0, sigma = 1.0; VSLStreamStatePtr stream; int errcode; errcode = vslNewStream( &stream, BRNG, SEED ); errcode = vdRngGaussian( METHOD, stream, N, A, a, sigma ); errcode = vslDeleteStream( &stream ); cout << errcode; return 0; }