Build issue: Build with Enzyme fails
Maintainers usually reply within 1 day
@nkoukpaizan is already working on this.
Since Jan 18, 2026.
Assessment
This issue has not been assessed yet.
Description
Build error message(s)
I am getting error message "Illegal remaining use" when trying to build GridKit with Enzyme enabled. Truncated output is below:
In file included from /Users/55y/src/gridkit/GridKit/GridKit/Model/PhasorDynamics/Branch/BranchEnzyme.cpp:7:
/Users/55y/src/gridkit/GridKit/GridKit/AutomaticDifferentiation/Enzyme/SparseWrapper.hpp:585:21: error: Enzyme: Illegal remaining use ( call fastcc void @fwddiffe_ZN7GridKit6Enzyme6Sparse7WrapperINS_14PhasorDynamics6BranchIdlEELNS1_15MemberFunctionsE3EdE4evalEPS5_PdS9_S9_S9_(ptr %0, ptr %31, ptr %32)) of todense ( %31 = call noundef ptr (ptr, ...) @_ZN7GridKit6Enzyme6Sparse16__enzyme_todenseIPdEET_Pvz(ptr noundef nonnull @_ZN7GridKit6Enzyme6SparseL10ident_loadIdEET_mm, ptr noundef nonnull @_ZN7GridKit6Enzyme6SparseL11ident_storeIdEEvT_mm, i64 noundef %30) #25) in function ; Function Attrs: mustprogress noinline optnone ssp uwtable(sync)
define linkonce_odr void @_ZN7GridKit6Enzyme6Sparse11BusJacobianINS_14PhasorDynamics6BranchIdlEELNS1_15MemberFunctionsE3EdlE4evalEPS5_mmRKNSt3__13mapIllNS9_4lessIlEENS9_9allocatorINS9_4pairIKllEEEEEESK_PdSL_SL_RNS_13LinearAlgebra10COO_MatrixIdlEE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef nonnull align 8 dereferenceable(89) %8) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
%10 = alloca %"class.std::__1::vector.178", align 8
%11 = alloca %"class.std::__1::vector", align 8
%12 = alloca double, align 8
%13 = alloca %"class.std::__1::vector.16", align 8
%14 = alloca %"class.std::__1::vector.16", align 8
%15 = alloca %"class.std::__1::vector", align 8
%16 = alloca %"class.std::__1::__wrap_iter.229", align 8
%17 = alloca %"class.std::__1::__wrap_iter.229", align 8
%18 = alloca i64, align 8
%19 = alloca i64, align 8
%20 = alloca %"class.std::__1::vector.16", align 8
%21 = alloca %"class.std::__1::vector.16", align 8
%22 = alloca %"class.std::__1::vector", align 8
%23 = icmp ne i64 %1, 0
%24 = icmp ne i64 %2, 0
%25 = and i1 %23, %24
br i1 %25, label %26, label %111
26: ; preds = %9
%27 = call noundef ptr @_ZNSt3__16vectorIN7GridKit6Enzyme6Sparse6TripleIdEENS_9allocatorIS5_EEEC1B8ne180100Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #24
%28 = invoke noundef ptr @_ZNSt3__16vectorIdNS_9allocatorIdEEEC1Em(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %1)
to label %29 unwind label %39
GridKit™ version
develop at 61b657b80f825808add689df40f45f3ea808802c
System and environment details
- Enzyme v0.0.206
- Compiler: clang 18 from MacPorts
- MacOS v15
- ARM M4 CPU
Additional information
No response
- Dominant language
- C++
- Stars
- 27
- Forks
- 11
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 15
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ORNL/GridKit
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ORNL/GridKit#587 · 1 reaction ·
Maintainers usually reply within 1 day
-
Companion OPF models for PD initialization constraintsPossibly taken @lukelowry claimed this 3 days ago. OpenIVP question
ORNL/GridKit#656 · 1 assignee ·
Maintainers usually reply within 1 day
-
Extract CommonMath functionsPossibly taken @amandeep25100-a11y claimed this 6 days ago. Opencleanup
Difficulty 4/5 3-5 days Newbie friendliness 54/100
ORNL/GridKit#642 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement question
Difficulty 5/5 Over a week Newbie friendliness 30/100
ORNL/GridKit#624 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Add support for hierarchical modeling to the JSON format case file specificationsPossibly taken @abirchfield claimed this 33 days ago. Opendocumentation enhancement new case question
ORNL/GridKit#619 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
useless statementOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
grizzlypeak3d/DJV#962 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day