LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-29-2008, 03:25 AM   #1
stioanid
Member
 
Registered: Dec 2008
Location: Athens
Distribution: Centos Ubundu RedHat
Posts: 38

Rep: Reputation: 15
library reference problem


I am trying to exact mirror a server running Centos 4.4 that runs some Fortran scripts in order to do some calculations into a server with Centos 4.7.

My problem is that the Fortran scripts give me all kind of errors and I am totally useless when it comes to programing.
W
 
Old 12-29-2008, 03:36 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
What do you mean for Fortran scripts? Are they Fortran codes that have to be re-compiled again or are they shell wrappers that run already compiled Fortran programs? In both cases, you have to re-compile the Fortran code, since doubtfully the executable can work on different machines, unless you have the exact same CPU.
 
Old 12-29-2008, 09:29 AM   #3
stioanid
Member
 
Registered: Dec 2008
Location: Athens
Distribution: Centos Ubundu RedHat
Posts: 38

Original Poster
Rep: Reputation: 15
fortran

Quote:
Originally Posted by colucix View Post
What do you mean for Fortran scripts? Are they Fortran codes that have to be re-compiled again or are they shell wrappers that run already compiled Fortran programs? In both cases, you have to re-compile the Fortran code, since doubtfully the executable can work on different machines, unless you have the exact same CPU.
I think I need to recompile them for my machine. The machines are different so are the versions of gcc I have installed.
By the way I don't have a clue what I need to do to recompile them.
I don't even know how I can see the actual code.
I will display some of the commands I runned maybe they will be a bit more helpfull.

When I run one of the scripts I get the following.

./wgrib2 -vt -d 1 gfs.t12z.master.grbf12 >out_time

*** FATAL ERROR: grib message #1 not found ***

When I try to debug the script i get the following

g++ wgrib2
wgrib2(.data+0x4): In function `__data_start':
: multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtbegin.o(.data+0x0): first defined here
wgrib2(.init+0x0): In function `_init':
/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crti.S:35: multiple definition of `_init'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o(.init+0x0): first defined here
wgrib2(.text+0x0): In function `_start':
../sysdeps/i386/elf/start.S:47: multiple definition of `_start'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.text+0x0): first defined here
wgrib2(.fini+0x0): In function `_fini':
/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crti.S:51: multiple definition of `_fini'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o(.fini+0x0): first defined here
wgrib2(*ABS*+0x808ce9c): In function `__init_array_start':
jpc_qmfb.c: multiple definition of `_GLOBAL_OFFSET_TABLE_'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.got.plt+0x0): first defined here
wgrib2(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.rodata+0x0): first defined here
wgrib2(.data+0x0): In function `__data_start':
: multiple definition of `__data_start'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.data+0x0): first defined here
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.dynamic+0x0): multiple definition of `_DYNAMIC'
/usr/bin/ld: warning: i386 architecture of input file `wgrib2' is incompatible with i386:x86-64 output
collect2: ld returned 1 exit status

As far as I can understand it seems like there is a problem with some of the libraries it uses?
Is there a way I can find out, against which libraries this script is compiled to?
I don't even know if this is what I am supposed to be looking for?

When i try to run some other script I get as well some error messages.

./script_correct_crain
list in: end of file
apparent state: unit 20 named fort.20
last format: list io
lately reading direct formatted external IO
./script_correct_crain: line 8: 26456 Aborted ./read_rain.e
mv: cannot stat `fort.22': No such file or directory
list in: end of file
apparent state: unit 20 named fort.20
last format: list io
lately reading direct formatted external IO
./script_correct_crain: line 13: 26460 Aborted ./read_rain.e
mv: cannot stat `fort.22': No such file or directory

When I run ./read_rain.e

list in: end of file
apparent state: unit 20 named fort.20
last format: list io
lately reading direct formatted external IO
Aborted

g++ read_rain.e
collect2: ld terminated with signal 11 [Segmentation fault]
read_rain.e(.init+0x0): In function `_init':
/build/buildd/glibc-2.3.6/build-tree/amd64-libc/csu/crti.S:25: multiple definition of `_init'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o(.init+0x0): first defined here
read_rain.e(.text+0x0): In function `_start':
../sysdeps/x86_64/elf/start.S:65: multiple definition of `_start'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.text+0x0): first defined here
read_rain.e(.fini+0x0): In function `_fini':
/build/buildd/glibc-2.3.6/build-tree/amd64-libc/csu/crti.S:37: multiple definition of `_fini'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o(.fini+0x0): first defined here
read_rain.e(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.rodata+0x0): first defined here
read_rain.e(.data+0x0): In function `__data_start':
: multiple definition of `__data_start'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o(.data+0x0): first defined here
 
Old 12-29-2008, 10:10 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Well, let's start from wgrib2. It should be the executable of a compiled C program. In respect of the wgrib version 1, wgrib2 uses external libraries. To see which libraries the wgrib2 executable depends on, use the ldd command:
Code:
ldd /path/to/wgrib2
this will tell you if some required shared object is missing. Anyway, you can always try to recompile it from the source (see the wgrib2 official site for details).

Regarding the other script/programs, it look like script_correct_crain is a shell script which runs the Fortran executable read_rain.e at some point. I think the only chance is to re-compile the source code, if still available. Anyway, use the file command to find out the type of executable:
Code:
file /path/to/read_rain.e
Moreover, looking at the message coming from the wgrib2 command, it looks like there is some problem with the machine architecture. Maybe is the original machine a 32-bit (i386) architecture and the new one a 64-bit (x86_64)?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shared Library error : undefined reference xs2harpreet Programming 6 03-11-2009 05:55 PM
C++ library reference guide tkm Linux - Software 4 04-25-2008 03:50 PM
Standard Template Library Reference (std::string) lucky6969b Programming 3 03-15-2006 03:09 PM
Linking own library: undefined reference to otosigo Programming 1 12-02-2004 08:05 AM
undefined reference to a function included in a library i made!!! keos Programming 5 02-21-2004 04:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:49 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