I found my problem. I should be putting the "-" in the flag, i.e.
compile("SISCAL.cpp", flags = "-g")
This has given me the desired output with source code lines, copied below.
For those who find this later, and are having issues debugging with lldb on a mac, if you can't piece it together from this thread then feel free to reach out. I will attempt to use gdbsource() another day.
Sam
=====
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x00007fff6ac3633a libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fff6acf2e60 libsystem_pthread.dylib`pthread_kill + 430
frame #2: 0x00007fff6abbd808 libsystem_c.dylib`abort + 120
frame #3: 0x000000014c2bf6c5 SISCAL.so`Eigen::DenseCoeffsBase<Eigen::Array<double, -1, 1, 0, -1, 1>, 1>::operator(this=0x00007ffeefbf8058, index=3)(long) at DenseCoeffsBase.h:425:7
frame #4: 0x000000014c17c7d5 SISCAL.so`objective_function<double>::operator(this=0x00007ffeefbfa2a8)() at SISCAL.cpp:1526:52