dorianps / LESYMAP

Lesion to Symptom Mapping in R
https://dorianps.github.io/LESYMAP/
Apache License 2.0
33 stars 11 forks source link

LESYMAP Compilation Failure (Mac OS 10.15.6, R version 4.0.3) #25

Closed gliomas closed 4 years ago

gliomas commented 4 years ago

I keep getting the error below when I try to compile LESYMAP from GitHub. I've tried all three methods to no avail. Compliation of ANTsR, ANTsRCore and ITKR work fine.

`In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo:21: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_check.hpp:50:4: error: "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"

error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"`

I believe the issue is that this command clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c BMfast.cpp -o BMfast.o

needs to start with clang ++ -std=c++11 but I don't know how to do that Any help would be very appreciated! Thank you

dorianps commented 4 years ago

This is not something I am familiar with because I am not a Mac user. But from what I see online, RcppArmadillow just changed the minimum requirements to C++11, see here. You are also using R version 4, which is not brand new but I am not sure if it has something to do with it.

The first thing to try is the instructions on how to set up RcppArmadillo here. These probably refer to the same issue you are encountering, and is also mentioned in the issues RcppArmadillo itself.

Then, I see three other potential solutions:

  1. Get Lesymap locally, and edit src/Makevars to add the std flag you mention, as shown here. Then do the manual local installation with R CMD INSTALL LESYMAP from the parent folder.
  2. Uninstall RcppArmadillo and install an older version that does not have the C11 requirement.
  3. Try installing an an older R like v3.6.X rather than the R v4.X.

Hopefully the very first instructions will have the help you need. Let me know if you manage to fix it, and how.

gliomas commented 4 years ago

YES!!!!!! I went with 1. Downloaded the master from GitHub and edited MakeVars. Then used devtool install_local in R and pointed to the local directory. Ran into one more issue later in the compilation where I was missing gfortran but that was an easy fix. Thanks a ton