Fedora Linux Support Community & Resources Center
  #1  
Old 6th March 2012, 05:52 AM
marlh Offline
Registered User
 
Join Date: Aug 2010
Posts: 3
linuxfirefox
Question error make g77

Dear all !
when i make file, report of fedora:

gcc sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o -lgfortran /usr/lib/cernlib/2006-g77/lib/libpacklib.so.1.2006 /usr/lib/cernlib/2006-g77/lib/libkernlib.so.1.2006 /usr/lib/cernlib/2006-g77/lib/libmathlib.so.2.2006 -lnsl -lcrypt -ldl -o sorter_GR
/usr/bin/ld: sorter_user.o: undefined reference to symbol 'atan@@GLIBC_2.0'
/usr/bin/ld: note: 'atan@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
/lib/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [sorter_GR] Error 1

I don't know why? I installed all packlib for g77. Can you help me, how to solve it?
Reply With Quote
  #2  
Old 6th March 2012, 09:19 AM
leigh123linux
Guest
 
Posts: n/a
linuxfirefox
Re: error make g77

Quote:
Originally Posted by marlh View Post
Dear all !
when i make file, report of fedora:

gcc sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o -lgfortran /usr/lib/cernlib/2006-g77/lib/libpacklib.so.1.2006 /usr/lib/cernlib/2006-g77/lib/libkernlib.so.1.2006 /usr/lib/cernlib/2006-g77/lib/libmathlib.so.2.2006 -lnsl -lcrypt -ldl -o sorter_GR
/usr/bin/ld: sorter_user.o: undefined reference to symbol 'atan@@GLIBC_2.0'
/usr/bin/ld: note: 'atan@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
/lib/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [sorter_GR] Error 1

I don't know why? I installed all packlib for g77. Can you help me, how to solve it?
add -lm to the linker command, without the source code this is all the help I can offer.
Reply With Quote
  #3  
Old 6th March 2012, 09:54 AM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,837
linuxfirefox
Re: error make g77

Post the following diagnostic info too

uname -rm
POSIXLY_CORRECT=foo file /lib/libm.so.6
file sorter_GR.o
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #4  
Old 7th March 2012, 05:47 AM
marlh Offline
Registered User
 
Join Date: Aug 2010
Posts: 3
linuxfirefox
Re: error make g77

Quote:
Originally Posted by leigh123linux View Post
add -lm to the linker command, without the source code this is all the help I can offer.
I try but still incorrect. This is my make file:

CC = g77
CFLAGS = -O2
CERNFLAGS = -Df2cFortran -I/usr/bin/cfortran

mathlib = -lm
cernlib = /usr/lib/cernlib/2006-g77/lib/libpacklib.so.1.2006 /usr/lib/cernlib/2006-g77/lib/libkernlib.so.1.2006 /usr/lib/cernlib/2006-g77/lib/libmathlib.so.2.2006 -lnsl -lcrypt -ldl


LIBRARIES = ${mathlib}

#----- LINK ---->
sorter_GR : sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o
gcc sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o -lgfortran $(cernlib) -o sorter_GR
# g77 sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o $(cernlib) -o sorter_GR
# g77 sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o `cernlib packlib, mathlib` -o sorter_GR
# $(CC) sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o `cernlib packlib, mathlib` -o sorter_GR

#----- OBJECTS ---->
sorter_GR.o : sorter_GR.c
$(CC) $(CFLAGS) $(CERNFLAGS) -c sorter_GR.c
sorter_util.o : sorter_util.c
$(CC) $(CFLAGS) -c sorter_util.c
sorter_init.o : sorter_init.c
$(CC) $(CFLAGS) -c sorter_init.c
sorter_hb.o : sorter_hb.c
$(CC) $(CFLAGS) $(CERNFLAGS) -c sorter_hb.c
sorter_user.o : sorter_user.c
$(CC) $(CFLAGS) $(CERNFLAGS) -c sorter_user.c
sorter_read.o : sorter_read.c
$(CC) $(CFLAGS) $(CERNFLAGS) -c sorter_read.c

#----- CLEANING ---->
clean:
rm -f *.o core.*


what's wrong?

---------- Post added at 09:47 PM ---------- Previous post was at 09:41 PM ----------

Quote:
Originally Posted by stevea View Post
Post the following diagnostic info too

uname -rm
POSIXLY_CORRECT=foo file /lib/libm.so.6
file sorter_GR.o
i don't understand ? could you tell it more?
Reply With Quote
  #5  
Old 7th March 2012, 10:17 AM
leigh123linux
Guest
 
Posts: n/a
linuxfirefox
Re: error make g77

I think add -lm to this line should fix it

change this

Code:
cernlib =  /usr/lib/cernlib/2006-g77/lib/libpacklib.so.1.2006  /usr/lib/cernlib/2006-g77/lib/libkernlib.so.1.2006  /usr/lib/cernlib/2006-g77/lib/libmathlib.so.2.2006 -lnsl -lcrypt -ldl

to

Code:
cernlib =  /usr/lib/cernlib/2006-g77/lib/libpacklib.so.1.2006  /usr/lib/cernlib/2006-g77/lib/libkernlib.so.1.2006  /usr/lib/cernlib/2006-g77/lib/libmathlib.so.2.2006 -lnsl -lcrypt -ldl -lm
Reply With Quote
  #6  
Old 7th March 2012, 12:32 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,771
linuxfirefox
Re: error make g77

Quote:
Originally Posted by marlh View Post
[...]
mathlib = -lm
[...]
LIBRARIES = ${mathlib}
[...]
... But you don't use either $(mathlib) or $(LIBRARIES) anywhere else in the Makefile, so the "-lm" link flag is never used.

I'd add it too the GCC linker line:

Code:
#----- LINK ---->
sorter_GR : sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o
         gcc $(mathlib) sorter_GR.o sorter_util.o sorter_init.o sorter_hb.o sorter_user.o sorter_read.o -lgfortran $(cernlib) -o sorter_GR
Gareth
Reply With Quote
  #7  
Old 17th April 2012, 03:37 AM
marlh Offline
Registered User
 
Join Date: Aug 2010
Posts: 3
linuxchrome
Re: error make g77

Thank Gareth Jones, leigh123linux!
I try it and make ok!
Reply With Quote
Reply

Tags
error, g77, make

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: "make: *** No rule to make target `folder'. Stop. " shri19 Using Fedora 5 23rd May 2009 11:11 PM
error while installing an app using make , make install kettaneh Using Fedora 12 18th July 2008 11:39 AM
VDR FC3 make error :( cRuNcHiE Using Fedora 0 15th November 2004 02:52 PM
2.6.9 make error Shadow Skill Fedora Core 3 Test Releases 3 22nd October 2004 12:00 AM


Current GMT-time: 10:07 (Sunday, 21-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat