Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation: error: ‘sort’ is not a member of ‘std’ #13

Closed
PwangAgentWR50 opened this issue Oct 2, 2019 · 6 comments
Closed

installation: error: ‘sort’ is not a member of ‘std’ #13

PwangAgentWR50 opened this issue Oct 2, 2019 · 6 comments

Comments

@PwangAgentWR50
Copy link

@PwangAgentWR50 PwangAgentWR50 commented Oct 2, 2019

When running install.packages("fastmap"), I got this error:

  • installing source package ‘fastmap’ ...
    ** package ‘fastmap’ successfully unpacked and MD5 sums checked
    ** libs
    g++ -m64 -std=gnu++0x -I"/usr/include/R" -DNDEBUG -Ilib/ -I/usr/local/include -DR_NO_REMAP -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c fastmap.cpp -o fastmap.o
    fastmap.cpp: In function ‘SEXPREC* C_map_keys(SEXPREC*, SEXPREC*)’:
    fastmap.cpp:139: error: ‘sort’ is not a member of ‘std’
    fastmap.cpp: In function ‘SEXPREC* C_map_keys_idxs(SEXPREC*, SEXPREC*)’:
    fastmap.cpp:179: error: ‘sort’ is not a member of ‘std’
    make: *** [fastmap.o] Error 1
    ERROR: compilation failed for package ‘fastmap’
  • removing ‘/usr/lib64/R/library/fastmap’

Search "‘sort’ is not a member of ‘std’", many posts said the file should include "#include "
I doubt it's the problem of gcc flags.

@wch
Copy link
Member

@wch wch commented Oct 3, 2019

What platform are you using?

@PwangAgentWR50
Copy link
Author

@PwangAgentWR50 PwangAgentWR50 commented Oct 4, 2019

Amazon Linux on aws.
@wch

@wch
Copy link
Member

@wch wch commented Oct 4, 2019

Can you try installing with either:

remotes::install_github("r-lib/fastmap")
devtools::install_github("r-lib/fastmap")

You'll need to install the remotes or devtools package first, of course. The remotes package has fewer dependencies so will be easier to install.

@PwangAgentWR50
Copy link
Author

@PwangAgentWR50 PwangAgentWR50 commented Oct 7, 2019

@wch Thanks for your suggestion.
I still got the same error.
Is the problem come from g++ flags?

Error:

library(devtools)
Loading required package: usethis
devtools::install_github("r-lib/fastmap")
Downloading GitHub repo r-lib/fastmap@master
checking for file ‘/tmp/RtmpsdI5EG/remotes6b13fd77e96/r-lib-fastmap-da7225f/DESCRIPTION’ ...
─ preparing ‘fastmap’:
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 ‘fastmap_1.0.0.9000.tar.gz’

  • installing source package ‘fastmap’ ...
    ** using staged installation
    ** libs
    g++ -std=gnu++0x -I"/opt/R/3.6.1/lib64/R/include" -DNDEBUG -Ilib/ -I/usr/local/include -DR_NO_REMAP -fpic -g -O2 -c fastmap.cpp -o fastmap.o
    fastmap.cpp: In function ‘SEXPREC* C_map_keys(SEXPREC*, SEXPREC*)’:
    fastmap.cpp:139: error: ‘sort’ is not a member of ‘std’
    fastmap.cpp: In function ‘SEXPREC* C_map_keys_idxs(SEXPREC*, SEXPREC*)’:
    fastmap.cpp:179: error: ‘sort’ is not a member of ‘std’
    make: *** [fastmap.o] Error 1
    ERROR: compilation failed for package ‘fastmap’
  • removing ‘/opt/R/3.6.1/lib64/R/library/fastmap’
    Error: Failed to install 'fastmap' from GitHub:
    (converted from warning) installation of package ‘/tmp/RtmpsdI5EG/file6b137405343b/fastmap_1.0.0.9000.tar.gz’ had non-zero exit status
@wch
Copy link
Member

@wch wch commented Oct 7, 2019

Oh, I'm sorry, I forgot to add the branch name. It should be:

devtools::install_github("r-lib/fastmap@algo-header")
@PwangAgentWR50
Copy link
Author

@PwangAgentWR50 PwangAgentWR50 commented Oct 7, 2019

@wch Thanks.
In terminal I can install fastmap successfully now. The RSConnect UI are still installing fastmap from master branch and fails. After all, I would RS support for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.