LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Fortran and separate module files (https://www.linuxquestions.org/questions/programming-9/fortran-and-separate-module-files-298469/)

Neruocomp 03-06-2005 06:02 PM

Fortran and separate module files
 
I've been messing around with Fortran and came up with a neat little physics program. There are two cars on the road and the program finds if they will collide given the speed and acceleration and distance between the two. But I have quite a few subroutines and would like to not just put them into a module but have them in separate files. But it doesnt seem to work. I'm using the intel fortran compiler(ver 8.1) and it gives me an error ": undefined reference to `MAIN__' " So whats going on here? I tested this out in windows using FTN95 and Plato and it works.

lasindi 03-06-2005 07:41 PM

Why don't you try g77? ;)

lasindi

Neruocomp 03-06-2005 11:03 PM

Because fortran 77 is too old haha as ironic as that is.

Neruocomp 03-07-2005 04:18 PM

Ok after some playing around I used ifort -c ###.f90 to make an object file out of the individual modules. But now how do I make the main program with these object files?

slackie1000 04-14-2005 08:09 AM

hi there,

a bit old, but looks still not answered...
you can give the parameter "-o "
it means output..
Code:

ifort -o main_program file1.o file2.o file3.o file4.....
regards

slackie1000


All times are GMT -5. The time now is 04:49 AM.