I am trying to use the intrinsic procedure cpu_time(), but get the error: "Error 1 error LNK2019: unresolved external symbol _for_cpusec_x referenced in function ...". My best guess is that this is because I compile the code with Fortran 90 without Fortran 95 and newer? Does anyone know if this is the case and how I can fix it or have any other suggestions for what is causing this?
I am using visual studio 2013 and Intel parallel studio xe 2017 on win 7.
More likely your build environment is incorrect and you're missing the libraries that match your compiler. It has nothing to do with Fortran 90 vs. Fortran 95. You appear to be using a REAL(16) variable as the argument to CPU_TIME - was that intentional?
How are you building this application? Command line or Visual Studio? Which version of Intel Fortran are you using?
Hi Steve Lionel,
You are right. It is because that I use a real(16) variable as argument. I am using visual studio 2013 and Intel parallel studio xe 2017 on win 7.
Thank you for your help :)
Ok - what I see is that the entry point for CPU_TIME with a REAL(16) argument is provided in the static libraries but not the DLL libraries. That's our error and I'll ask that it be fixed. Issue ID is DPD200415120.
You can either change the project property Fortran > Libraries > Use Run-Time Library to "Multithreaded" (instead of "Multithread DLL") - you can also select the "Debug" variant of that if you want - or make the argument to CPU_TIME a REAL(8) or REAL(4) variable.