Initial Checklist prior to submitting the issue. Check the bellow boxes to the best of your knowledge:
[x ] I have not found an open issue describing the same problem.
[ x] I went through "CONTRIBUTING.MD" before deciding to submit the issue.
[ x] While building GridLAB-D, I followed all steps as detailed in GridLAB-D Wiki.
I am getting an error running GridLabD on MacOS Sonoma 14.7. The compiler used is Clang
bash-3.2$ cc --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
bash-3.2$ gridlabd --version
GridLAB-D 5.2.0-19880 (281cf249:feature/730:Modified) 64-bit MACOSX RELEASE
WARNING [INIT] : unable to set thread policy: No such process
Backtrace shows the error is in glcore/module.cpp
#elif defined MACOSX // TODO set mp affinity
if ( global_threadcount==1 ) {
policy.affinity_tag = cpu;
if (thread_policy_set(mach_thread_self(), THREAD_AFFINITY_POLICY, reinterpret_cast<thread_policy_t>(&policy), THREAD_AFFINITY_POLICY_COUNT) != KERN_SUCCESS )
output_warning("unable to set thread policy: %s", strerror(errno));
}
When running autotests (I tried tests from generators/autotests and powerflow/autotests, the test crashes with a segmentation fault at the same location in the code. Here's the fault location and the backtrace
bash-3.2$ pwd
/Users/abhy245/gridlabd-dir/gridlab-d/powerflow/autotest/test
bash-3.2$ lldb -- gridlabd ../test_powerflow_exercise_4_1_3.glm
(lldb) target create "gridlabd"
Current executable set to '/Users/abhy245/gridlabd-dir/gridlab-d/install-scl/bin/gridlabd' (arm64).
(lldb) settings set -- target.run-args "../test_powerflow_exercise_4_1_3.glm"
(lldb) r
Process 55663 launched: '/Users/abhy245/gridlabd-dir/gridlab-d/install-scl/bin/gridlabd' (arm64)
Process 55663 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x736f6c6320676ebd)
frame #0: 0x0000000100010434 gridlabd`_set_rankx(obj=0x736f6c6320676e69, rank=0, first=0x00000001000f9110) at object.cpp:1287:21
1284 output_error("%s: set_rank failed, parent loopback has occurred", object_name(first, tmp, sizeof(tmp)));
1285 return -1;
1286 }
-> 1287 if ( rank >= obj->rank )
1288 {
1289 if ( obj->flags & OF_RERANK )
1290 {
Target 0: (gridlabd) stopped.
The fix for this, thank you @ftuffner and @trevorhardy , is to use arch -x86_64 while launching the shell and recompile. @trevorhardy has already documented this fix here.
Initial Checklist prior to submitting the issue. Check the bellow boxes to the best of your knowledge:
I am getting an error running GridLabD on MacOS Sonoma 14.7. The compiler used is Clang
GridLabD was built in Debug version
On running
--version
, I get the following errorBacktrace shows the error is in
glcore/module.cpp
When running autotests (I tried tests from
generators/autotests
andpowerflow/autotests
, the test crashes with a segmentation fault at the same location in the code. Here's the fault location and the backtraceBacktrace
@ftuffner @trevorhardy @afisher1 @eranschweitzer