Fatal error: 'stdio.h' file not found, problem with StateMonitor of threshold adaptation

This is indeed a bit mysterious. I think what happens is that for some parameter values the generated code is slightly different (e.g. because the equations can/cannot be simplified in a certain way), and then the generated code refers to different functions from the standard library. We could try to debug this further (I’d need your help since I do not have access to an OS X machine), but we already know that the clang compiler installed into a conda environment is problematic on OS X. See this discussion here: Problem with Cython

We’ve actually added a new error message if Cython compilation fails for this reason:

Certain compiler configurations (e.g. clang in a conda environment on OS X) are known to be problematic. Note that you can switch the compiler by setting the ‘CC’ and ‘CXX’ environment variables. For example, you may want to try ‘CC=gcc’ and ‘CXX=g++’.

Unfortunately, this message does not get triggered here, since our basic compilation test works – as you said, the problem seems to need quite specific circumstances to get triggered for you. Could you try the suggestion from the above message? Or, if you also have clang installed outside of conda, you could also try CC=clang and CXX=clang++.

Unfortunately, there’s no way to easily attach long code here. A general recommendation is to enclose code in triple backticks, though (I edited your post for this), since otherwise the formatting will be off (and copy&pasting is difficult):

```
# my Python code here
print("hello world")
```

Another option would be to copy&paste the raw notebook file into a gist (https://gist.github.com/) and link to that.