Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29318 Discussions

Calling function mktime from fortran.

Michael_Menge
Beginner
1,087 Views
We are porting a fortran program from OpenVMS to Suse Linux SLES10 an have installed for testing the Intel Compiler Suite Professional Edition for Linux*. The application uses function qsort and mktime (VMS: decc$qsort and decc$mktime from VMS-CRTL-Library).
Function qsort is part of the intel fortran compatibility library, but the reference to function mktime isn't resolved, I get 'undefined reference to mktime_' when linking.
In which library can I find function mktime? Do I have to install the intel c/c++ compiler too for mktime is probably part of a library of the c compiler? What is to do to get the reference resolved?
0 Kudos
2 Replies
Stephen_D_Intel
Employee
1,087 Views
Hi Michael,

The C-library mktime is defined in libc. To get rid of the trailing underscore, you can try something like this
in your Fortran program:

!dir$ attributes alias: 'mktime' :: mktime

Regards,
Steve D.
Intel Developer Support

0 Kudos
TimP
Honored Contributor III
1,087 Views
gcc counts as an ifort interoperable compiler for USE iso_c_binding, so you ought to be able to call mktime the portable way.
0 Kudos
Reply