tomthe / rsoc

run SOCSIM from within R. Go to the new repository for this package: https://github.com/MPIDR/rsocsim

Home Page:https://mpidr.github.io/rsocsim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems installing RSocsim (OS)

nathanieldarling opened this issue · comments

Hi - and apologies if there is another way I should try to fix this - I am new to R and coding in general. I have a project I would like to use RSocsim which I'm very excited by. I get the below error message when trying to download it. Any guidance would be very much appreciated.

devtools::install_github("MPIDR/rsocsim")
Downloading GitHub repo MPIDR/rsocsim@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/private/var/folders/0t/q_68jd055v19hpk23zywzp2r0000gn/T/RtmpxoXvnA/remotes7d3d60ce0dbb/MPIDR-rsocsim-8b3e1cf/DESCRIPTION’ (832ms)
─ preparing ‘rsocsim’:
✔ checking DESCRIPTION meta-information
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘rsocsim_1.4.1.tar.gz’

  • installing source package ‘rsocsim’ ...
    ** using staged installation
    ** libs
    clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
    clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c startSocsimWithFile.cpp -o startSocsimWithFile.o
    **startSocsimWithFile.cpp:4:10: fatal error: 'src\events.cpp' file not found
    #include "src\events.cpp"
    ^~~~~~~~~~~~~~~~
    1 error generated.
    make: *** [startSocsimWithFile.o] Error 1
    ERROR: compilation failed for package ‘rsocsim’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rsocsim’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/0t/q_68jd055v19hpk23zywzp2r0000gn/T//RtmpxoXvnA/file7d3d74403a37/rsocsim_1.4.1.tar.gz’ had non-zero exit status**

Thank you for reporting that bug!

I just created a new release, please try again to run the line devtools::install_github("MPIDR/rsocsim")

But it is quite strange that the compiler can't find the file src\events.cpp... well, I will wait for your results, maybe the old release was the reason for the error.

Thanks so much for getting back to me. I'm afraid I'm still having getting a very similar error message, I'll paste it below - though it could be something I am doing wrong. I don't have RTools installed as I am on a Mac- is there anything else I should have installed instead? Many thanks

devtools::install_github("MPIDR/rsocsim")
Downloading GitHub repo MPIDR/rsocsim@HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/private/var/folders/0t/q_68jd055v19hpk23zywzp2r0000gn/T/Rtmpsi7jlc/remotes933a4b64950e/MPIDR-rsocsim-f300a68/DESCRIPTION’ (443ms)
─ preparing ‘rsocsim’:
✔ checking DESCRIPTION meta-information
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘rsocsim_1.5.1.tar.gz’

  • installing source package ‘rsocsim’ ...
    ** using staged installation
    ** libs
    clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
    clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c startSocsimWithFile.cpp -o startSocsimWithFile.o
    startSocsimWithFile.cpp:4:10: fatal error: 'src\events.cpp' file not found
    #include "src\events.cpp"
    ^~~~~~~~~~~~~~~~
    1 error generated.
    make: *** [startSocsimWithFile.o] Error 1
    ERROR: compilation failed for package ‘rsocsim’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rsocsim’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/0t/q_68jd055v19hpk23zywzp2r0000gn/T//Rtmpsi7jlc/file933a3875f0cd/rsocsim_1.5.1.tar.gz’ had non-zero exit status

Thank you for trying again. We didn't test this on a Mac before (I will add a warning in the readme).

I read about Rcpp (which is used to compile Socsim in the package) and Mac: It turns out that you have to have Xcode installed. Source: https://teuder.github.io/rcpp4everyone_en/020_install.html

But if that is the fault, the error message is quite strange and noninformative. I will try to replicate that somehow and report back.

Thanks very much for your help. To confirm I have followed the link and installed XCode and the Rcpp package but still get the same error message.

ok, it seems like I have to ask my boss for a mac :)

I am sorry that I can't help you right now, but by April we want to fix all issues like this. I will update this issue when I know more.

Hi,
I fixed some bugs so that it builds on Linux now (there were the same errors).
You may try to install it now again. Otherwise I will get access to a Mac next week and I will be able to test and fix it myself.