Open yurivict opened 1 year ago
Just out of curiosity - does building with GCC or older Clang suffers with similar problem?
@yurivict: Could you please try 16 or main
branch?
Version 17.0.0 (llvm-devel-17.0.d20230221) has the same problem.
pch is created in 190sec 7.8GB pch is consumed by int main() {} in 90 sec 4.1GB # problem (!!!)
The resulting m.cpp.o is 139MB and has a lot of symbols from the pch file, despite m.cpp only having the 'main' function.
Adding pch file to the command line should make it available in case when the relevant header is actually included. But when it isn't included - having pch in the command line should make no significant difference.
Please see the attached shar with reproducer.
The headers from the mlpack project cause Clang to exhibit the problem.
Please: 1) Install mlpack 2) run the
run-make-pch.sh
script 3) run therun-consume-pch.sh
scriptrun-consume-pch.sh
compiles a simpleint main() {}
function in 90 sec/4.1 GB because mlpack's pch file is loaded.The scripts follow how CMake creates pch files. When CMake is used enabling precompiled headers for
mlpack.hpp
causes all C++ modules to go up in memory/time. This defeats precompiled headers - makes it impossible to use them.clang-14.0.5 FreeBSD 13.1
pch.shar.txt