Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28443 Discussions

Cannot compile using fortran 95 intrinsic procedure cpu_time

Brian_B_1
Beginner
307 Views

Hi

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.

Best regards,

Brian

0 Kudos
4 Replies
Steven_L_Intel1
Employee
307 Views

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?

0 Kudos
Brian_B_1
Beginner
307 Views

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 :)

 

0 Kudos
Steven_L_Intel1
Employee
307 Views

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.

0 Kudos
Steven_L_Intel1
Employee
307 Views

The missing DLL export will be added in Update 2 to Parallel Studio XE 2017.

0 Kudos
Reply