Come up with a way to shorten long lines that reference __FILE__
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- cmake, fortran
- 領域
- build-system
調査の方向性
特定のファイルやテストは指定されていません。まず、生成された I/O ファイルを含め、FILE への Fortran の参照を探します。次に、CLM と PIO のアプローチ、およびリンクされている CMake ベースのオプションを比較します。PGI による展開後の行長エラーを回避する堅牢なアプローチを選択して実装し、影響を受ける生成ファイルとソースファイルをカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Fortran
- スター
- 13
- フォーク
- 17
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ESCOMP/CISM のほかの issue
-
Need to update cmake_minimum_required再び着手できるかも @Katetc が 78 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
-
Adding PFunit unit testing to CISM再び着手できるかも @Katetc が 244 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
-
Methods for initializing isotopes within the Ice Sheet再び着手できるかも @Katetc が 258 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
-
Infrastructure to bring isotopes as tracers into CISM再び着手できるかも @Katetc が 258 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
lucide-icons/lucide#5165 ·
メンテナーはふだん 1 日以内に返信
-
ci enhancement tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
A second build without clean fails in resources-optimizer-maven-plugin because minified files are minified again対応中かも @papegaaij が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
spring-projects/spring-security#20057 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
gavinlouuu-kpt/mib-studio-qt#903 ·
メンテナーはふだん 1 日以内に返信