Thanks, I found the discussion here:
I realized from the above that the problem is parallelization in RStudio. I haven’t solved that yet, but I can live with a slow serial compilation for now, at least everything works in principle. Phew, I spent the whole day on this…