[BUG] Google benchmark doesn't compile on Solaris
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
Línea de trabajo
Comienza con src/sysinfo.cc y test/benchmark_setup_teardown_test.cc, y luego reproduce la compilación de Solaris 11.4 usando el comando de CMake y make indicados. Comprueba los diagnósticos relacionados con hostname, sysconf, namespace y kstat descritos en el issue. Se considera terminado cuando el proyecto compila correctamente en Solaris con las toolchains de GCC y LLVM indicadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
benchmark doesn't compile on Solaris 11.4 (neither upstream nor the downstream copies in LLVM).
System
- OS: Solaris 11.4
- Compiler and version: GCC 12.1.0 and LLVM 15.0.0
To reproduce
2. cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on <srcdir>
4. make
/vol/llvm/src/llvm-project/benchmark/benchmark.git/src/sysinfo.cc: In function ‘std::string benchmark::{anonymous}::GetSystemName()’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/src/sysinfo.cc:446:54: note: ‘#pragma message: HOST_NAME_MAX not defined. using 64’
446 | #pragma message("HOST_NAME_MAX not defined. using 64")
|
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:13:11: error: ‘namespace single { }’ redeclared as different kind of entity
13 | namespace single {
| ^~~~~~
In file included from /usr/gcc/12/lib/gcc/x86_64-pc-solaris2.11/12.1.0/include-fixed/math.h:391,
from /usr/gcc/12/include/c++/12.1.0/bits/std_abs.h:40,
from /usr/gcc/12/include/c++/12.1.0/cstdlib:77,
from /vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:3:
/usr/include/floatingpoint.h:69:15: note: previous declaration ‘typedef float single’
69 | typedef float single;
| ^~~~~~
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc: In function ‘void DoSetup1(const benchmark::State&)’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:18:5: error: ‘single’ is not a class, namespace, or enumeration
18 | ++single::setup_call;
| ^~~~~~
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc: In function ‘void DoTeardown1(const benchmark::State&)’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:25:5: error: ‘single’ is not a class, namespace, or enumeration
25 | ++single::teardown_call;
| ^~~~~~
In file included from /usr/gcc/12/include/c++/12.1.0/cassert:44,
from /vol/llvm/src/llvm-project/benchmark/benchmark.git/include/benchmark/benchmark.h:180,
from /vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:9:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc: In function ‘int main(int, char**)’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:137:10: error: ‘single’ is not a class, namespace, or enumeration
137 | assert(single::setup_call == 4);
| ^~~~~~
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:138:10: error: ‘single’ is not a class, namespace, or enumeration
138 | assert(single::teardown_call == 4);
| ^~~~~~
The llvm-project in-tree benchmark used to compile with -Wcast-qual added, which produces additional errors:
/vol/llvm/src/llvm-project/benchmark/benchmark-rorth.git/src/sysinfo.cc:658:42: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
kstat_t* ksp = kstat_lookup(kc, (char*)"cpu_info", -1, (char*)"cpu_info0");
^
/vol/llvm/src/llvm-project/benchmark/benchmark-rorth.git/src/sysinfo.cc:658:65: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
kstat_t* ksp = kstat_lookup(kc, (char*)"cpu_info", -1, (char*)"cpu_info0");
^
/vol/llvm/src/llvm-project/benchmark/benchmark-rorth.git/src/sysinfo.cc:668:53: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
(kstat_named_t*)kstat_data_lookup(ksp, (char*)"current_clock_Hz");
^
3 errors generated.
Expected behavior
The code should compile cleanly.
Additional context
- Solaris needs to include
<netdb.h>forMAXHOSTNAMELEN. Also,sysconf(3C)returnslong. - Solaris
<floatingpoint.h>has a conflictingsingletypedef. Rename the namespace tosinglethreadedto avoid the conflict and reflect what's actually meant here.
I have a patch to fix these issues and mean to post a pull request once the CLA issue is sorted out (I should have one in place from golang work).
- Lenguaje dominante
- C++
- Estrellas
- 10.5k
- Forks
- 1.8k
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 28
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 google/benchmark
-
[BUG] Confusing title in docs/platform_specific_build_instructions.mdPosiblemente ocupada @skryabae la tomó hace 30 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
[BUG] Memory manager counts allocations not part of benchmarkQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
google/benchmark#2149 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
[FR] Add native Zig bindings via top-level `bindings/zig`Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
google/benchmark#2266 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
google/benchmark#2235 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
google/benchmark#2195 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/benchmark
Issues similares
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Abiertokind/bug priority/medium qa_automation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yugabyte/yugabyte-db#37324 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
CharlotteCross1998/awesome-game-decompilations#61 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
godotengine/godot#125240 ·
Los mantenedores suelen responder en 1 día
-
rombios: CMD needs to be a WORDAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
new issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
llvm/llvm-project#240065 ·
Los mantenedores suelen responder en 1 día