web-dev-qa-db-fra.com

Le préprocesseur C ++ "/ lib / cpp" échoue à la vérification de cohérence

J'ai besoin de compiler HDF5, et après le processus de configuration, je reçois cette erreur:

configure: error: C++ preprocessor "/lib/cpp" fails sanity check

Et je sais que j'ai cpp installé sur mon ubuntu

Toute aide serait vraiment appréciée :) Voici le résultat de dpkg --list | grep compiler

ii  gcc                                                        4:4.8.2-1ubuntu6                                    AMD64        GNU C compiler
ii  gcc-4.8                                               4.8.2-19ubuntu1                                     AMD64        GNU C compiler
ii  gfortran                                              4:4.8.2-1ubuntu6                                    AMD64        GNU Fortran 95 compiler
ii  gfortran-4.8                                          4.8.2-19ubuntu1                                     AMD64        GNU Fortran compiler
ii  hardening-includes                                    2.5ubuntu2                                          all          Makefile for enabling compiler flags for security hardening
ii  libllvm3.4:AMD64                                      1:3.4-1ubuntu3                                      AMD64        Modular compiler and toolchain technologies, runtime library
ii  libxkbcommon0:AMD64                                   0.4.1-0ubuntu1                                      AMD64        library interface to the XKB compiler

Et c’est l’erreur que je reçois:

  nazanin@barashka:~/hdf5-1.8.13$ ./configure --with-zlib=/home/nazanin/local    --prefix=/home/nazanin/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking Host system type... x86_64-unknown-linux-gnu
checking Shell variables initial values... done
checking if basename works... yes
checking if xargs works... yes
checking for cached Host... none
checking for config x86_64-unknown-linux-gnu... no
checking for config x86_64-unknown-linux-gnu... no
checking for config unknown-linux-gnu... no
checking for config unknown-linux-gnu... no
checking for config x86_64-linux-gnu... no
checking for config x86_64-linux-gnu... no
checking for config x86_64-unknown... no
checking for config linux-gnu... found
compiler 'gcc' is GNU gcc-4.8.2
checking for config ./config/site-specific/Host-barashka... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking if unsupported combinations of configure options are allowed... no
checking if Fortran interface enabled... no
checking if Fortran 2003 interface enabled... yes
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/home/nazanin/hdf5-1.8.13':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

Dois-je copier le fichier config.log ici? Merci

18
nazanin

Si votre sortie de configuration ressemble à ceci, le compilateur C++ est manquant:

[ ... ]
*** C++ compiler and preprocessor
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/home/ubuntu/.local/share/Trash/files/openmpi-1.4.1':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.


Pour installer le compilateur GNU C++, utilisez
apt-get install g++


La sortie de configure montre que ./configure a essayé de trouver un compilateur C++ en recherchant plusieurs noms de compilateurs connus, un par un.
Au début, nous voyons que g++ est manquant - le code préféré, vérifié en premier.
Mais il continue à essayer de trouver un autre compilateur que vous préférez peut-être utiliser.

23
Volker Siegel

J'ai eu le même type d'erreur lors de l'installation de protobuf-2.5.0 sur centos 7, pour cela je dois installer gcc-c ++ par commande -

 yum install gcc-c++
18
naveen dahiya

Ma solution consistait à créer un lien symbolique dans/lib/cpp qui pointe vers gcc.

ln -sv "$(which gcc)" /lib/cpp

1
sajattack

mettre cela dans votre environnement peut faire l'affaire:

GCC_PATH=#add the root directory to the gcc installation
export CPPFLAGS=-I$GCC_PATH/include/c++/5.3.0:$CPPFLAGS

Si cela fonctionne, cela signifie qu’il existe un conflit de bibliothèque entre la version de gcc que vous souhaitez utiliser et la version de gcc qu’elle tente d’inclure.

0
bhelgs