Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
13 Views

How to exclude library when compile application with 10.1.025

Hi.
I compiled application with 10.1.025, but I don't known how to exclude library or library's link what I don't need to compile into the application. Which flag I can add?

For example, I want to exclude the /lib64/libpthread.so.0 library, How to do?
Please help me. Thanks.


King Regards.
wowfans.
0 Kudos
3 Replies
Highlighted
Black Belt
13 Views

You could have the compiler pass any arguments you wish into the linker script by -Wl, in case that is part of your question. Most of your options would be described in the binutils manual (easily found by your search engine).
The default library search path is inherited from your gcc specs file; obviously, we can't support tinkering with it.
In the case of libpthread, you could avoid searching it simply by not setting options which require it, or renaming it if your purpose is to use one which comes later on your search path.
0 Kudos
Highlighted
Beginner
13 Views

Quoting - wowfans
For example, I want to exclude the /lib64/libpthread.so.0 library, How to do?
Hi, Tim.
May I use --exclude-libs=lpthread? The version is ICC 10.1.025_intel64.
0 Kudos
Highlighted
Black Belt
13 Views

That would be -Wl,'--exclude-libs ...' if passed through icc. As the documentation says this applies to .a libraries, you would have to find out if .so libraries are affected. If you are searching lpthread, it's because you have included it yourself, or specified an option which includes it. For icc, the options which imply -lpthread are -parallel and -openmp. For icc 10.1, either of those options adds -lguide -lpthread in the link script, as you are asking icc to generate OpenMP code. icc 10.1 also offers the gnu compatible replacement for -lguide (-liomp5). All of the libguide and libiomp libraries require libpthread, possibly even the "sequential" stub libraries.
0 Kudos