I have nailed the segmentation fault issue on the Mac down to the fact that: import LEMS_2007One_nrn
runs fine, but:
def foo():
import LEMS_2007One_nrn
foo()
produces the segmentation fault. Of course both of these work fine in Linux or Docker.
I am going to post the issue in the NEURON forums. I think the problem is that whatever things are getting loaded in the auto-generated neuron python files are not getting disposed of properly in the C code on the Mac. When imported normally they are still in memory, but when imported inside a function the pointers aren't getting disposed of when the function exits, and then memory issues occur leading to a segmentation fault.
I have nailed the segmentation fault issue on the Mac down to the fact that:
import LEMS_2007One_nrn
runs fine, but:produces the segmentation fault. Of course both of these work fine in Linux or Docker.
I am going to post the issue in the NEURON forums. I think the problem is that whatever things are getting loaded in the auto-generated neuron python files are not getting disposed of properly in the C code on the Mac. When imported normally they are still in memory, but when imported inside a function the pointers aren't getting disposed of when the function exits, and then memory issues occur leading to a segmentation fault.