problem for ifort which does not use system lib mission like idate getarg and so on

problem for ifort which does not use system lib mission like idate getarg and so on

Hello experts,

    I installed the new version intel parallel composer XE 2013 sp2 updates2 noncommercial, but I find when I use ifort to compile the fortran codes, the error reported like the following:

systime_intel.f(34): warning #7532: The number of arguments is incompatible with intrinsic procedure, assume 'external'.   [IDATE]

and the same to 'getarg and iargc'. How to solve this issue?

    I try to use gfortran to compile the same codes, it make it.

   So I think I should remove the new version and install the older version such as Version7 or Version 9. But I do not find the license file for noncommercial. Can you help me about it?

hope your help,

best regards

yours alex

reply to me with 'alexalex43210@gmail.com'

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Try adding USE IFPORT to your code where used. Without that the compiler uses the intrinsic version of IDATE which has different argument requirements.

Quote:

Kevin Davis (Intel) wrote:

 

Try adding USE IFPORT to your code where used. Without that the compiler uses the intrinsic version of IDATE which has different argument requirements.

Thanks for your reply Kevin.

But I try what you recommended, it did not work.

and I have lots of .f files, which will be compiled. So it's not the valid idea for solve that problem.

Anyway, Thanks all the time.

Without seeing your code I'm just guessing what your usage is. For the small example below it works.

u508658.f
---------
       program test

#ifdef fix
       use ifport
#endif

       implicit none
       integer :: ivals(3)

       call idate(ivals)
       print *,"month=",ivals(1)," day=",ivals(2)," year=",ivals(3)

       end program test

$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.144 Build 20140120

$ ifort -fpp u508658.f
u508658.f(10): warning #7532: The number of arguments is incompatible with intrinsic procedure, assume 'external'.   [IDATE]
       call idate(ivals)
------------^
u508658.f(10): warning #7148: Arguments incompatible with intrinsic procedure, assume EXTERNAL.   [IDATE]
       call idate(ivals)
------------^

Compiled with the USE IFORT active succeeds and produces the working executable

$ ifort -fpp -Dfix u508658.f
$ ./a.out
 month=          31  day=           3  year=          14

Maybe if you are just wanting to ignore the warnings, those can be silenced using: -diag-disable

$ ifort -fpp u508658.f -diag-disable 7532,7148
$ ./a.out
 month=          31  day=           3  year=          14

 

PS - Please pardon the extra blank lines. Something is not working again with cut-and-paste from external text editors into our Forum.

Quote:

Kevin Davis (Intel) wrote:

 

Without seeing your code I'm just guessing what your usage is. For the small example below it works.

 

u508658.f
---------
       program test

 

 

#ifdef fix
       use ifport
#endif

 

 

       implicit none
       integer :: ivals(3)

 

 

       call idate(ivals)
       print *,"month=",ivals(1)," day=",ivals(2)," year=",ivals(3)

 

 

       end program test

 

 

$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.144 Build 20140120

 

 

$ ifort -fpp u508658.f
u508658.f(10): warning #7532: The number of arguments is incompatible with intrinsic procedure, assume 'external'.   [IDATE]
       call idate(ivals)
------------^
u508658.f(10): warning #7148: Arguments incompatible with intrinsic procedure, assume EXTERNAL.   [IDATE]
       call idate(ivals)
------------^

 

 

Compiled with the USE IFORT active succeeds and produces the working executable

 

 

$ ifort -fpp -Dfix u508658.f
$ ./a.out
 month=          31  day=           3  year=          14

 

 

Maybe if you are just wanting to ignore the warnings, those can be silenced using: -diag-disable

 

 

$ ifort -fpp u508658.f -diag-disable 7532,7148
$ ./a.out
 month=          31  day=           3  year=          14

 

 

 

 

 

PS - Please pardon the extra blank lines. Something is not working again with cut-and-paste from external text editors into our Forum.

Thank you Kevin. for the single issue, It will make it.

But I come across this problem when I install one software package. In the request of compilers, it asked for the choice for IFCV7 and IFCV6 but I only installed the latest version of intel fortran compiler. And I know the compile mission for IFCV6 and V7 is 'ifc', So I link 'ifort' to 'ifc' in /opt/intel/bin and hope that will work it out. But it does not make it and give the error report I gave in the past message.

I have no methods to modify the installation software package. So do you have some ways to make it ?

by the way, although I can modify the installation scripts for software, the option and syntax you used with ifort  is complex, it will take lots of time and will be a huge task.

best regards,

yours alex

 

Both ifort and gfortran have supported the standard Fortran date_and_time and command_argument intrinsic functions for several years.  Some past versions of idate were valid only prior to year 2000.  

If you need to look into how your program uses these functions, your time might be better spent reconciling it with standard Fortran.

Intel compilers always have expected the sourcing of the supplied environment variable script script to set up the compiler environment.  If you are forcing ifort to run against the libraries of some other compiler, you can expect trouble regardless of whether you choose legacy or standard library function calls.  There is no run-time library compatibility between gfortran and ifort, although they would normally run against the same g++ installation.

Quote:

Tim Prince wrote:

Both ifort and gfortran have supported the standard Fortran date_and_time and command_argument intrinsic functions for several years.  Some past versions of idate were valid only prior to year 2000.  

If you need to look into how your program uses these functions, your time might be better spent reconciling it with standard Fortran.

Intel compilers always have expected the sourcing of the supplied environment variable script script to set up the compiler environment.  If you are forcing ifort to run against the libraries of some other compiler, you can expect trouble regardless of whether you choose legacy or standard library function calls.  There is no run-time library compatibility between gfortran and ifort, although they would normally run against the same g++ installation.

Thank you TIm,

but I do not understand what you said. I am newbie.

The trouble is that functions such as IDATE, GETARG and IARGC are not standard, and have been implemented differently by different compiler vendors.  In the case of IDATE, we provide module IFPORT to allow usage of a couple of different variants of the call. GETARG and IARGC we implement as compiler intrinsics. Tim correctly pointed out that the Fortran standard has standard intrinsic procedures for the functions you name: DATE_AND_TIME, GET_COMMAND_ARGUMENT and COMMAND_ARGUMENT_COUNT. If you use these, they will work correctly on all standard implementations.

You have not shown us your code that gives a problem, so it's hard to make explicit recommendations.

Steve - Intel Developer Support

Hi Alex,

    Let me see if I understand your situation.

    You have a software package written in Fortran from another vendor.

     That package requests that you use Intel Fortran V6 or Intel Fortran V7.

     When you used Intel Fortran V14 there were many compile-time warnings about the non-standard routines IDATE, GETARG, and IARGC, and your package could not build.

        Because there are many many files in the software package, you don't want to edit all the files to make the changes suggested in this forum.

              Does this describe your situation?

    Really, the only option you have is to make the edits suggested, although you may not have to edit every file in your package.

Please be aware that Intel Fortran V6 and V7 are nearly 15 years old, and are no longer available.   The Intel Fortran compiler was rewritten for V8 and is very different (as you've seen).

                     Regards,

                                                --Lorri

 

Quote:

Steve Lionel (Intel) wrote:

The trouble is that functions such as IDATE, GETARG and IARGC are not standard, and have been implemented differently by different compiler vendors.  In the case of IDATE, we provide module IFPORT to allow usage of a couple of different variants of the call. GETARG and IARGC we implement as compiler intrinsics. Tim correctly pointed out that the Fortran standard has standard intrinsic procedures for the functions you name: DATE_AND_TIME, GET_COMMAND_ARGUMENT and COMMAND_ARGUMENT_COUNT. If you use these, they will work correctly on all standard implementations.

You have not shown us your code that gives a problem, so it's hard to make explicit recommendations.

Thanks Lionel, what you said is helpful to me. As you said, I must use the older version of compiler because the package of software has lots of functions like those are not standard(IDATE, GETARG, IARGC).

Quote:

Lorri Menard (Intel) wrote:

 

Hi Alex,

 

    Let me see if I understand your situation.

 

 

    You have a software package written in Fortran from another vendor.

 

 

     That package requests that you use Intel Fortran V6 or Intel Fortran V7.

 

 

     When you used Intel Fortran V14 there were many compile-time warnings about the non-standard routines IDATE, GETARG, and IARGC, and your package could not build.

 

 

        Because there are many many files in the software package, you don't want to edit all the files to make the changes suggested in this forum.

 

 

              Does this describe your situation?

 

 

    Really, the only option you have is to make the edits suggested, although you may not have to edit every file in your package.

 

 

Please be aware that Intel Fortran V6 and V7 are nearly 15 years old, and are no longer available.   The Intel Fortran compiler was rewritten for V8 and is very different (as you've seen).

 

 

                     Regards,

 

 

                                                --Lorri

 

 

 

Thank you very much Lorri. What you describe about the situation is exact, that its not need to modify the codes of software.

By the way, is there any other method to use ifort2014 to substitute the older version? for example, the option parameters used by ifort2014 for compiling is different with that by IFCV7.

Additionally, for FCV8, are the functions like idate, getarg or iargc used normally?

best regards,

yours alex

 

Hi Alex -

     If you list the options that your package is using, we can tell you what to change to match the ifort options.

     You will still have build problems with the uses of IDATE, GETARG, and IARGC.   There are no command line options that will change the behavior.  It must be done by changing the source files that reference those routines.   Not all source files, just those few that reference those routines.  That's the easiest solution we have.

     These are not standard Fortran routines, and compiler implementations vary.

                     Regards --
                                   --Lorri

If you are tied down to using non-standard functions/subroutines because replacing them by standard functions would be too much work, you could provide code that implements these non-standard routines in terms of standard routines. For example, to provide the missing subroutine idate, write a wrapper subroutine that calls date_and_time:

program pidatet
   use ifport, only : pidate=>idate
   implicit none
   external :: idate
   integer :: i,j,k
   call idate(i,j,k)  ! wrapped intrinsic date_and_time
   write(*,*)i,j,k
   call pidate(i,j,k) ! portability subroutine
   write(*,*)i,j,k
end program pidatet

subroutine idate(i,j,k)
  integer, intent(out) :: i,j,k
  integer :: values(8)
  call date_and_time(VALUES=values)
  i=values(2); j=values(3); k=values(1)-2000
  return
end subroutine idate

WARNING: Note that the code introduces the dreaded Y2K problem, because two digits are used to represent the year. You have do decide whether 2000 or some other value is the reference value that should be subtracted from the year value.

To your application project, you could add a source file containing the wrapper/conversion routines (such as Subroutine IDATE in my listing). You would not need USE IFPORT in your application sources. You would need USE IFPORT in the conversion routines only if you choose to use them in doing the conversion, which decision I should advise you not to make.

Leave a Comment

Please sign in to add a comment. Not a member? Join today