I am trying to compile a fortran program which uses a bunch of modules. I obtain an error when I compile it, and it's driving me crazy. The error is originated by the addition of one subroutine and takes place when I try to recompile the program:
Main program contains these two lines:
--
call read_step(nStepOne,molOne)
call read_step(nStep,mol)
--
This is calling one of the subroutines in a file "fileio.f90":
--
subroutine read_step(n,tape)
implicit none
integer, intent(in) :: tape
integer, intent(out) :: n
character(len=6) :: dum
rewind(tape)
read (tape,*)
read (tape,*) dum, n
rewind(tape)
return
!
end subroutine read_step
--
When I try to compile it, the following error arises:
ifort -o SpIdMD.x *.o -static-intel -openmp
SpIdMD.o: In function `MAIN__':
SpIdMD.f90:(.text+0x3b2): undefined reference to `read_step_'
SpIdMD.f90:(.text+0x3c5): undefined reference to `read_step_'
make: *** [SpIdMD.x] Error 1
Other calls to subroutines in the same module did not give any error, and I just don't see any difference between the calls to the "old subroutines" and the one I just created.
An example of one of these "old subroutines", which does not give any complaint, is:
In the main program:
call get_dim(n_atom,nSnap,mol)
In the fileio.f90:
subroutine get_dim(n,n_snap,tape)
implicit none
integer,intent(in) :: tape
integer,intent(out) :: n, n_snap
integer :: m
rewind(tape)
read (tape,*,err=1,end=2) n
rewind(tape)
m = 0
do while (.true.)
read (tape,*,err=1,end=3)
m = m +1
end do
3 n_snap = m/(n + 2)
if (m.ne.(n_snap*(n + 2))) stop 'unexpected end of input file'
rewind(tape)
return
!
1 stop 'error in input file'
2 stop 'unexpected end of input file'
end subroutine get_dim
I have absolutely no idea why this behavior. I'd be grateful if anybody could help me solve this nightmare. Thanks!
make cleanand then triedmakeagain ?