LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-22-2015, 07:54 AM   #1
mohammad taqy bayat
LQ Newbie
 
Registered: Aug 2014
Posts: 16

Rep: Reputation: Disabled
"/usr/bin/ld: errno: TLS definition in /lib/libc.so.6" in compiling a fortran file


hello.
Getting this error when compile my program on ubuntu 32bit desktop system. I assume that perhaps can be library problem. can any one tell me right answer.........

Problem is...........
Quote:
/usr/bin/ld: errno: TLS definition in /lib/i386-linux-gnu/libc.so.6 section .tbss mismatches non-TLS reference in /media/9C2C3AB22C3A8774/tez/Ahmadfiles/cern_mohammad/cern/pro/lib/libpacklib.a(remote.o)
/lib/i386-linux-gnu/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
makefile:
Quote:
C = .c
F = .f
O = .o
output = geant_elastic_135
paw2root = h2root
datadisk = /home/bayat/

.SUFFIXES: $(C) $(F)

SRCS = draw_i$(F) scint_geo$(F) mwpc_geo$(F) gutrev$(F) \
gukine$(F) gustep$(F) material$(F) carb_del_geo$(F)\
uginit$(F) uglast$(F) pipe$(F) function$(F) \
ugeom$(F) guout$(F) ntuple$(F) target$(F)\
pbal_geo$(F) gcalor_unix$(F) guphad$(F)\
guhadr$(F)

OBJS = draw_i$(O) scint_geo$(O) mwpc_geo$(O) gutrev$(O)\
gukine$(O) gustep$(O) material$(O) carb_del_geo$(O)\
uginit$(O) uglast$(O) pipe$(O) function$(O) \
ugeom$(O) guout$(O) ntuple$(O) target$(O) \
pbal_geo$(O) gcalor_unix$(O) guphad$(O)\
guhadr$(O)



CERNLIB = -L/media/9C2C3AB22C3A8774/tez/Ahmadfiles/cern_mohammad/cern/pro/lib
CERNOPT = -L/media/9C2C3AB22C3A8774/tez/Ahmadfiles/cern_mohammad/cern/pro/lib

CERNINCL = -I/media/9C2C3AB22C3A8774/tez/Ahmadfiles/cern_mohammad/cern/pro/include

LIBS = -L/usr/X11R6/lib

LINKLIB = -lgeant321 -lkernlib -lpawlib -lgraflib -lgrafX11 -lX11 -lm \
-lpacklib -lmathlib -lphtools -lg2c -lcrypt -ldl -lnsl -llapack3 \
-lblas


FORTOPT = -x f77-cpp-input -Wall

.c.o:
gcc -c $(CERNINCL) $<

.f.o:
g77 -Wall -c $(FORTOPT) $(CERNOPT) $(CERNINCL) $<



default: $(OBJS)
g77 -Wall main.f -o gbat.exe $(OBJS) $(CERNLIB) $(LIBS) \
$(LINKLIB) $(LINKLIB)

i :$(OBJS)
g77 -Wall gxint321.f -o gint.exe $(OBJS) $(CERNLIB) $(LIBS) \
$(LINKLIB) $(LINKLIB)

t:
$(paw2root) $(output).hbook $(output).root
ls -sh $(output).*
mv $(output).* $(datadisk)
@echo "$(output) transfered to $(datadisk)"

clean:
rm *.o *~ gbat.exe gint.exe
and here is the main.f :

Quote:
PROGRAM POLARIMETER
*
* Main program for polarimeter detector
*
* Declaration
IMPLICIT NONE
INTEGER NGBANK, NWPAWC, MAX_TIME
PARAMETER(NGBANK=60000000,NWPAWC=5000000, MAX_TIME=3000000)
REAL H(NGBANK), Q(NWPAWC)
REAL t
COMMON/GCBANK/H
COMMON/PAWC/Q
*
* Begining of the main program
CALL TIMEST(24.*3600.)
call timel(t)
print *,t
*
* initialize GEANT and HBOOK memory
CALL GZEBRA(NGBANK)
CALL HLIMIT(-NWPAWC)
*
* Open graphics system
* CALL HPLINT(0)
* CALL IGMETA(8,0)
* GEANT initialization
CALL UGINIT
* Event processing
CALL GRUN
* End of run
CALL UGLAST
END
Beforehand thanks.

Last edited by mohammad taqy bayat; 03-22-2015 at 07:58 AM.
 
Old 03-22-2015, 08:31 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
in remote.c change this:

Code:
old: extern int errno;
new: #include <errno.h>
Note: TLS means Thread Local Storage -- every thread has its own errno.
In errno.h errno is defined as:
Code:
#defined errno (*__errno_location ())

Last edited by NevemTeve; 03-22-2015 at 08:39 AM.
 
Old 03-22-2015, 09:28 AM   #3
mohammad taqy bayat
LQ Newbie
 
Registered: Aug 2014
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by NevemTeve View Post
in remote.c change this:

Code:
old: extern int errno;
new: #include <errno.h>
Note: TLS means Thread Local Storage -- every thread has its own errno.
In errno.h errno is defined as:
Code:
#defined errno (*__errno_location ())
thank you so much.
where can I find the remote.c ?
 
Old 03-22-2015, 10:20 AM   #4
mohammad taqy bayat
LQ Newbie
 
Registered: Aug 2014
Posts: 16

Original Poster
Rep: Reputation: Disabled
thank you so much.
where can I find the remote.c ?
 
Old 03-22-2015, 10:48 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
it is part of your cernlib
Code:
/media/9C2C3AB22C3A8774/tez/Ahmadfiles/cern_mohammad/cern/pro/lib/libpacklib.a(remote.o)
 
Old 03-23-2015, 12:02 AM   #6
mohammad taqy bayat
LQ Newbie
 
Registered: Aug 2014
Posts: 16

Original Poster
Rep: Reputation: Disabled
how do i access to remote.c from libpacklib.a?
 
Old 03-23-2015, 04:14 AM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
You have to get the source from Ahmad/Cern_Mohammad/whoever created this library.
 
  


Reply

Tags
fortran, makefile



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
"bash: /usr/bin/: /lib/ld-linux.so.2: bad ELF interpreter: No such file or direc LittleMaster Linux - Server 4 05-25-2013 03:42 AM
errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference johnpaulodonnell Programming 2 07-25-2008 04:37 AM
/usr/bin/ld: errno TLS def.. mismatches non-TLS def.. maverick_pol Fedora 1 07-27-2007 10:50 AM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:59 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
Open Source Consulting | Domain Registration