LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2013, 04:57 PM   #1
auclark
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Rep: Reputation: Disabled
replacement for "lorder" when creating library


Hi;

I am trying to compile an ancient f77 code using the following makefile (which i did not make myself):

../../Bin/libcomutil.a : comutil.src
sed s/CAIX/\ \ \ \ /g comutil.src | sed s/CI32/\ \ \ \ /g | sed s/C2GB/\ \ \ \ /g | sed s/CRS6/\ \ \ \ /g > comutil.aix
../fsplit comutil.aix > comutil.ddd
cat comutil.ddd | xargs pgf77
cat comutil.ddd | xargs /bin/rm
/bin/rm comutil.aix
sed 's/\.f/.o/g' comutil.ddd | sort > comutil.aix
cat comutil.aix | xargs ar lorder | tsort | xargs ar r ../../Bin/libcomutil.a
ranlib ../../Bin/libcomutil.a
cat comutil.aix | xargs /bin/rm
/bin/rm comutil.aix comutil.ddd

my compilation fails at:

cat comutil.aix | xargs ar lorder | tsort | xargs ar r ../../Bin/libcomutil.a

because i do not have the lorder utility installed on my rocks6.1 cluster. I have looked for this utility in the rpm databases, but been unable to find it. So, i looked online and found one site that says that "lorder" can be replaced with "ar -ts", looking at the man pages for "ar" i don't think this will do the same thing as "lorder". Further, if i do try to replace "lorder" with "ar -ts", then that line of script does not recognize the file format of my .o files, and i get the error:

ar: abt.o: File format not recognized

I tried to force "ar" to recognize all file formats by using "ar -X23_64 -ts" but this does not follow the approved arguments for "ar".

This is an odd one for me as I have never encountered "lorder" before and suspect that this may have to do with the machinetype that this code was last compiled on (HP or IBM, i think).

I have been searching all day on this and any help someone else may offer would be greatly appreciated.

Aurora
 
Old 03-19-2013, 06:46 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
It is ancient - lorder was to do a topological sort of an archive to put things in "linking order" so that the linker could do a single pass through the library. I think the "lorder" was an option to ar, rather than a separate utility. The way it worked has ar read the object file, then output the external symbols with file name - then the tsort would sort that list and output a list of file names... lastly, the "ar -r" would then put each object file into the library, in the order determined by the topological sort.

I believe you can drop most of that command - replace it with

Code:
cat comutil.aix | xargs ar r ../../Bin/libcomutil.a
This should create the library (libcomutil.a), but without the sorting. ld makes multiple passes (if needed) so doing a topological sort shouldn't be necessary. It does slow the link down a bit, but other than that, there should be no other side effects.
 
Old 03-20-2013, 12:01 AM   #3
auclark
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks j - that makes more sense.

The way i originally figured out what was going on was to execute each line of the makefile individually -because if you try to just use make then you get a completely uninformative "make: *** [../../Bin/libcomutil.a] Error 123". So I get the same error 123 when i make the replacement you suggest, and when i execute it line by line i get the following:

xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
ar: C: No such file or directory

which looks like a scripting error because i am trying to run it interactively and it wants quotes to encase the arguement to ar or cat maybe?

Cheers;
A
 
Old 03-20-2013, 07:12 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
That sounds like an odd file name in the file "comutil.aix". Something with an unusual character. Maybe a quote character got in there somewhere.

Or maybe a blank line.

Hard to tell without seeing the file.

Last edited by jpollard; 03-20-2013 at 07:22 AM.
 
  


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
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 02:36 AM
Need solution to "failed to fork PTY" and "error creating the child process" problems Gnusboy Linux - Newbie 4 01-02-2010 08:54 AM
Creating "sub-projects" and multiple "targets" like in KDevelop ... obaidmushtaq Linux - Software 4 09-18-2009 01:10 AM
conversion of dynamic ".so" library to ststic ".a" library aashaysood Linux - Hardware 2 07-03-2006 12:15 AM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 03:32 PM


All times are GMT -5. The time now is 10:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration