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

Linking without Intel libraries

errorcode
Beginner
446 Views

I would like to know how to create a program using ICC v11 without using any of the Intel libraries, just the GCC libraries. Let's say my program has a shared library called mylib.so and an executable called myprog.

I create mylib.so with -share -share-libgcc -Wl,-Bsymbolic, but ldd mylib.so keeps showing libimf.so, libintlc.so, and libslvm.so as dependendies. However, when I rename /opt/intel/Compiler/11.0/074/lib to lib.old and regenerate mylib.so, then ldd no longer shows the Intel libraries as dependencies.

Do I have to specify some other flags to tell it not to use Intel libraries without renaming the lib directory?

Thanks,
QN

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
446 Views

Generally you have an environment variable indicating the paths to the libraries. Edit/set this environment variable to exclude the path to the Intel library. If you need some of the Intel libraries but not one specific library, then you may need to specify the full library path to those intel library files. (I am assuming you are using a MAKE file)

JD
0 Kudos
dpeterc
Beginner
446 Views
You can use
-static-intel
What I dislike about Intel's extra libraries is:
I do not know what triggers inclusion of certian library. And this also keeps changing from release to release.
For example, the 11.0 version of compier wants to link libsvml.so with my code. Why? Who knows.
I would like to be able to have finer granulation of intel library linking. Say - statically link this one, but use dynamic lining on another one. Why? There are 25 MB of dynamic libraries in the intel compiler directory.
I my be prepared to bundle a 200K dll in my binary distribution, but really hate those 2MB ones.

0 Kudos
TimP
Honored Contributor III
446 Views

SVML normally is invoked by auto-vectorization of math functions.-fp-model options other than -fast disable most automatic svml calls. You could check whether the announced 11.0 option -no-fast-transcendentals is actually present, which would remove svml, independent of other options. It's true, each release introduces more opportunities for vector math functions.
Generally, you could give the full path name of a static library explicitly in your link command (in the proper position). Turning on the -# diagnostics may help in getting this straight; it's just a standard gnu linker script generation. You may have noticed that 11.0 has a separate option to select static or dynamic OpenMP run-time library.
0 Kudos
errorcode
Beginner
446 Views
Quoting - tim18

SVML normally is invoked by auto-vectorization of math functions.-fp-model options other than -fast disable most automatic svml calls. You could check whether the announced 11.0 option -no-fast-transcendentals is actually present, which would remove svml, independent of other options. It's true, each release introduces more opportunities for vector math functions.
Generally, you could give the full path name of a static library explicitly in your link command (in the proper position). Turning on the -# diagnostics may help in getting this straight; it's just a standard gnu linker script generation. You may have noticed that 11.0 has a separate option to select static or dynamic OpenMP run-time library.

I ended up using -no-vec to disable vectorization.
0 Kudos
Reply