Figure out the minimum os version neede to run executable or link library.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Figure out the minimum os version neede to run executable or link library.
# 1  
Old 12-19-2011
Figure out the minimum os version neede to run executable or link library.

Hello,
I need to figure out the minimum OS version needed to run some executable.
For the following OS: Linux, AIX, Solaris. For example how do I know the minimum OS version for /bin/ls ? "file" command does not give me much information. There are some tools that are helpful for understanding is the code 32 bit, or 64 bit, but they do not return the minimum OS requirements.

Thank you in advance.
# 2  
Old 12-19-2011
This is a really odd question -- /bin/ls should work with the distribution it came with.
Pretty much anything in /usr, /sbin/, and /opt will work that way.

Code:
ldd /bin/ls

is about the best you can get. For solaris read isainfo man page, Linux try /etc/release, AIX I dunno. Solaris is very good about running older versions of code. However in all OS cases the limiting factor is almost always the current runtime libraries.

What EXACTLY are you trying to do ?? If it isn't simple curiosity, then you are asking for some trouble down the road.
# 3  
Old 12-19-2011
what version of the kernel, you mean?

That's often not too relevant. The same kernel can run lots of different software. What's more important are the libraries it uses.
Code:
$ ldd /bin/ls
        linux-gate.so.1 =>  (0xb77bf000)
        librt.so.1 => /lib/librt.so.1 (0xb77ab000)
        libacl.so.1 => /lib/libacl.so.1 (0xb77a3000)
        libc.so.6 => /lib/libc.so.6 (0xb765a000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7641000)
        /lib/ld-linux.so.2 (0xb77c0000)
        libattr.so.1 => /lib/libattr.so.1 (0xb763a000)
$

# 4  
Old 12-19-2011
Quote:
Originally Posted by jim mcnamara
This is a really odd question -- /bin/ls should work with the distribution it came with.
Pretty much anything in /usr, /sbin/, and /opt will work that way.

Code:
ldd /bin/ls

is about the best you can get. For solaris read isainfo man page, Linux try /etc/release, AIX I dunno. Solaris is very good about running older versions of code. However in all OS cases the limiting factor is almost always the current runtime libraries.

What EXACTLY are you trying to do ?? If it isn't simple curiosity, then you are asking for some trouble down the road.

Hello and tank you for the fast replay,

Here is some additional information on what I'm trying to do.
I'm trying to achieve the following goal: Automatically name the zip file containing binaries, and libraries compiled on the machines having the above OSes.
The name of the zip file containing the program named prog and it's libraies must be like in the example bellow:
prog-AIX_5.3-RISC.zip
prog-SunOS_5.10-x86_64.zip
prog-SunOS_5.8-SPARC.zip
prog-Linux_2.6.38-x86_64.zip
and so on ...
This is to avoid executing AIX 5.3 executable on AIX 5.2 for example. There are some cases in which the executables are not backward compatible.
I'm trying to avoid this.

For Linux "file" command returns the minimum Linux Kernel that was used during the compilation process.

For the other OSes I can get some information. What I'm not able to do directly is to predict what is the minimum OS version (or kernel version) needed to execute the code. For AIX there is dump command , but it is not much of a help. ldd does not help either. I was wondering how the OS itself decides is this good program (instruction set) to execute.

Hope the question is more clear now.
# 5  
Old 12-19-2011
Quote:
Originally Posted by +Yan
Hello and tank you for the fast replay,

Here is some additional information on what I'm trying to do.
I'm trying to achieve the following goal: Automatically name the zip file containing binaries, and libraries compiled on the machines having the above OSes.
Why would you use a zip file to hold UNIX executable files? Permissions may not be preserved properly, which could play havoc. Tarballs are better suited.

Quote:
For Linux "file" command returns the minimum Linux Kernel that was used during the compilation process.
This really isn't relevant. You can often run x86 binaries from 1992 on a modern Linux system if you have old enough libraries, or the new libraries are compatible. The way many basic system calls work hasn't changed much since Linux's inception. The libraries are what's really important.

Use packages that were actually distributed for these various operating systems instead of keeping your own tarballs of randomly packaged binaries, and you'll have programs that're supposed to work and know exactly what their dependencies are.

Last edited by Corona688; 12-19-2011 at 02:19 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies

2. UNIX for Advanced & Expert Users

Xserver shared library link is gone

I am administering an Xserver v10.6.8 and I updated the ports using Macports self update. I received this error when calling the program R dyld: Library not loaded: /opt/local/lib/libicuuc.48.dylib Referenced from: /opt/local/lib/R/lib/x86_64/libR.dylib Reason: image not found Trace/BPT... (2 Replies)
Discussion started by: godzilla07
2 Replies

3. Programming

g++ fails to link to static library when compilation and link in single command

Hello All, I've encountered a strange behaviour from g++ that doesn't make sense to me. Maybe you can shed some light on it: I have a bunch of source files and want to compile them and link them with a static library liba.a located in /usr/local/lib64 into an executable Approach 1 works... (0 Replies)
Discussion started by: magelord
0 Replies

4. Shell Programming and Scripting

[SHELL] Executable? Run it!

I would like to make a script that I can see if the file is executable. If it is executable then it needs to run. Otherwise, if it is not executable the file needs to be edited, and run agian. I hope you understand what i mean. :) Thanks for the netherlands (4 Replies)
Discussion started by: dennisbest85
4 Replies

5. Linux

Size of the Library/Executable is high in LINUX

HI All, We have a 32bit Gui application created using C++. We ported the application from Solaris to Linux. Issue we are facing is the size of the library and executable is very large in LINUX compared to Solaris. Red Hat Enterprise Linux 5.4 is the Linux version we using. Please... (0 Replies)
Discussion started by: sanushchacko
0 Replies

6. Shell Programming and Scripting

symbolic link to an executable file

I have a script within my home folder and want to be able to execute it without using the sh command. I know that if it was in ~/bin and executable I could do it just by typing the file name, but would rather keep it in the current file structure I tried creating a soft link in ~/bin,... (5 Replies)
Discussion started by: Jaloopa
5 Replies

7. Solaris

Executable takes indefinite time to search for shared library

Hi, I have an executable that takes indefinitely long time to search for the libsendfile.so in particular solaris machines only. The library is actually in the /lib folder. Where as it works fine on few of the machines, it takes long time in few others. I have checked crle options. Its... (1 Reply)
Discussion started by: kk2202
1 Replies

8. UNIX for Dummies Questions & Answers

Cannot run UNIX executable !

I have installed the Darwin Calendar Server on my Mac and got it working. To start the server I open a Finder window on my mac and click the UNIX executable called RUN. In order to start the server automatically on bootup I used LINGON to add a startup Daemon to call "RUN -d". When I reboot... (6 Replies)
Discussion started by: thylacine
6 Replies

9. Programming

Link against a particular version of libstdc++

Our development machines have libstdc++.so.5 and libstdc++.so.6. When we build our native code, it uses libstdc++.so.6. Is there anyway I can force it to use libstdc++.so.5 instead ? $ ldd try /usr/lib/libcwait.so (0x00655000) libstdc++.so.6 => /usr/lib/libstdc++.so.6... (5 Replies)
Discussion started by: vino
5 Replies

10. Programming

use gcc and link with a library

Hello, J have a problem when I use gcc: This comand works: gcc -shared -fpic -I/usr/include/sys -I/usr/include -L/usr/lib/librt.sl essai1.c mylib.sl but gcc I/usr/include/sys -I/usr/include -L/usr/lib/librt.sl essai2.c -o essai don't work. The first command creates a dynamique... (1 Reply)
Discussion started by: AUBERT
1 Replies
Login or Register to Ask a Question