Programming/R

[server R] package 설치 시 컴파일 에러 "fatal error: stddef.h: no such file or directory"

김해김씨99대손 2024. 5. 20. 09:53

에러 원인은 컴파일러 버전 간의 충돌로 유추됨 

 

 

해결 방법 

https://stackoverflow.com/questions/54463433/get-rstudio-server-open-source-edition-to-use-alternative-gcc-version

 

Get RStudio Server open source edition to use alternative gcc version

I have the open source edition of RStudio Server installed on a RHEL7 machine. Since I need to install R packages that requires a more recent version of gcc/g++ than the one provided (4.8.5) I've

stackoverflow.com

# 컴파일러 설치 (이미 설치되어 있다면 생략)
yum install centos-release-scl
yum install devtoolset-8-gcc devtoolset-8-gcc-c++

# "~/.R/Makevars" 문서에 아래 내용 추가 
CC=/opt/rh/devtoolset-8/root/usr/bin/gcc # devtoolset을 사용하지 않으면, 기존에 설치된 gcc의 위치를 적어주기
CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ -std=c++11
CXX11=/opt/rh/devtoolset-8/root/usr/bin/g++ -std=c++11
CXX14=/opt/rh/devtoolset-8/root/usr/bin/g++ -std=c++1y
CXX14FLAGS=-O3 -march=native -mtune=native -fPIC

 

해결

 

 

 

서버 R 괜히 업데이트했다........... 내 주말..

반응형