Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

How to exclude library when compile application with 10.1.025

wowfans
Beginner
460 Views
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
TimP
Honored Contributor III
460 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
wowfans
Beginner
460 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
TimP
Honored Contributor III
460 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
Reply