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

Why won't this program link ?

WSinc
New Contributor I
495 Views
Only 10 source lines in the whole program - - -

The linker hangs, never finishes.
I have to cancel the build.
Any clues? I don't see why an infinite loop would cause this problem - it never generates an EXE.
**************************
program Test1
implicit none
do while (.true.)
call sub1('Hello World')
end do
end program Test1

subroutine sub1(label)
character (len=*)label
print *,label
end subroutine
0 Kudos
2 Replies
eos_pengwern
Beginner
494 Views
Quoting - billsincl
Only 10 source lines in the whole program - - -

The linker hangs, never finishes.
I have to cancel the build.
Any clues? I don't see why an infinite loop would cause this problem - it never generates an EXE.
**************************
program Test1
implicit none
do while (.true.)
call sub1('Hello World')
end do
end program Test1

subroutine sub1(label)
character (len=*)label
print *,label
end subroutine

Someone in Premier Support told me, apropos a test program I had sent them not much more complex than this, that even when the subroutine was in the same file as the main program I should give the subroutine an explicit interface. Apparently, a subroutine's interface is regarded as explicit if it is a module, but not otherwise.

But my program linked and even ran... Even so, adding an explicit interface to sub1 within Test1 may be worth a shot.

Stephen.

0 Kudos
WSinc
New Contributor I
494 Views
Quoting - eos pengwern

Someone in Premier Support told me, apropos a test program I had sent them not much more complex than this, that even when the subroutine was in the same file as the main program I should give the subroutine an explicit interface. Apparently, a subroutine's interface is regarded as explicit if it is a module, but not otherwise.

But my program linked and even ran... Even so, adding an explicit interface to sub1 within Test1 may be worth a shot.

Stephen.

I had "generate interface" turned on, and it generated a module anyway.
I'll try a separate source file, and an explicit interface.
0 Kudos
Reply