Skip to content

Conversation

@maxpietsch
Copy link
Member

No description provided.


echo - collating dependent system libraries...
LIBS=$(for n in release/bin/*; do ldd $n; done | sed 's/(.*)$//g' | sed 's/^.*=>//g' | sort | uniq | grep -v 'mrtrix\|vdso\|libGL.so\|libEGL.so\|nvidia\|fglrx' | xargs)
LIBS=$(for n in bin/*; do ldd $n; done | sed 's/(.*)$//g' | sed 's/^.*=>//g' | sort | uniq | grep -v 'mrtrix\|vdso\|libGL.so\|libEGL.so\|nvidia\|fglrx' | xargs)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this line. Not exactly intuitive...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣 agreed...

What it does is list all dynamic dependencies (libraries) used by our executables (ldd), makes sure they're only listed once (sort | uniq), and strips out libraries that we shouldn't just blindly add (mostly all OpenGL/graphics-related libraries).

Not sure it would still work anyway since bin/ now also contains scripts. Not sure whether ldd would produce output that might interfere in this case...

Copy link
Member Author

@maxpietsch maxpietsch May 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For scripts, ldd produces the output "not a dynamic executable" which triggers the warning "not all executables have dynamic libraries. Possibly skipping dependent libraries for some commands. This is expected if you built with -static"

I'd just get rid of the warning. Alternatively, we could use file to filter out scripts and non-dynamically linked binaries:

file bin/* | awk -F: '/dynamically linked/ {print $1}' | xargs -d'\n' -r echo -u

@maxpietsch maxpietsch merged commit 0a2beb5 into master May 11, 2017
@maxpietsch maxpietsch deleted the package_standalone_update branch May 11, 2017 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants