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

compile-time constant

akuhr
Beginner
704 Views

Hello!

I want to compile a very big softwarepackage.
I get very many errors like this:

A kind type parameter must be a compile-time constant.

The line thereto in the source:

real(dp) , intent(in) :: x

With other compilers it is working.

Can I give a compile-parameter to ifort, that it will
accept this statements?

This is the version:

ifort -V
Intel Fortran Compiler for 32-bit applications, Version 9.0 Build 20050624Z Package ID: l_fc_c_9.0.024
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

Regards, Astrid

0 Kudos
2 Replies
bpichon
Beginner
704 Views
It is true : DP "must" be a compile-time constant !!!
It is more improbable that it may work on any compiler
(the F95 is clear for this) !!!!!!!!
Probably, DP is defined in a modole that you don't have
compiled before ...
BP
0 Kudos
emc-nyc
Beginner
704 Views

real(dp) is describing the type of real (but you knew that). "dp" must be known to the compiler before the declaration; typically this means it will be set in a parameter statement in a module which is accessed by a use statement. For this to work, the module must be:

  • successfully compiled and
  • where the compiler can find it.

Modules are not compatible between compilers (e.g., Intel's won't work with PGI's or vice-versa) and not necessarily compatible between versions of the same vendor's compiler.

If you're not using modules, add a statement to the effect of

integer,parameter :: dp = selected_real_kind(p=16,r=300) substituting appropriate appropriate values for selected_real_kind's arguments, as needed.
0 Kudos
Reply