Come up with a way to shorten long lines that reference __FILE__
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- cmake, fortran
- Área
- build-system
Línea de trabajo
No se especifica ningún archivo ni prueba concretos. Empieza localizando las referencias de Fortran a FILE, incluidos los archivos de I/O generados; después compara los enfoques de CLM y PIO y la opción basada en CMake enlazada. Se considerará terminado cuando se haya seleccionado e implementado un enfoque robusto que evite el fallo de longitud de línea posterior a la expansión de PGI, con cobertura para los archivos generados y de código fuente afectados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
From @billsacks on September 23, 2017 12:18
The pgi compiler enforces a line length of (I think) 264 characters after doing macro expansion. This can cause problems for lines using the __FILE__ macro, because this expands to the absolute path to that file. This was causing problems in CESM for some automated tests that had long paths to the bld directory. I have fixed that problem with a cime change, but this too-long-line problem is likely to come back to bite us at some point.
Some possible solutions:
-
Do what CLM does: In each file, have:
character(len=*), parameter, private :: sourcefile = & __FILE__then use sourcefile rather than
__FILE__in lines of code. This will still fail if the absolute path to the file is longer than about 256 characters, but it at least buys us some characters (because you're not adding the file path length to the source file line in which it's referenced). -
If the problem just occurs for source files that appear in the bld directory (because paths to the bld directory may be longer than paths to the source tree), then we could fix this just for files that are copied or generated in the bld directory. For example, for auto-generated io files, we could change references to
__FILE__to instead just give the file name without a path. -
We could consider a solution that uses just the file name itself rather than the full path, for all files. Some possibilities:
a. Hard-code at the top of each file something like:
character(len=*), parameter, private :: sourcefile = "myfilename.F90"b. Apparently PIO created its own
_FILE_macro in the past, which gave just the file name rather than its full path, though I don't understand exactly how it was done. (At a glance, it looks like PIO now uses solution (a).)c. There may be a way to do this via cmake. For example, see the cmake-based solution here: https://stackoverflow.com/questions/8487986/file-macro-shows-full-path. However, comments around that make it sound like a fragile solution. I've seen some other cmake-based solutions via googling, but they all seem either complex or fragile.
Copied from original issue: E3SM-Project/cism-piscees#64
- Lenguaje dominante
- Fortran
- Estrellas
- 13
- Forks
- 17
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 1
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 ESCOMP/CISM
-
Need to update cmake_minimum_requiredQuizá libre de nuevo @Katetc la tomó hace 75 días y no hay ningún pull request abierto. Abiertobug
-
Adding PFunit unit testing to CISMQuizá libre de nuevo @Katetc la tomó hace 241 días y no hay ningún pull request abierto. Abierto
-
Methods for initializing isotopes within the Ice SheetQuizá libre de nuevo @Katetc la tomó hace 255 días y no hay ningún pull request abierto. Abierto
-
Infrastructure to bring isotopes as tracers into CISMQuizá libre de nuevo @Katetc la tomó hace 255 días y no hay ningún pull request abierto. Abierto
-
smb_input confusing logicAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de ESCOMP/CISM
Issues similares
-
Use pnpm 12Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vercel/ai-elements#524 ·
Los mantenedores suelen responder en 1 día
-
mock-core-configs/etc/mock/rocky-10-riscv64.cfg contains the wrong architecture in config_opts['root']Posiblemente ocupada @jasonmontleon la tomó hace 4 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
rpm-software-management/mock#1834 ·
-
missing `catch.hpp`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/inflatelib#34 · 1 comentario ·
-
status:in-linear
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
n8n-io/n8n#43006 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
is:build
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día