LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 03-06-2005, 07:02 PM   #1
Neruocomp
Member
 
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Rep: Reputation: 15
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.
 
Old 03-06-2005, 08:41 PM   #2
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Rep: Reputation: 15
Why don't you try g77?

lasindi
 
Old 03-07-2005, 12:03 AM   #3
Neruocomp
Member
 
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Original Poster
Rep: Reputation: 15
Because fortran 77 is too old haha as ironic as that is.
 
Old 03-07-2005, 05:18 PM   #4
Neruocomp
Member
 
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Original Poster
Rep: Reputation: 15
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?
 
Old 04-14-2005, 09:09 AM   #5
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 45
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unzip multiple zip files, each to separate folder smart_sagittari Linux - Newbie 3 03-21-2012 09:41 AM
[SOLVED] FTP: recursive chmod (separate for directories and files) mgmax Linux - Software 11 01-29-2011 09:06 AM
logging daily cron jobs in separate files csmwlee Linux - Newbie 5 10-10-2005 11:30 AM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 09:59 AM
Fortran: compressing output files on the fly zero79 Programming 1 03-23-2005 07:39 PM


All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration