more helpful "PCH file built from a different branch" message
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp
- 领域
- build-system, cli
调研方向
从报告中显示的 make 调用和编译命令开始,尤其关注引用 stan/src/stan/model/model_header.hpp.gch 的 -include-pch 参数。重现编译器不匹配导致的失败,然后追踪该错误在哪里被暴露出来。完成的标准是:输出能够识别 PCH 的位置,或自动重新构建 PCH,并且该失败行为由测试覆盖。
由索引模型根据 Issue 内容生成。
描述
Summary:
The PCH file built from a different branch error does not provide a hint on how to fix it. Add such a hint.
Description:
When I try to build with the wrong precompiled header (PCH), I get this:
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/simple
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/simple.hpp /Users/bcarpenter/temp2/simple.stan
--- Compiling, linking C++ code ---
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DBOOST_DISABLE_ASSERTS -c -include-pch stan/src/stan/model/model_header.hpp.gch -x c++ -o /Users/bcarpenter/temp2/simple.o /Users/bcarpenter/temp2/simple.hpp
error: PCH file built from a different branch ((clang-1316.0.21.2.5)) than the compiler ((clang-1400.0.29.102))
1 error generated.
make: *** [/Users/bcarpenter/temp2/simple] Error 1
This is great that it says what's wrong, but it would be even better if it suggested how to fix the problem. I'm pretty sure I need to just delete a .pch file, but I don't know where it's at. A recursive search didn't work:
~/github/stan-dev/cmdstan (develop)$ ls -R -l | grep pch
-rw-r--r-- 1 bcarpenter 1595 3773 Aug 10 12:07 pchip.hpp
-rw-r--r-- 1 bcarpenter 1595 340 Aug 10 12:07 pch.hpp
-rwxr-xr-x 1 bcarpenter 1595 1175 Aug 10 12:07 cppcheck.sh
-rw-r--r-- 1 bcarpenter 1595 537 Aug 10 12:07 pch.hpp
-rw-r--r-- 1 bcarpenter 1595 2717 Aug 10 12:07 pch.jam
-rw-r--r-- 1 bcarpenter 1595 2848 Aug 10 12:07 pch.py
~/github/stan-dev/cmdstan (develop)$
Reproducible Steps:
See above, but to reproduce it, you need to have two compilers, one of which built the pch file and a different one to tickle this error.
Current Output:
See above.
Expected Output:
Some hint as to where the pch file is that I need to delete. Even better, just automatically delete and rebuild after detecting this error.
Additional Information:
There are a lot of pages where people brought up this problem on our forums or in issues. The advice in the first hit on the forums didn't work, which suggested just running make clean. Here's what I get:
~/github/stan-dev/cmdstan (develop)$ make clean
rm -f -r test
rm -f
rm -f
rm -f
rm -f
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/simple
--- Compiling, linking C++ code ---
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -DBOOST_DISABLE_ASSERTS -c -include-pch stan/src/stan/model/model_header.hpp.gch -x c++ -o /Users/bcarpenter/temp2/simple.o /Users/bcarpenter/temp2/simple.hpp
error: PCH file built from a different branch ((clang-1316.0.21.2.5)) than the compiler ((clang-1400.0.29.102))
1 error generated.
make: *** [/Users/bcarpenter/temp2/simple] Error 1
Current Version:
v2.30.1
- 主要语言
- C++
- 星标
- 240
- 派生
- 105
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stan-dev/cmdstan 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
-
bug
难度 1/5 1 小时以内 新手友好度 55/100
-
难度 2/5 1-3 小时 新手友好度 45/100
-
code-cleanup
难度 4/5 3-5 天 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 52/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
charmplusplus/charm#4210 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
[BUG] VPN auth dialog spawned by the secret agent fails with "TLS support is not available" on NixOS未关闭bug nixos umbriel
难度 2/5 1-3 小时 新手友好度 62/100
noctalia-dev/noctalia#5310 ·
维护者通常 1 天内回复
-
area/docdb kind/bug priority/medium status/awaiting-triage
难度 2/5 1-3 小时 新手友好度 78/100
yugabyte/yugabyte-db#37426 ·
维护者通常 1 天内回复
-
[Engine] Two prompt block scorers enabled at once: WMMA silently wins and no log line is printed未关闭
难度 2/5 1-3 小时 新手友好度 68/100
Niko1221/Strata#5693 · 2 条评论 ·
维护者通常 4 天内回复