stewid / SimInf

A framework for data-driven stochastic disease spread simulations
GNU General Public License v3.0
32 stars 14 forks source link

'stdlib.h' file not found R #27

Closed mutono closed 4 years ago

mutono commented 4 years ago

I created a function for a model which includes more compartments than the SEIR model and I get the error that 'stdlib.h' file not found. This happens when I run model in the run() function.

stewid commented 4 years ago

It is difficult to answer what is the problem without more information. What is the output from sessionInfo() in R?

mutono commented 4 years ago

Even when I run this example from the SimInf manual:

model <- mparse(transitions = c("S -> betaSI/(S+I+R) -> I", "I -> gamma*I -> R"), compartments = c("S", "I", "R"), gdata = c(beta = 0.16, gamma = 0.077), u0 = data.frame(S = 100, I = 1, R = 0), tspan = 1:100)

Run and plot the result

set.seed(22) result <- run(model) plot(result)

I get this output:

clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot] In file included from SimInf-16386b47be2d.c:4: In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/SimInf/include/SimInf.h:27: /Library/Frameworks/R.framework/Resources/include/R.h:55:11: fatal error: 'stdlib.h' file not found

include / Not used by R itself, but widely assumed in packages /

      ^~~~~~~~~~

1 error generated. make: *** [SimInf-16386b47be2d.o] Error 1 running command ''/Library/Frameworks/R.framework/Resources/bin/R' CMD SHLIB 'SimInf-16386b47be2d.c'' had status 1Error: clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/3.6/Resources/library/SimInf/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c SimInf-16386b47be2d.c -o SimInf-16386b47be2d.o

mutono commented 4 years ago

I have sorted it out. Turns out installing Xcode did the trick.