- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello everyone,
I'm working on a fairly large modern C++ project (around 2 million lines of code) and recently migrated our build system to use the Intel oneAPI DPC++/C++ Compiler. While the generated binaries perform well, I've noticed that compilation times are significantly longer than expected, especially during full rebuilds.
Our current setup includes:
Intel oneAPI DPC++/C++ Compiler (latest available version)
CMake-based build system
Ninja build generator
C++20 standard
Heavy use of templates and header-only libraries
Around 400–500 source files
Incremental builds are acceptable, but clean builds take much longer than with our previous compiler.
I've already tried a few optimizations:
Using parallel builds (-j with Ninja)
Reducing unnecessary header dependencies
Enabling precompiled headers for commonly included headers
Disabling unnecessary debug information for release builds
However, I'm still looking for ways to reduce overall compile time.
Here are a few questions I hope the community can help with:
Are there Intel oneAPI compiler flags that specifically improve compilation speed without sacrificing runtime performance?
Does the Intel compiler benefit from precompiled headers differently than GCC or Clang?
Are there recommended optimization levels for faster development builds?
Has anyone successfully implemented C++20 modules with oneAPI to reduce build times?
Are there Intel tools that can profile or identify the most time-consuming compilation units?
Is there any benefit to enabling distributed or cached builds (such as ccache or sccache) with Intel oneAPI?
Are there any best practices for organizing large projects to improve compiler throughput?
I'd also appreciate hearing about real-world experiences from developers working on enterprise-scale C++ applications. If you've managed to significantly reduce compile times using Intel oneAPI, I'd be interested in knowing what changes made the biggest difference.
Thanks in advance for your suggestions!
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Just some things to try, im going to spitball them because I dont have alot of time unfortunately, but i didnt want to see you stay stuck my friend.
Precompiled headers is definitely causing delays since icx is LLVM-based and its PCH implementation is pretty much the same as Clang's. Intels instantiation passes being heavy, ya gotta ensure the heavy hitters have their libraries cached properly in the PCH. Think Cmake has a feature for this too, target_precompile_headers.
icx does support C++20 modules tho you're specific setup is not a quick fix due to dynamically resolving module dependencies and can slow down distributed Ninja builds due to compilation order reqs. STICK TO PCH and explicit template instantiation FIRST.
You also need to turn optimization levels down for fast dev builds.
Take advantage of features of compiler being built on LLVM like Clang's time-trace feature and add to compiler flags. then take .json generated for translation units and drag to visual tracing to see exactly which headers/templates are eating up compile.
and yes, def enable ccache! oneAPI comes bundled with it out the gate. it tracks the Intel compilers as supported, and cmake lets uyou enabled instantly using "CMAKE_CXX_COMPILER_LAUNCHER+ccache.
Be explicit with template instantiation. If heavily making use of them, "icx" might be instantiating the EXACT same "std:vector<MyComplexStruct> in 300 different files, which THEN have to be de-duplicated by the linker.
Use "extern template' in your heads and instantiatate ONCE in a single ".cpp".
There's more but tired. Good luck, hope it helps