Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Linking faster

aurora
Beginner
186 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
186 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

9 Replies
Hubert_H_Intel
Employee
186 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
ILevi1
Valued Contributor I
186 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.
aurora
Beginner
186 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!
ILevi1
Valued Contributor I
186 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.
aurora
Beginner
186 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
Hubert_H_Intel
Employee
187 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

SergeyKostrov
Valued Contributor II
186 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.
ILevi1
Valued Contributor I
186 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.
aurora
Beginner
186 Views
#9 That helped. Linking time reduced a 95%! Now I have normal times!
Thanks a lot
Reply