Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Version 18 not finding constants defined in mkl_vsl_defines.h

$
0
0

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; 
} 

 


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>