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

Linking faster

aurora
Beginner
455 Views
Hi,
I've searched some tips to make the Composer linking faster. Compiling is obviously influenced by optimizations, but I don't know what makes the compiler slower at linking time.
I have some dynamic linking times of 1 min, that it's too much if you are changing only 1 file at the each time.
Is that normal?
Thanks in advance!
0 Kudos
1 Solution
Hubert_H_Intel
Employee
455 Views

Just an addition for tests with disablingIPO (/Qipo-) to see if this helps. Please add also LINKER option /qnoipo (Configuration Properties > Linker > Optimization [Intel C++] > Interprocedural Optimization: No (/qnoipo). The compiler option alone does not always disable interprocedural optimization.

Let me know if this makes any difference.

Regards,
Hubert

View solution in original post

0 Kudos
9 Replies
Hubert_H_Intel
Employee
455 Views
Jaime,
Are you running Visual Studio? Are you sure that it's just a matter of linking rather than a complete rebuild of all project files in caseonly one single file was being changed?
Regards, Hubert
0 Kudos
levicki
Valued Contributor I
455 Views
If a single file is part of a library which is part of a larger project all other files depending on the library need to be rebuilt. Also, make sure you are using precompiled headers.
0 Kudos
aurora
Beginner
455 Views
Yes, I know it, but it takes 1 minute (compiling with 8gb in a Xeon with 8 cores) only linking without taking into account the compilation time. I dont use precompiled headers.
Thanks!
0 Kudos
levicki
Valued Contributor I
455 Views
As I said, consider using precompiled headers. You can also experiment with Link Time Code Generation (/LTCG). Also, if you are using /Qipo, that can slow down linking as well, try switching to /Qip and compare code performance. If /Qip does not reduce performance consider using /Qip instead of /Qipo.

Finally, try using faster storage like 10k RPM HDD or SSD or setup your build environment to work in ram disk.
0 Kudos
aurora
Beginner
455 Views
Using/Qipo- doesn't decrease link time. In fact, it takes the same time in debug and in release.

Which things in the code make the linker to be very slow? It happens in only very concrete modules
PS: I can't manage to create/use precompiled headers
0 Kudos
Hubert_H_Intel
Employee
456 Views

Just an addition for tests with disablingIPO (/Qipo-) to see if this helps. Please add also LINKER option /qnoipo (Configuration Properties > Linker > Optimization [Intel C++] > Interprocedural Optimization: No (/qnoipo). The compiler option alone does not always disable interprocedural optimization.

Let me know if this makes any difference.

Regards,
Hubert

0 Kudos
SergeyKostrov
Valued Contributor II
455 Views
>>...Is that normal?..

Could you post all Linker options? It is really hard to suggest anything in your case.

Ihad even longer times when some import & dynamic libraries werelocated on a network drive. Another
case was related toa poor performance of aSubversion.
0 Kudos
levicki
Valued Contributor I
455 Views
Few generic ideas:

- if you are using antivirus, try to temporarily disable realtime scanning and see whether that helps
- if you are connected to VPN try disconnecting before you build

Finally, if you cannot bother to test with precompiled headers to see whether it gets any faster, then I am afraid we cannot offer more help than we already did.
0 Kudos
aurora
Beginner
455 Views
#9 That helped. Linking time reduced a 95%! Now I have normal times!
Thanks a lot
0 Kudos
Reply