gfortran not connecting to system libraries


 
Thread Tools Search this Thread
Top Forums Programming gfortran not connecting to system libraries
# 1  
Old 03-07-2011
gfortran not connecting to system libraries

Hi !
I have one program made of several sub programs which I am trying to compile with gfortran on Fedora 14 in my system. The program was originally written in Fortran 77 and compilation command used to be -

Code:
fort77 -O2 -f -w -o life life_com.f lifetime.f minuit.f tek_life.f utilities.f xjwlibu.f x_life_d.f xjwlibc.c ran.c -L/usr/X11R6/lib -lX11

I am trying to compile with gfortran using the following script :

Code:
OBJA = lifetime.o life_com.o x_life_d.o minuit.o utilities.o xjwlibu.o xjwlibc.o ran.o
CFLAGS  = -c -O
FFLAGS  = -c -O -fno-underscoring -ffixed-line-length-132 -finit-local-zero -fno-automatic
#
lifetime: $(OBJA)
    gfortran -L/usr/X11R6/lib -lX11 -o life $(OBJA) 

lifetime.o:lifetime.f PARAM.CMN LIFETIME.CMN MINUIT.CMN
    gfortran $(FFLAGS) lifetime.f
life_com.o:life_com.f PARAM.CMN LIFETIME.CMN MINUIT.CMN
    gfortran $(FFLAGS) life_com.f
x_life_d.o:x_life_d.f PARAM.CMN LIFETIME.CMN
    gfortran $(FFLAGS) x_life_d.f
minuit.o:minuit.f PARAM.CMN MINUIT.CMN
    gfortran $(FFLAGS) minuit.f
utilities.o:utilities.f PARAM.CMN
    gfortran $(FFLAGS) utilities.f
xjwlibu.o:xjwlibu.f
    gfortran $(FFLAGS) xjwlibu.f
xjwlibc.o:xjwlibc.c
    gcc  $(CFLAGS) xjwlibc.c
ran.o:ran.c
    gcc  $(CFLAGS) ran.c



when I tried to build with make, I get the following errors :

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Code:
gfortran -L/usr/X11R6/lib -lX11 -o life lifetime.o life_com.o x_life_d.o minuit.o utilities.o xjwlibu.o xjwlibc.o ran.o
life_com.o: In function `inpar':
life_com.f .text+0xba9f): undefined reference to `date'
life_com.o: In function `outi':
life_com.f .text+0x19899): undefined reference to `date'
life_com.o: In function `outr':
life_com.f .text+0x1a117): undefined reference to `date'
x_life_d.o: In function `x_display':
x_life_d.f .text+0x14ac): undefined reference to `xx_winman'
x_life_d.f .text+0x1532): undefined reference to `date'
x_life_d.f .text+0x1759): undefined reference to `xx_winman'
x_life_d.o: In function `x_display_shapes':
x_life_d.f .text+0x2a90): undefined reference to `xx_winman'
x_life_d.f .text+0x2ad6): undefined reference to `date'
x_life_d.f .text+0x2bfe): undefined reference to `xx_winman'
x_life_d.o: In function `x_eraser':
x_life_d.f .text+0x3683): undefined reference to `xx_winman'
xjwlibu.o: In function `draw_axis':
xjwlibu.f .text+0x3e4): undefined reference to `xx_drawline'
xjwlibu.f .text+0x41b): undefined reference to `xx_drawline'
xjwlibu.f .text+0x454): undefined reference to `xx_drawline'
xjwlibu.f .text+0x48b): undefined reference to `xx_drawline'
xjwlibu.f .text+0x575): undefined reference to `xx_drawline'
xjwlibu.o:xjwlibu.f .text+0x610): more undefined references to `xx_drawline' follow
xjwlibu.o: In function `plotxy':
xjwlibu.f .text+0x25d2): undefined reference to `xx_sync'
xjwlibu.o: In function `plotpix':
xjwlibu.f .text+0x267f): undefined reference to `xx_drawlines'
xjwlibu.f .text+0x2693): undefined reference to `xx_sync'
xjwlibu.o: In function `draw_line':
xjwlibu.f .text+0x2748): undefined reference to `xx_drawline'
xjwlibu.o: In function `draw_open_circle':
xjwlibu.f .text+0x2801): undefined reference to `xx_drawarc'
xjwlibu.o: In function `draw_filled_circle':
xjwlibu.f .text+0x28a8): undefined reference to `xx_fillarc'
xjwlibu.o: In function `draw_dash':
xjwlibu.f .text+0x2937): undefined reference to `xx_drawline'
xjwlibu.o: In function `texout':
xjwlibu.f .text+0x2c02): undefined reference to `xx_drawstring'
xjwlibu.f .text+0x2c16): undefined reference to `xx_sync'
xjwlibu.o: In function `nucur':
xjwlibu.f .text+0x2dbe): undefined reference to `xx_drawline'
xjwlibu.f .text+0x2df7): undefined reference to `xx_drawline'
xjwlibu.f .text+0x2e29): undefined reference to `xx_drawline'
xjwlibu.f .text+0x2e59): undefined reference to `xx_drawline'
xjwlibu.o: In function `cussman':
xjwlibu.f .text+0x3031): undefined reference to `xx_winman'
xjwlibu.f .text+0x304a): undefined reference to `xx_winman'
xjwlibu.o: In function `getinteger':
xjwlibu.f .text+0x3464): undefined reference to `zz_flush'
xjwlibu.f .text+0x35e9): undefined reference to `zz_flush'
xjwlibu.o: In function `markit1':
xjwlibu.f .text+0x3a24): undefined reference to `xx_drawline'
xjwlibu.f .text+0x3a7c): undefined reference to `xx_drawline'
xjwlibu.o: In function `markit2':
xjwlibu.f .text+0x3cef): undefined reference to `xx_drawline'
xjwlibu.f .text+0x3d27): undefined reference to `xx_drawline'
xjwlibu.f .text+0x3d7d): undefined reference to `xx_drawline'
xjwlibu.o:xjwlibu.f .text+0x3db5): more undefined references to `xx_drawline' follow
xjwlibc.o: In function `xx_eventman_':
xjwlibc.c .text+0x1e1): undefined reference to `nucur_'
xjwlibc.c .text+0x2a1): undefined reference to `cussman_'
xjwlibc.c .text+0x31c): undefined reference to `cussman_'
xjwlibc.o: In function `xx_defcol_':
xjwlibc.c:(.text+0x435): undefined reference to `colrset_'
xjwlibc.c:(.text+0x521): undefined reference to `messlog_'
xjwlibc.o: In function `xx_winman__':
xjwlibc.c:(.text+0xed3): undefined reference to `draw_axis__'
xjwlibc.c:(.text+0x1119): undefined reference to `messlog_'
xjwlibc.c:(.text+0x1132): undefined reference to `messlog_'
collect2: ld returned 1 exit status
make: *** [lifetime] Error 1
[chamoli@ChamoliPC test_xps]$

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

I am unable to resolve this problem. Few important points to note here are :
1. I do not have /usr/X11R6 directory in my system with Fedora14
2. All the sub-programs when compiled individually with gfortran, gave no error and compiled nicely.

So please suggest me how to compile my program nicely ?
Any help is more than welcome.

Thanks.
cylab123

Last edited by pludi; 03-07-2011 at 07:47 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Configure: error: X Window system libraries and header files are required

I am trying to compile thunar 1.8.4. It is giving me this error. configure: error: X Window system libraries and header files are required Ubuntu Mate 18.04 (2 Replies)
Discussion started by: drew77
2 Replies

2. AIX

Connecting system to Virtual HMC

Hi, I just successfully build a Virtual Machine in virtual box with Perfectly running HMC v7. I have a IBM eServer pSeries Model 630 Model 6C4 (Power 4) i.e. 7024-6C4. I am not able to have it connect to the HMC console on the Virtual Box. Can anyone help me on how to connect it to the... (8 Replies)
Discussion started by: uzair_rock
8 Replies

3. Programming

Compilation problem with gfortran

Hello everyone, I'm trying since a few days to compile a f90 program with gfortran (on Ubuntu) with a makefile. The fortran program calls 2 routines written in C. Here is my makefile: FC = gfortran SFC = gfortran FFLAGS = -ffree-form -O... (21 Replies)
Discussion started by: leroygr
21 Replies

4. Programming

Gfortran compiler options.

I am a INTEL fortran user recently migrated to linux and installed gfortran on my system. I run numerical models as part of my research. my question is on optimization of the fortran code. I used the - vectorize option to compile for reducing the run time considerably and was happy. But... (1 Reply)
Discussion started by: schamarthi1
1 Replies

5. Programming

f77 program on gfortran

Hi, I am trying to run a simple f77 program on gfortran. Program is as follows. program trial implicit real*8 (a-h,o-z) common/var/a(2),b,c(4),d a=(/0,0/) b=0 c=(/0,0,0,0/) d=0 call add(a,b,c,d) ... (1 Reply)
Discussion started by: anshulfy
1 Replies

6. Programming

Fortran 77 and gfortran

Hi! I have a program in fortran77. This program was compiled with pgf90, but now, I need compiled it with gfortran. I show a bit of code. program hello PARAMETER(a=100) integer a write(*,*)'value ', a end program hello What's the problem? Thanks (2 Replies)
Discussion started by: kekaes
2 Replies

7. Solaris

System Libraries used by makefile

Dear All I am looking for all the system libraries that are accessed by my application Build script i.e. make which in turn will processes makefile. Is there any specific command from which i can find all the system libraries used by my build script. Cheers, Ankur (1 Reply)
Discussion started by: sharmaankur85
1 Replies

8. Shell Programming and Scripting

translation of ' in system () or connecting strings

Hello, I have a problem with the translation of the following command. In Shell the radiance-command work like that: gensurf seitenwand rollerblind1 '-0.95*s' '0.046' '2.85-'$1'*t' 1 1 But I don't know how to deal with this command in system(). I tried this: ... (2 Replies)
Discussion started by: ergy1983
2 Replies

9. Shell Programming and Scripting

ssh script for connecting unix system.

Hi All, I've a log file call netbackup.log in all the 5 servers in location usr/netbackup.log. I dont want to login in each server and check the log file. So i wanted to have a script written to have the log information at one place. I want to have the last 2 lines from the file... (2 Replies)
Discussion started by: suri.tyson
2 Replies

10. Programming

system calls vs libraries

Hi a :D ll, I would like to know the differrences between sytem calls and libraries. (3 Replies)
Discussion started by: vijaya2006
3 Replies
Login or Register to Ask a Question