Repository navigation
Fix: compile lr_io_krlist.cpp only with LibRI to repair non-EXX build - #7973
Merged
Merged
Conversation
utils/lr_io_krlist.cpp unconditionally includes module_ri/ri_util.h, which pulls in LibRI headers (RI/global/Array_Operator.h etc.), so any build with ENABLE_LIBRI=OFF fails with a fatal missing-header error. The file only implements BSE/RI-benchmark helpers (LR_IO::RI_kRlist); every consumer (ESolver_BSE, the RI benchmark path in hamilt_casida.h, the LRI readers in lr_io.cpp) is already guarded by __EXX, so exclude it from the lr object library unless ENABLE_LIBRI is on. In non-EXX builds, selecting xc_kernel=bse still hits the existing runtime guard "BSE requires ENABLE_LIBRI=ON" in esolver_factory.cpp.
mohanchen
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Builds configured with
ENABLE_LIBRI=OFFfail with:source/source_lcao/module_lr/utils/lr_io_krlist.cpp(added in #7849) is compiled unconditionally as part of thelrobject library, and it unconditionally includessource_lcao/module_ri/ri_util.h, which pulls in LibRI headers (RI/global/Array_Operator.h,RI/global/Global_Func-2.h,RI/global/Tensor.h). CI does not catch this because CI builds enable LibRI.Fix
lr_io_krlist.cpponly implements BSE / RI-benchmark helpers (LR_IO::RI_kRlist). Every consumer of these symbols is already guarded:ESolver_BSE(esolver_lr_lcao_bse.cpp) is compiled only underENABLE_LIBRI, and its instantiation inesolver_factory.cppis#ifdef __EXX-guarded, falling back toWARNING_QUIT("ESolver", "BSE requires ENABLE_LIBRI=ON");module_lr/hamilt_casida.h(RI_kRlistusage at lines 76/90) is inside#ifdef __EXX;module_lr/utils/lr_io.{h,cpp}that takeRI_kRlist&are inside#ifdef __EXX.So this PR simply moves
utils/lr_io_krlist.cppinto anif(ENABLE_LIBRI)block insource/source_lcao/module_lr/CMakeLists.txt.lr_io_krlist.hitself has no LibRI dependency and stays includable fromlr_io.hin all configurations.No behavior change: the file is untouched, and the LibRI-on build compiles exactly the same objects as before.