nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
377 stars 19 forks source link

install package error: invalid value 'gnu++17' in '-std=gnu++17' #39

Closed albert-ying closed 3 years ago

albert-ying commented 3 years ago

Hi, this package looks amazing, I was trying to install it in R.4.0.2, Mac OS 10.15.7.

I encountered following error:

> devtools::install_github("nx10/httpgd")
Downloading GitHub repo nx10/httpgd@HEAD
✔  checking for file ‘/private/var/folders/hx/y7h1vl9d25q9mppm8kwh7t7m0000gp/T/RtmpeWbR0L/remotes313d2f4e8353/nx10-httpgd-0e2b009/DESCRIPTION’ ...
─  preparing ‘httpgd’:
✔  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 ‘httpgd_1.0.0.tar.gz’

* installing *source* package ‘httpgd’ ...
** using staged installation
** libs
clang++ -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilib -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -DFMT_HEADER_ONLY -DRCPP_USE_UNWIND_PROTECT -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/BH/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/later/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/systemfonts/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c AsyncLater.cpp -o AsyncLater.o
error: invalid value 'gnu++17' in '-std=gnu++17'
make: *** [/Library/Frameworks/R.framework/Resources/etc/Makeconf:175: AsyncLater.o] Error 1
ERROR: compilation failed for package ‘httpgd’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/httpgd’
Error: Failed to install 'httpgd' from GitHub:
  (converted from warning) installation of package ‘/var/folders/hx/y7h1vl9d25q9mppm8kwh7t7m0000gp/T//RtmpeWbR0L/file313d6dd61aca/httpgd_1.0.0.tar.gz’ had non-zero exit status

I'm not familiar with C++, and cannot find similar error on google. Could you please help me out? Thank you!

nx10 commented 3 years ago

Hey, thanks for checking out the project. Looks like you just need to update xcode to be able to compile the newer c++ standards. Let us know if it works after that.

albert-ying commented 3 years ago

Hey, thanks for checking out the project. Looks like you just need to update xcode to be able to compile the newer c++ standards. Let us know if it works after that.

Here is my Xcode version. `❯ xcodebuild -version

Xcode 12.1 Build version 12A7403` I reinstalled Xcode and restarted the laptop, everything in .Rprofile are temporary comments out. Still gives me the same error. Any idea what is happening here?

nx10 commented 3 years ago

I am a bit lost here because the std flag is set by the R build system. Also the CI is able to build successfully on R.4.0.3, Mac OS 10.15.7. My only guess is that it's somehow using an old compiler version that is installed somewhere else on your machine.

Maybe try following the instructions under "Removing old installation files" here.

albert-ying commented 3 years ago

Finally solved it. It turns out that somehow the R is using an old version of Clang++ in the Anaconda3 folder. I deleted it, and the error is gone. Thank you!