Find programs that are missing libraries.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find programs that are missing libraries.
# 1  
Old 05-19-2009
MySQL Find programs that are missing libraries.

I had to whip this up, and it seems useful enough to post here. Say you have been cleaning up your filesystem, and you removed a bunch of libraries, or you shuffled around some library directories, and aren't sure if ld.so.conf is correctly setup. You want to sweep through your file system looking for executables that cannot run because their libraries are now missing. Here's a really simple script to do just that:

Code:
find / -type f -exec file "{}" ";" | 
    awk '/dynamically linked/ { print $1 }' |
    sed 's/:$//' | 
    xargs ldd | 
    awk 'NF==1 {file=$1} /not found/ { print file, $1 }'

You might want to direct output to "tee" or perhaps just a file.

I only work with Linux these days. If you work with another OS and this script needs a tweak to work on it, please post a follow-up.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Yum install ClamAV missing libraries

Hello, I'm currently following a tutorial for ClamAV with a lambda function. The tutorial has a shell script with the following: #!/usr/bin/env bash set -e LAMBDA_FILE="lambda.zip" rm -f ${LAMBDA_FILE} mkdir -p clamav echo "-- Downloading AmazonLinux container --" docker pull... (1 Reply)
Discussion started by: ottorocket18
1 Replies

2. Solaris

Solaris: ldd doesn't find libraries in exported environment variable LD_LIBRARY_PATH

I have given the relevant details below. Why are the libraries in /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r are invisible to ldd? %setenv ... (3 Replies)
Discussion started by: old_as_a_fossil
3 Replies

3. Shell Programming and Scripting

find: missing argument to `-exec' while redirecting using find in perl

Hi Friends, Please help me to sort out this problem, I am running this in centos o/s and whenever I run this script I am getting "find: missing argument to `-exec' " but when I run the same code in the command line I didn't find any problem. I am using perl script to run this ... (2 Replies)
Discussion started by: ramkumarselvam
2 Replies

4. UNIX for Advanced & Expert Users

Shared hosting, how to install programs and libraries in your home folder

Hi all I hope I am posting in the right section. If not please excuse me and redirect me to the right section. Here is my problem: I am using a shared hosting plan at Godady. I have shell access and of course my own folder. I would like to be able to install programs in my own folder... (4 Replies)
Discussion started by: PiniFarini
4 Replies

5. UNIX for Dummies Questions & Answers

Are programs like sys_open( ) ,sys_read( ) et al examples of system level programs ?

Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies

6. HP-UX

Adode reader does not work - libraries are missing - where to get them?

Hi. I use HP-UX 11.23. After installation of adobe reader I've got the following error: /usr/lib/dld.sl: Can't open shared library: /user/unibat/hppahpux/gtk/usr/local/lib/libgdk_pixbuf_xlib-2.0.sl /usr/lib/dld.sl: No such file or directory The first library exists (dld.sl). Where could I... (4 Replies)
Discussion started by: netwalker
4 Replies

7. Solaris

where can I find programs for solaris?

I'm running Sun OS 5.9 and I need to find a place that has a precompiled version of the make command (I have no way of compiling software) and I would like to find a decent software repository, binaries are preferred but well maintained and easy to assemble (isn't lacking half a dozen dependencies... (7 Replies)
Discussion started by: tech53
7 Replies

8. Filesystems, Disks and Memory

How to find Dependent libraries in ELF file?

Dear group, I need to load dependent libraries for an application which is in ELF format.please let me know how to parse the ELF file to find dependent libraries. thnaks in advance, Ravinder (3 Replies)
Discussion started by: ravinder.are
3 Replies

9. Programming

makefile for programs using libraries loaded at runtime

Hi everybody! I would like to set in the makefile a path that should be the path where the program searches for the libraries loaded at run time. Is there such a variable to be set in makefile? Thanks in advance! (1 Reply)
Discussion started by: nadiamihu
1 Replies

10. Programming

libraries missing in C

some libraries are missing like conio.h and syslib.h how can i have them installed ? (4 Replies)
Discussion started by: C|[anti-trust]
4 Replies
Login or Register to Ask a Question
h5cc(1) 						      General Commands Manual							   h5cc(1)

NAME
h5cc - Helper script to compile HDF5 applications. SYNOPSIS
h5cc [OPTIONS] <compile line> DESCRIPTION
h5cc can be used in much the same way MPIch is used to compile an HDF5 program. It takes care of specifying where the HDF5 header files and libraries are on the command line. h5cc supercedes all other compiler scripts in that if you've used them to compile the HDF5 library, then h5cc also uses those scripts. For example, when compiling an MPIch program, you use the mpicc script. If you've built HDF5 using MPIch, then h5cc uses the MPIch program for compilation. Some programs use HDF5 in only a few modules. It isn't necessary to use h5cc to compile those modules which don't use HDF5. In fact, since h5cc is only a convenience script, you are still able to compile HDF5 modules in the normal way. In that case, you will have to specify the HDF5 libraries and include paths yourself. An example of how to use h5cc to compile the program hdf_prog, which consists of modules prog1.c and prog2.c and uses the HDF5 shared library, would be as follows: # h5cc -c prog1.c # h5cc -c prog2.c # h5cc -shlib -o hdf_prog prog1.o prog2.o OPTIONS
-help Prints a help message. -echo Show all the shell commands executed. -prefix=DIR Use the directory DIR to find the HDF5 lib/ and include/ subdirectories. Default: prefix specified when configuring HDF5. -show Show the commands without executing them. -shlib Compile using shared HDF5 libraries. -noshlib Compile using static HDF5 libraries [default]. <compile line> The normal compile line options for your compiler. h5cc uses the same compiler you used to compile HDF5. Check your compiler's man- ual for more information on which options are needed. ENVIRONMENT
HDF5_CC Use a different C compiler. HDF5_CLINKER Use a different linker. HDF5_USE_SHLIB=[yes|no] Use shared version of the HDF5 library [default: no]. SEE ALSO
h5fc(1), h5c++(1) h5cc(1)