X=YZ
11-26-2003, 03:01 AM
Greetings,
I'm new to Linux and Lf95 on Linux (used the Windows system for years) and having a bit of trouble getting going. Running Redhat Linux 9 (straight off the CD).
I'm getting the error:
[XYZ]$ make
lf95 -g -c Test.f90
Encountered 0 errors, 0 warnings in file Test.f90.
lf95 -g Main.f90
Encountered 0 errors, 0 warnings in file Main.f90.
Main.o(.text+0x3c): In function `MAIN__':
Main.f90:9: undefined reference to `test_module.printit_'
Main.o(.data+0x0):Main.f90:1: undefined reference to `test_module.printit_'
make: *** [doit] Error 1
As you can see, I'm running a simple Makefile:
[XYZ]$ cat Makefile
F90 = lf95
F90_OPTS = -g
doit: Test_MODULE.o
$(F90) $(F90_OPTS) Main.f90
Test_MODULE.o : Test.f90
$(F90) $(F90_OPTS) -c $<
clean:
rm -f *.o *.mod core
The code is similarly simple:
[XYZ]$ cat Test.f90
MODULE Test_Module
CHARACTER(11), PARAMETER :: Messg = 'Hello World'
CONTAINS
SUBROUTINE Printit
write (*,*) Messg
END SUBROUTINE Printit
END MODULE
{XYZ]$ cat Main.f90
PROGRAM Main
USE Test_Module
IMPLICIT NONE
write (*,*) 'Starting'
call printit
write (*,*) 'Ending'
END PROGRAM Main
Any insight that you can provide would be greatly appreciated!
X=YZ
I'm new to Linux and Lf95 on Linux (used the Windows system for years) and having a bit of trouble getting going. Running Redhat Linux 9 (straight off the CD).
I'm getting the error:
[XYZ]$ make
lf95 -g -c Test.f90
Encountered 0 errors, 0 warnings in file Test.f90.
lf95 -g Main.f90
Encountered 0 errors, 0 warnings in file Main.f90.
Main.o(.text+0x3c): In function `MAIN__':
Main.f90:9: undefined reference to `test_module.printit_'
Main.o(.data+0x0):Main.f90:1: undefined reference to `test_module.printit_'
make: *** [doit] Error 1
As you can see, I'm running a simple Makefile:
[XYZ]$ cat Makefile
F90 = lf95
F90_OPTS = -g
doit: Test_MODULE.o
$(F90) $(F90_OPTS) Main.f90
Test_MODULE.o : Test.f90
$(F90) $(F90_OPTS) -c $<
clean:
rm -f *.o *.mod core
The code is similarly simple:
[XYZ]$ cat Test.f90
MODULE Test_Module
CHARACTER(11), PARAMETER :: Messg = 'Hello World'
CONTAINS
SUBROUTINE Printit
write (*,*) Messg
END SUBROUTINE Printit
END MODULE
{XYZ]$ cat Main.f90
PROGRAM Main
USE Test_Module
IMPLICIT NONE
write (*,*) 'Starting'
call printit
write (*,*) 'Ending'
END PROGRAM Main
Any insight that you can provide would be greatly appreciated!
X=YZ