recompiling main.cpp each time
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- build-system, cli
Línea de trabajo
Comienza con la regla de make que compila src/cmdstan/main.o y sigue el motivo por el que se ejecuta de nuevo después de que falle la traducción del modelo. Reproduce la secuencia usando make ~/temp2/abs, incluyendo un modelo de Stan que falle seguido de uno corregido. Se considera terminado cuando un make posterior reutiliza main.o si main.cpp y sus dependencias no han cambiado, y lo vuelve a compilar cuando cambian.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary:
When I run the latest develop version of cmdstan, it recompiles the main.cpp every time, but it should only have to be compiled once.
Description:
The main.cpp should only be compiled once, then re-used.
Reproducible Steps & Current Output
Run 1
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/abs
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.75.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 -MT stan/src/stan/model/model_header.hpp.gch -MT stan/src/stan/model/model_header.d -MM -E -MG -MP -MF stan/src/stan/model/model_header.d stan/src/stan/model/model_header.hpp
--- Compiling the main object file. This might take up to a minute. ---
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.75.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 -o src/cmdstan/main.o src/cmdstan/main.cpp
--- Compiling pre-compiled header. This might take a few seconds. ---
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.75.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 stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header.hpp.gch
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/abs.hpp /Users/bcarpenter/temp2/abs.stan
Semantic error in '/Users/bcarpenter/temp2/abs.stan', line 4, column 20 to column 35:
-------------------------------------------------
2: int a = abs(2);
3: real b = abs(2.9);
4: array[2] real c = abs({1.9, 2.8});
^
5: array[2] int d = abs({1, 2});
6: vector[2] e = abs([1.2, 3.9]');
-------------------------------------------------
Ill-typed arguments supplied to function 'abs':
(array[] real)
Available signatures:
(int) => int
The first argument must be int but got array[] real
(real) => real
The first argument must be real but got array[] realmake: *** [/Users/bcarpenter/temp2/abs.hpp] Error 1
So this fails to compile the model, but what happens to the make.cpp compilation?
Run 2
It just happens again. And remember "This might take up to a minute."
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/abs
--- Compiling the main object file. This might take up to a minute. ---
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.75.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 -o src/cmdstan/main.o src/cmdstan/main.cpp
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/abs.hpp /Users/bcarpenter/temp2/abs.stan
Semantic error in '/Users/bcarpenter/temp2/abs.stan', line 5, column 2 to column 32:
-------------------------------------------------
3: real b = abs(2.9);
4: array[2] real c = fabs({1.9, 2.8});
5: array[2] int d = fabs({1, 2});
^
6: vector[2] e = fabs([1.2, 3.9]');
7: row_vector[2] f = fabs([1.2, 3.9]);
-------------------------------------------------
Ill-typed arguments supplied to assignment operator =: lhs has type array[] int and rhs has type array[] realmake: *** [/Users/bcarpenter/temp2/abs.hpp] Error 1
Run 3
Here we go again.
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/abs
--- Compiling the main object file. This might take up to a minute. ---
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.75.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 -o src/cmdstan/main.o src/cmdstan/main.cpp
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/abs.hpp /Users/bcarpenter/temp2/abs.stan
Syntax error in '/Users/bcarpenter/temp2/abs.stan', line 5, column 11 to column 17, parsing error:
-------------------------------------------------
3: real b = abs(2.9);
4: array[2] real c = fabs({1.9, 2.8});
5: array[2] double d = fabs({1, 2});
^
6: vector[2] e = fabs([1.2, 3.9]');
7: row_vector[2] f = fabs([1.2, 3.9]);
-------------------------------------------------
Ill-formed phrase. Found L-value. This can be completed in many ways.
make: *** [/Users/bcarpenter/temp2/abs.hpp] Error 1
Run 4
One more time, with feeling.
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/abs
--- Compiling the main object file. This might take up to a minute. ---
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.75.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 -o src/cmdstan/main.o src/cmdstan/main.cpp
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/abs.hpp /Users/bcarpenter/temp2/abs.stan
Warning in '/Users/bcarpenter/temp2/abs.stan', line 3, column 11: Use of the `abs` function with real-valued arguments is deprecated; use functions `fabs` instead.
--- 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.75.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/abs.o /Users/bcarpenter/temp2/abs.hpp
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.75.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 -Wl,-L,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" /Users/bcarpenter/temp2/abs.o src/cmdstan/main.o -Wl,-L,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_kinsol.a stan/lib/stan_math/lib/tbb/libtbb.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc_proxy.dylib -o /Users/bcarpenter/temp2/abs
rm -f /Users/bcarpenter/temp2/abs.o
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/abs
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/abs.hpp /Users/bcarpenter/temp2/abs.stan
Warning in '/Users/bcarpenter/temp2/abs.stan', line 3, column 11: Use of the `abs` function with real-valued arguments is deprecated; use functions `fabs` instead.
--- Compiling the main object file. This might take up to a minute. ---
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.75.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 -o src/cmdstan/main.o src/cmdstan/main.cpp
--- 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.75.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/abs.o /Users/bcarpenter/temp2/abs.hpp
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.75.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 -Wl,-L,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" /Users/bcarpenter/temp2/abs.o src/cmdstan/main.o -Wl,-L,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_kinsol.a stan/lib/stan_math/lib/tbb/libtbb.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc_proxy.dylib -o /Users/bcarpenter/temp2/abs
rm -f /Users/bcarpenter/temp2/abs.o
Run 5
OK, this time it succeeded. Now let me change my program for abs and see what happens.
It still recompiles main.cpp.
~/github/stan-dev/cmdstan (develop)$ make ~/temp2/abs
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/bcarpenter/temp2/abs.hpp /Users/bcarpenter/temp2/abs.stan
Warning in '/Users/bcarpenter/temp2/abs.stan', line 3, column 11: Use of the `abs` function with real-valued arguments is deprecated; use functions `fabs` instead.
--- Compiling the main object file. This might take up to a minute. ---
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.75.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 -o src/cmdstan/main.o src/cmdstan/main.cpp
--- 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.75.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/abs.o /Users/bcarpenter/temp2/abs.hpp
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.75.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 -Wl,-L,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" /Users/bcarpenter/temp2/abs.o src/cmdstan/main.o -Wl,-L,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/bcarpenter/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_6.1.1/lib/libsundials_kinsol.a stan/lib/stan_math/lib/tbb/libtbb.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc.dylib stan/lib/stan_math/lib/tbb/libtbbmalloc_proxy.dylib -o /Users/bcarpenter/temp2/abs
rm -f /Users/bcarpenter/temp2/abs.o
Expected Output:
Only see recompilation of main.cpp once.
Additional Information:
This is on Mac OS X.
~/github/stan-dev/cmdstan (develop)$ clang++ --version
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
~/github/stan-dev/cmdstan (develop)$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Current Version:
v2.29.2
- Lenguaje dominante
- C++
- Estrellas
- 240
- Forks
- 105
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stan-dev/cmdstan
-
Release CmdStan 2.40Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
-
code-cleanup
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
diagnose exit codeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
Todos los issues de stan-dev/cmdstan
Issues similares
-
Upstream changes to reviewAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
rhalbersma/xstd-ints#395 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Root filesystem scope (/) incorrectly rejects all descendant pathsPosiblemente ocupada @mugenkyou la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
neutralinojs/neutralino.js#304 · 1 comentario ·
-
CLI: enforce absolute ADB device paths in file and directory commandsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
FuSa
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
tenstorrent/tt-umd#3851 ·
Los mantenedores suelen responder en 3 días
-
zq prints a raw SQL 'no such table: index_default' error when the index has no default indexAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
mattgodbolt/zindex#67 ·
Los mantenedores suelen responder en 1 día