LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   g77 installation on ubuntu 12.04 (64-bit) (https://www.linuxquestions.org/questions/linux-newbie-8/g77-installation-on-ubuntu-12-04-64-bit-4175516296/)

mohammad taqy bayat 08-25-2014 08:43 AM

g77 installation on ubuntu 12.04 (64-bit)
 
hi there,
My laptop is 64-bit machine that ubuntu 12.04 LTS(64-bit) installed on it and I need g77 compiler to run a makefile like this:

LEADIR := ./lea

FC := g77

CC := gcc

FFLAGS := -c -fno-underscoring -fugly-logint

CFLAGS := -c -O -DLinux -I $(LEADIR)/inc

LDFLAGS:= -O2 -L$(LEADIR) -llea -L/usr/X11R6/lib -lXext -lX11

%.o : %.for ; $(FC) $(FFLAGS) $<

fsources := $(shell echo *.for)
csources := $(shell echo *.c)

fobjects := $(fsources:.for=.o)
cobjects := $(csources:.c=.o)

all: prog

prog: $(fobjects) $(cobjects) $(fsources) $(csources)
$(FC) $(fobjects) $(cobjects) -o ReadData -lpthread $(LDFLAGS)


clean:
rm *.o *~ ReadData

here is the error massage:

bayat@ubuntu:~/BINA/ReadData_off$ make
g77 -c -fno-underscoring -fugly-logint analyse.for
make: g77: Command not found
make: *** [analyse.o] Error 127

please tell me how can i install it.

suicidaleggroll 08-26-2014 04:48 PM

Change "FC" from g77 to gfortran

gfortran is now the all-encompassing fortran compiler, including 77, 90, 95, etc.
http://www2.physics.ox.ac.uk/it-serv...as-g77-gone-to

John VV 08-26-2014 08:54 PM

i was under the impression that for 77 you needed "gcc33-fortran "
that 90 and up are in the current gcc4

mohammad taqy bayat 08-31-2014 12:06 AM

Quote:

Originally Posted by suicidaleggroll (Post 5227753)
Change "FC" from g77 to gfortran

gfortran is now the all-encompassing fortran compiler, including 77, 90, 95, etc.
http://www2.physics.ox.ac.uk/it-serv...as-g77-gone-to

I changed the "g77" to "gfortran" but I encountered with this error:
f951: error: unrecognized command line option ‘-fugly-logint’

knudfl 08-31-2014 06:12 AM

"g77" for Ubuntu 12.04 - 64bits : compat-gcc34-g77-3.4.6-ubuntu12-1_amd64.deb
https://drive.google.com/file/d/0B7S...it?usp=sharing

Depends on : compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb
https://drive.google.com/file/d/0B7S...it?usp=sharing
... and compat-libf2c-3.4.6-ubuntu12-2_amd64.deb
https://drive.google.com/file/d/0B7S...it?usp=sharing

-

suicidaleggroll 08-31-2014 09:37 AM

Quote:

Originally Posted by mohammad taqy bayat (Post 5230032)
I changed the "g77" to "gfortran" but I encountered with this error:
f951: error: unrecognized command line option ‘-fugly-logint’

Then whoever wrote the initial code didn't know what they were doing. Your best option is to remove that flag and fix the actual problems with the code:
https://who.rocq.inria.fr/Michel.Kern/G77/g77_9.html

That flag is essentially telling the compiler, "I know that what I wrote isn't actually fortran, but try to figure out what I meant and do that instead." It was thankfully removed from gfortran, since it has no business being in a compiler.

mohammad taqy bayat 08-31-2014 09:56 PM

I removed the flag of "-fugly-logint" but it shows the following ERROR:
gfortran -c -fno-underscoring analyse.for
eve_buff.inc:64.72:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 adc_buf(0:m_adc_max,0:15),
1
Error: Syntax error in COMMON statement at (1)
eve_buff.inc:65.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 tdc_buf(0:m_tdc_max,0:31,1:16),
1
Error: Invalid character in name at (1)
eve_buff.inc:107.24:
Included at KVI_include.inc:9:
Included at analyse.for:17:

common /evebuf1/
1
Error: Syntax error in COMMON statement at (1)
eve_buff.inc:108.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 nev, sec, nsec, ireg, nsca, nadc, ntdc, npcs
1
Error: Invalid character in name at (1)
eve_buff.inc:110.72:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 n_event,
1
Error: Syntax error in COMMON statement at (1)
eve_buff.inc:111.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 s_poi,
1
Error: Invalid character in name at (1)
eve_buff.inc:112.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 a_poi,
1
Error: Invalid character in name at (1)
eve_buff.inc:113.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 t_poi,
1
Error: Invalid character in name at (1)
eve_buff.inc:114.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 p_poi
1
Error: Invalid character in name at (1)
eve_buff.inc:115.24:
Included at KVI_include.inc:9:
Included at analyse.for:17:

common /evebuf3/
1
Error: Syntax error in COMMON statement at (1)
eve_buff.inc:116.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 sca(1:m_scl_max),
1
Error: Invalid character in name at (1)
eve_buff.inc:117.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 adc(1:eve_adc_max),
1
Error: Invalid character in name at (1)
eve_buff.inc:118.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 tdc(1:eve_tdc_max),
1
Error: Invalid character in name at (1)
eve_buff.inc:119.9:
Included at KVI_include.inc:9:
Included at analyse.for:17:

1 pcos(1:eve_pcs_max)
1
Error: Invalid character in name at (1)
make: *** [analyse.o] Error 1

suicidaleggroll 08-31-2014 11:42 PM

As I said before, you need to remove the flag and fix the code
You have two options:
1) Try to pigeonhole a modern compiler intro attempting to interpret the code you have in front of you.
or
2) Fix the code to conform to actual Fortran standards and use any modern Fortran compiler you wish to build it.


All times are GMT -5. The time now is 11:56 AM.