cmake를 사용한 ROOT 설치가 성공했지만 사용할 수 없습니다.

cmake를 사용한 ROOT 설치가 성공했지만 사용할 수 없습니다.

저는 현재 Ubuntu 16.04.3 LTS를 사용하고 있습니다. 제가 모든 Linux 환경에 대해 완벽하게 알고 있다는 점을 아셔야 합니다. 자세한 내용이 부족하더라도 양해해 주시기 바랍니다.

CERN에서 개발한 C++용 ROOT 라이브러리를 사용하여 작업해야 합니다. 을(를) 설치하는 데 sudo make install실패하여 을(를) 통해 설치해야 했습니다 cmake.

터미널을 실행하고 를 입력하면 root모든 정보가 올바르게 표시되면서 작동하는 것 같습니다.

그러나 다음 makefile(게시물 끝에 포함됨)을 사용하면 다음으로 시작하는 매우 확장된 오류 보고서를 받게 됩니다.

g++ -Wall -c -o Precision_DiffFinie.o -I`~/root-6.12.04/builddir/bin/root-config --incdir`  Precision_DiffFinie.cpp 
 In file included from /home/benjamin/root-6.12.04/builddir/include/RtypesCore.h:23:0,
             from /home/benjamin/root-6.12.04/builddir/include/Rtypes.h:23,
             from /home/benjamin/root-6.12.04/builddir/include/TObject.h:17,
             from /home/benjamin/root-6.12.04/builddir/include/TNamed.h:25,
             from /home/benjamin/root-6.12.04/builddir/include/TGraph.h:24,
             from Precision_DiffFinie.cpp:15:
/home/benjamin/root-6.12.04/builddir/include/RConfig.h:47:4: error: #error "ROOT requires support for C++11 or higher."
 #  error "ROOT requires support for C++11 or higher."
^
 /home/benjamin/root-6.12.04/builddir/include/RConfig.h:49:5: error:  #error "Pass `-std=c++11` as compiler argument."
 #error "Pass `-std=c++11` as compiler argument."
 ^
In file included from /usr/include/c++/5/atomic:38:0,
             from /home/benjamin/root-6.12.04/builddir/include/Rtypes.h:29,
             from /home/benjamin/root-6.12.04/builddir/include/TObject.h:17,
             from /home/benjamin/root-6.12.04/builddir/include/TNamed.h:25,
             from /home/benjamin/root-6.12.04/builddir/include/TGraph.h:24,
             from Precision_DiffFinie.cpp:15:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \

다음 오류는 C++ 컴파일러가 ROOT 라이브러리에 링크할 수 없어 내가 작성한 내용을 이해하지 못하기 때문에 발생한 것 같습니다.

누구든지 문제를 해결하는 방법을 알고 있거나 내가 뭘 잘못하고 있는지 설명해 줄 수 있나요? 나는 모든 일을 잘하려고 노력했지만 분명히 뭔가를 놓쳤습니다. 그리고 나는 지금 내 스스로 아무것도 이해하기에는 너무 오랫동안 이 문제를 해결하려고 노력해 왔습니다.

:makefile

# Makefile pour les exercices de calculs numeriques

# definition du compilateur
GPP=g++ -Wall

# lien vers les fichiers d'en-tete des classes ROOT (ROOTINC) et les librairies (ROOTLIB), cad les fichiers binaires
ROOTINC=-I`root-config --incdir`
ROOTLIB=`root-config --libs`

#La liste des executables a compiler
# les executables sont en .exe pour pouvoir beneficier de la regle generique de conversion de .o en .exe
EXE=MinMaxTableau.exe Optimisation_CalculSerie.exe Precision_DiffFinie.exe MethodeSecante.exe

#######################################################################################

# la premiere instruction du makefile est celle par défaut - quand on tape make sans donner d'argument après

all: ${EXE} 

####################################################################################### 

# Compilation

# Des classes
%.o:%.cpp %.h
    ${GPP} -c -o $@ ${ROOTINC}  $<

# Des programmes principaux
%.o:%.cpp
    ${GPP} -c -o $@ ${ROOTINC}  $<  

#######################################################################################

# Edition des liens
# Regle de conversion de chaque .o en .exe
%.exe: %.o 
    ${GPP} -o $@ $^ ${ROOTLIB}

#######################################################################################

# nettoyage
clean:
    rm -rf *.o ${EXE} *.pdf *.root *.png Print

매우 감사합니다.

답변1

내가 볼CERN에서는 일반 make빌드를 권장하지 않습니다., 하지만 시도해 볼 수 있습니다.

wget https://root.cern.ch/download/root_v6.12.04.source.tar.gz
tar -xzf root_v6.12.04.source.tar.gz

sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \
libxft-dev libxext-dev

sudo apt-get install gfortran libssl-dev libpcre3-dev \
xlibmesa-glu-dev libglew1.5-dev libftgl-dev \
libmysqlclient-dev libfftw3-dev libcfitsio-dev \
graphviz-dev libavahi-compat-libdnssd-dev \
libldap2-dev python-dev libxml2-dev libkrb5-dev \
libgsl0-dev libqt4-dev

./configure
make -j4
sudo make install

또한 귀하의 정보를 위해 - Ubuntu Xenial은저장소의 ROOT 5.34 패키지. 당신은 그들을 설치할 수 있습니다

sudo apt-get install root-system-bin

관련 정보