BDI-pathogens / OpenABM-Covid19

OpenABM-Covid19: an agent-based model for modelling the spread of SARS-CoV-2 (coronavirus) and control interventions for the Covid-19 epidemic
GNU General Public License v3.0
111 stars 76 forks source link

gsl error when trying to compile OpenABM-Covid19 R package on MacOS #214

Closed lampk closed 3 years ago

lampk commented 3 years ago

Dear all,

I have followed instruction to compile R package but haven't successful yet. I have installed gsl 2.71 through brew, swig@3.0.12, and successfully build R/OpenABMCovid19.R and src/covid19_wrap_R.c. However, I cannot build or install the package and the error seems to relate to 'gsl/gsl_rng.h' not found.

I have tried 3 different computers using MacOS and they all produced errors related to "gsl_rng.h" (MacBook Pro M1 - Big Sur - R version 4.0.4, MacBook Pro Intel - Big Sur - R version 4.0.1, iMac - Catalina - R version 4.1.0)

Below are errors when I used MacBook Pro M1, OS Big Sur, R version 4.0.4., and tried devtools::document(), or devtools::build():

Error: Could not find tools necessary to compile a package Call pkgbuild::check_build_tools(debug = TRUE) to diagnose the problem.

Below is error when I tried R CMD INSTALL --no-multiarch --with-keep.source OpenABM-Covid19-master:

Exited with status 1.

lampk commented 3 years ago

This issue is due to mis-specification of path to gsl in the Makevars file. After correct gsl path in the Makevars, the compilation works fine.