Compiling FORTRAN into Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compiling FORTRAN into Linux
# 1  
Old 11-07-2012
Compiling FORTRAN into Linux

Hello,

I use Linux on Ubuntu 12.04.

I have a fortran script with extension .f and I want to compile it to an executable file in linux.

I have used this command:
Code:
f77 -o snp_hwe.exe snp_hwe.f

But I receive this error:
Code:
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status

I have no idea what this means, please help me on this.

---------- Post updated at 10:30 AM ---------- Previous update was at 10:29 AM ----------

By the way, this is the beginning of my program:

Code:
FUNCTION SNPHWE(N_HET, N_HOM1, N_HOM2, MAXHET) 
C 
C 
      DATA       KIN, KOUT /5,6/ 
      INTEGER    N_ALLR, N_ALL
      INTEGER    N_GENO 
      INTEGER    MIDPT
      INTEGER    C_HET, C_HOMR, C_HOMC 
      REAL*8     SNPHWE, PVALUE, SUM
      REAL*8     PROBS(MAXHET)
      REAL*8     PREV

# 2  
Old 11-07-2012
main is the function where your program begins when run. If it doesn't have one, it can't run.

".exe" is Windows, by the way. Linux/UNIX don't use it.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compiling Android system on Linux MInt

i have been trying to compile an android Marshmello system with no success. every time i try to compile i get this error javac: invalid source release: 1.7s Usage: javac <options> <source files> make: *** Error 41 #### make failed to build some targets (03:04 (mm:ss)) ####... (2 Replies)
Discussion started by: gearm
2 Replies

2. Programming

compiling old C program in Linux.

Hello, I am writing to ask for support about compiling an very old but famous C-progam for genetics study called MapMaker/QTL, and the source code is available from MIT: http://www.broadinstitute.org/ftp/distribution/software/mapmaker3/The program was originally designed for systems like SunOS... (1 Reply)
Discussion started by: yifangt
1 Replies

3. Linux

Automate compiling of linux kernel

Hi, I'm a newbie at kernel compilation. Currently trying to do a bash script to automate the compiling process of the linux kernel. I'm having some problems with automating the configuration. I know its possible to load an existing .config file in the make menuconfig screen prompt. But... (3 Replies)
Discussion started by: aloe_vera
3 Replies

4. Programming

Compiling Objective-C 2.0 under Linux

Hello all, I am new to programming and currently I am taking a swing at Objective-C. I easily compile my programs on my Macintosh, and have compiled some Objective-C programs on my linux box. The problem I am having is when I try to use features demonstrated in the book Programming in... (4 Replies)
Discussion started by: inquen
4 Replies

5. Programming

Cross compiling under Windows for Linux

I have two headless servers I am writing code for, and a Windows box networked with them. I want to compile my code within an IDE on the Windows box (eclipse most likely) and run the compiled binarys on the Linux boxes. Will this work? Using Cygwin (or MinGW)? Thoughts? Cheers, Ian (8 Replies)
Discussion started by: IanVaughan
8 Replies

6. UNIX for Dummies Questions & Answers

FORTRAN compiling

Hello, I have a FORTRAN code that I want to compile using F90 compiler. However, when I enter the command: f90 ./code.f -o ./code.out It would give me prompt saying that absoft license has failed, or something. I remember, however, that I could enter some keyword that ends with 'soft' in... (1 Reply)
Discussion started by: Iamthe great
1 Replies

7. Linux

Compiling Apple Top on Linux

Hello all. I recently tried compiling Apple's version of top on my Linux system. Can someone with some C experience explain why it won't build . . . and any tips to getting it to compile. Any help appreciated. BTW, you can pick up the Apple source code here: ... (0 Replies)
Discussion started by: blahblah
0 Replies

8. Linux

why is fortran used to port linux to others?

what is the speciality of fortran to be used while porting linux to other language? (1 Reply)
Discussion started by: sravus
1 Replies

9. HP-UX

compiling linux driver to run on HPUX

Hi, a friend of mine gave me an old HP B180 Unix Workstation with HPUX, the only problem with that, the onboard graphicsbaord doesn´t work anymore. I want to buy a new PCI Graphicsboard (350RAMDAC), but they only have Linux drivers going with the card. Question: Is it possible to compile... (4 Replies)
Discussion started by: hilbi
4 Replies
Login or Register to Ask a Question