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

error #6451: A dummy argument name is required in this context.

cean
New Contributor II
2,051 Views

Hi,

 I have one Module defines a Type like this:

 

 

TYPE MKL_DSS_HANDLE; INTEGER(KIND=8) DUMMY; END TYPE

 

 

In another Module where trying to use it like this:

 

 

TYPE(MKL_DSS_HANDLE),INTENT(OUT):: HANDLE

 

 

The compiling error is #6451: A dummy argument name is required in this context. [HANDLE]

 

I found another thread mentioned this error at here:

a strange problem - Intel Communities

But no clue how to fix my case.

 

Thank you for help.

 

Cheers

Cean

0 Kudos
1 Solution
Arjen_Markus
Honored Contributor I
1,949 Views

The program does not define a parameter "LONG", so it should come in via the module (or modules), but the source code as found in the zip file does not contain any definition of such a parameter. So the compiler complains about it.

View solution in original post

0 Kudos
9 Replies
jimdempseyatthecove
Honored Contributor III
2,037 Views

Is HANDLE one of the arguments to the function/subroutine?

Is HANDLE an fpp macro name?

If both answers are no, try changing (in both argument and argument declaration) HANDLE to H. If this works, then there is some sort of name collision. And if so, please present a simple reproducer.

 

Jim Dempsey

 

0 Kudos
Steve_Lionel
Honored Contributor III
2,034 Views

HANDLE is a named (PARAMETER) constant in the Windows API declaration modules, but this declaration should hide that if it is accessible. The error message is suggesting that HANDLE isn't a dummy argument of the procedure containing this declaration - the INTENT(OUT) attribute requires that.

I'll comment that, with compiler error messages, context is everything - especially so for Fortran. Showing a single statement, especially one that complains about dummy arguments, doesn't give enough detail for us to help you. As Jim suggests, a minimal reproducer helps a lot.

0 Kudos
cean
New Contributor II
1,990 Views

Thanks all.

 

I changed the name HANDLE to BJHANDLE, still the same error.

It Is one of the arguments to a function.  It is called like this:

IntMKL_IER = DSS_CREATE ( BJHANDLE, opt )

 This DSS_CREATE function is in module A:

      INTERFACE
        FUNCTION DSS_CREATE( HANDLE, OPT )
          USE MKL_DSS_PRIVATE
          TYPE(MKL_DSS_HANDLE), INTENT(OUT)   :: HANDLE
          INTEGER,              INTENT(IN)    :: OPT
          INTEGER                             :: DSS_CREATE
        END FUNCTION DSS_CREATE
      END INTERFACE

 

Module USE MKL_DSS_PRIVATE has that Type declaration. 

Module A also use MKL_DSS_PRIVATE.

0 Kudos
Ron_Green
Moderator
1,979 Views

there's not enough to go on here.  Do you have something we can compile?

And you didn't mention what version of the compiler you are using.  Is this the latest v2022 compiler?  Ifort and not IFX, correct?

0 Kudos
cean
New Contributor II
1,957 Views

I am using VS 17.3.2 + IFC w_oneAPI_2022.1.0.256.

I am trying to make a little program:

 

    program Console4
    
    USE MKL_DSS
    IMPLICIT NONE
    TYPE(MKL_DSS_HANDLE)            :: HANDLE
    INTEGER(LONG)                   :: OPT               ! Option indicator for Intel MKL dss routines
    INTEGER(LONG)                   :: IntMKL_IER        ! Intel MKL error code (see MKL documentation for values)
      
    OPT = MKL_DSS_MSG_LVL_WARNING
    IntMKL_IER = DSS_CREATE ( HANDLE, OPT )

    end program Console4

 

It calls Function DSS_CREATE which is in MKL_DSS.f90

MKL_DSS.f90 needs MKL_DSS_PRIVATE.f90.  It declares TYPE MKL_DSS_HANDLE.

This is an old program and inside MKL_DSS.f90 it says these two modules are from an old MKL example.

 

But the error now is:

 

error #6683: A kind type parameter must be a compile-time constant. [LONG] 

 

 

0 Kudos
Arjen_Markus
Honored Contributor I
1,950 Views

The program does not define a parameter "LONG", so it should come in via the module (or modules), but the source code as found in the zip file does not contain any definition of such a parameter. So the compiler complains about it.

0 Kudos
cean
New Contributor II
1,947 Views

Thanks. 

I added LONG.

 

 

 

    program Console4
    
    USE MKL_DSS
    IMPLICIT NONE
    TYPE(MKL_DSS_HANDLE)            :: HANDLE
    
    INTEGER, PARAMETER :: LONG   =  4
    
    INTEGER(LONG)                   :: OPT               ! Option indicator for Intel MKL dss routines
    INTEGER(LONG)                   :: IntMKL_IER        ! Intel MKL error code (see MKL documentation for values)
      
    OPT = MKL_DSS_MSG_LVL_WARNING
    IntMKL_IER = DSS_CREATE ( HANDLE, OPT )

    end program Console4

 

 

 

 Now the error is:

 

 

 

error LNK2019: unresolved external symbol DSS_CREATE referenced in function MAIN_

 

 

 

Why it can't find that Function inside MKL_DSS.f90?

 

Also this test program doesn't demonstrate the error in my real program. 

0 Kudos
Andreas_Z_
New Contributor I
1,926 Views

In this case, the error goes away by linking to the MKL library (e.g. /Qmkl:parallel). In VS this is set under project properties > Fortran > Libraries

0 Kudos
cean
New Contributor II
1,932 Views

Found a dss_sym_f90.f90 at mkl\2022.1.0\examples\core\sparse_directsolvers\source. It is the same function as what I want. I can compile it with no problem. 

Need to figure out what went wrong for my version.

0 Kudos
Reply