more helpful "PCH file built from a different branch" message
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- cpp
- Domaine
- build-system, cli
Piste de recherche
Commencez par l’invocation de make et la commande de compilation indiquées dans le rapport, en particulier par l’argument -include-pch faisant référence à stan/src/stan/model/model_header.hpp.gch. Reproduisez l’échec dû à une incompatibilité du compilateur, puis déterminez où cette erreur est remontée. Le travail est terminé lorsque la sortie identifie l’emplacement du PCH ou le reconstruit automatiquement, et que le comportement en cas d’échec est couvert par un test.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- C++
- Étoiles
- 240
- Forks
- 105
- Merge moyen
- 1 j 5 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de stan-dev/cmdstan
-
diagnose flags R-hat only above 1.015 and ESS only below N/1000; documentation says 1.01 and 400Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
-
Release CmdStan 2.40Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 55/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
-
code-cleanup
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Toutes les issues de stan-dev/cmdstan
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
-
area:qmc bug
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
Les mainteneurs répondent en général sous 3 jours
-
bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
ASGC-Game-Jam/asgc-gamejam-2026#563 ·
Les mainteneurs répondent en général sous 1 jour
-
area/ysql kind/bug priority/medium status/awaiting-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
yugabyte/yugabyte-db#37523 ·
Les mainteneurs répondent en général sous 1 jour
-
Let agents name their jobsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100