Error when bootstrapping cmake cannot find appropriate c compiler on this system

I'm trying to build CMake 3.7.2 on my Ubuntu 18.04.1 LTS (32 bit machine), but the first stop ./bootstrap failed:

I’m trying to build CMake 3.7.2 on my Ubuntu 18.04.1 LTS (32 bit machine), but the first stop ./bootstrap failed:

$ ./bootstrap
---------------------------------------------
CMake 3.7.2, Copyright 2000-2016 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc 
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /home/xxx/Downloads/cmake-3.7.2/Bootstrap.cmk/cmake_bootstrap.log

This happens even if I export CXX=/usr/bin/g++ or export CXX=/usr/bin/c++. The log file says that stdlib.h not found and iostream.h not found, but they are actually installed in my system as:

$ locate stdlib.h
/usr/include/stdlib.h
/usr/include/c++/5/tr1/stdlib.h
/usr/include/c++/7/stdlib.h
/usr/include/c++/7/tr1/stdlib.h
/usr/include/freetype2/freetype/config/ftstdlib.h
/usr/include/i386-linux-gnu/bits/stdlib.h

$ locate iostream.h
/usr/include/glib-2.0/gio/gfileiostream.h
/usr/include/glib-2.0/gio/giostream.h
/usr/include/glib-2.0/gio/gsimpleiostream.h

Below is the actual cmake_bootstrap.log:

Checking for GNU toolchain
Try: gcc
Line: gcc  cmake_bootstrap_18664_test.c -o cmake_bootstrap_18664_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
Test succeeded
Try: g++
Line: g++  cmake_bootstrap_18664_test.cpp -o cmake_bootstrap_18664_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
Test succeeded
Try: gcc
Line: gcc  cmake_bootstrap_18664_test.c -o cmake_bootstrap_18664_test
----------  file   -----------------------

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#include<stdio.h>

#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc-1;
}

------------------------------------------
1
Test succeeded
Try: g++
Line: g++  -DTEST1 cmake_bootstrap_18664_test.cxx -o cmake_bootstrap_18664_test
----------  file   -----------------------

#if defined(TEST1)
# include <iostream>
#else
# include <iostream.h>
#endif

class NeedCXX
{
public:
  NeedCXX() { this->Foo = 1; }
  int GetFoo() { return this->Foo; }
private:
  int Foo;
};
int main()
{
  NeedCXX c;
#ifdef TEST3
  cout << c.GetFoo() << endl;
#else
  std::cout << c.GetFoo() << std::endl;
#endif
  return 0;
}

------------------------------------------
In file included from /usr/include/c++/7/ext/string_conversions.h:41:0,
                 from /usr/include/c++/7/bits/basic_string.h:6349,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from cmake_bootstrap_18664_test.cxx:3:
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
Test failed to compile
Try: g++
Line: g++  -DTEST2 cmake_bootstrap_18664_test.cxx -o cmake_bootstrap_18664_test
----------  file   -----------------------

#if defined(TEST1)
# include <iostream>
#else
# include <iostream.h>
#endif

class NeedCXX
{
public:
  NeedCXX() { this->Foo = 1; }
  int GetFoo() { return this->Foo; }
private:
  int Foo;
};
int main()
{
  NeedCXX c;
#ifdef TEST3
  cout << c.GetFoo() << endl;
#else
  std::cout << c.GetFoo() << std::endl;
#endif
  return 0;
}

------------------------------------------
cmake_bootstrap_18664_test.cxx:5:11: fatal error: iostream.h: No such file or directory
 # include <iostream.h>
           ^~~~~~~~~~~~
compilation terminated.
Test failed to compile
Try: g++
Line: g++  -DTEST3 cmake_bootstrap_18664_test.cxx -o cmake_bootstrap_18664_test
----------  file   -----------------------

#if defined(TEST1)
# include <iostream>
#else
# include <iostream.h>
#endif

class NeedCXX
{
public:
  NeedCXX() { this->Foo = 1; }
  int GetFoo() { return this->Foo; }
private:
  int Foo;
};
int main()
{
  NeedCXX c;
#ifdef TEST3
  cout << c.GetFoo() << endl;
#else
  std::cout << c.GetFoo() << std::endl;
#endif
  return 0;
}

------------------------------------------
cmake_bootstrap_18664_test.cxx:5:11: fatal error: iostream.h: No such file or directory
 # include <iostream.h>
           ^~~~~~~~~~~~
compilation terminated.
Test failed to compile

Similar problem happened when I tried to install CMake 3.12.2.
I would greatly appreciate any help since I need at least CMake 3.7.2 for various Julia packages.

Here’s the error I get when running ./bootstrap

---------------------------------------------
CMake 3.6.1, Copyright 2000-2016 Kitware, Inc.
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.

---------------------------------------------
Log of errors: /home2/virionrp/cmake-3.6.1/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

Here’s what the log says:

Checking for GNU toolchain
Try: gcc
Line: gcc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
./bootstrap: line 572: /usr/bin/gcc: Permission denied
Test failed to compile
Checking for Clang toolchain
Try: clang
Line: clang  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
./bootstrap: line 572: clang: command not found
Test failed to compile
Checking for XL toolchain
Try: xlc
Line: xlc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
./bootstrap: line 572: xlc: command not found
Test failed to compile
Checking for PGI toolchain
Try: pgcc
Line: pgcc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
./bootstrap: line 572: pgcc: command not found
Test failed to compile
Checking for PathScale toolchain
Try: pathcc
Line: pathcc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------
int main() { return 0; }
------------------------------------------
./bootstrap: line 572: pathcc: command not found
Test failed to compile
Try: cc
Line: cc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#include<stdio.h>

#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc-1;
}

------------------------------------------
./bootstrap: line 572: /usr/bin/cc: Permission denied
Test failed to compile
Try: gcc
Line: gcc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#include<stdio.h>

#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc-1;
}

------------------------------------------
./bootstrap: line 572: /usr/bin/gcc: Permission denied
Test failed to compile
Try: xlc
Line: xlc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#include<stdio.h>

#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc-1;
}

------------------------------------------
./bootstrap: line 572: xlc: command not found
Test failed to compile
Try: icc
Line: icc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#include<stdio.h>

#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc-1;
}

------------------------------------------
./bootstrap: line 572: icc: command not found
Test failed to compile
Try: tcc
Line: tcc  cmake_bootstrap_117682_test.c -o cmake_bootstrap_117682_test
----------  file   -----------------------

#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif

#include<stdio.h>

#if defined(__CLASSIC_C__)
int main(argc, argv)
  int argc;
  char* argv[];
#else
int main(int argc, char* argv[])
#endif
{
  printf("%d%c", (argv != 0), (char)0x0a);
  return argc-1;
}

------------------------------------------
./bootstrap: line 572: tcc: command not found
Test failed to compile

I’m really not good with this stuff so any help would be greatly appreciated.

View previous topic :: View next topic  
Author Message
unclecristian
n00b
n00b

Joined: 11 Mar 2018
Posts: 9

PostPosted: Mon Mar 12, 2018 12:19 am    Post subject: Emerge fails; cannot find C++ compiler. Reply with quote

Hi. I am new to this, my first question on a Linux forum.

After setting up a server, I tried to emerge apache, and one of the dependencies, dev-util/cmake-3.9.6 failed saying it cannot find a C++ compiler. I understand that if I post all the output and the recommended files someone might be so nice to help me. Thanks a lot in advance.

Here is the output of the emerge:

Code:

# emerge —ask www-servers/apache

 * IMPORTANT: 11 news items need reading for repository ‘gentoo’.

 * Use eselect news read to view new items.

These are the packages that would be merged, in order:

Calculating dependencies… done!

[ebuild  N     ] dev-util/cmake-3.9.6  USE=»ncurses -doc -emacs -qt5 -server -system-jsoncpp {-test}»

[ebuild  N     ] dev-db/mariadb-10.1.29  USE=»backup openssl pam perl server xml -bindist -cracklib -debug -embedded -extraengine -galera -innodb-lz4 -innodb-lzo -innodb-snappy -jdbc -jemalloc -kerberos -latin1 -libressl (-mroonga) -odbc -oqgraph -profiling (-selinux) -sphinx -sst-mariabackup -sst-rsync -sst-xtrabackup -static -static-libs -systemd -systemtap -tcmalloc {-test} -tokudb -yassl» ABI_X86=»(64) -32 (-x32)»

[ebuild  N     ] virtual/mysql-5.6-r9  USE=»server -embedded -static»

[ebuild  N     ] virtual/libmysqlclient-18  USE=»-static-libs» ABI_X86=»(64) -32 (-x32)»

[ebuild  N     ] dev-perl/DBD-mysql-4.41.0  USE=»ssl -embedded {-test}»

[ebuild  N     ] dev-libs/apr-util-1.5.4  USE=»berkdb gdbm mysql -doc -freetds -ldap -nss -odbc -openssl -postgres -sqlite -static-libs»

[ebuild  N     ] app-admin/apache-tools-2.4.27  USE=»ssl -libressl»

[ebuild  N     ] www-servers/apache-2.4.27-r1  USE=»ssl -debug -doc -ldap -libressl (-selinux) -static -suexec -threads» APACHE2_MODULES=»actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias -access_compat -asis -auth_digest -authn_dbd -authz_dbd -cache_disk -cache_socache -cern_meta -charset_lite -dbd -dumpio -http2 -ident -imagemap -lbmethod_bybusyness -lbmethod_byrequests -lbmethod_bytraffic -lbmethod_heartbeat -log_forensic -macro -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_fcgi -proxy_ftp -proxy_html -proxy_http -proxy_scgi -proxy_wstunnel -ratelimit -remoteip -reqtimeout -slotmem_shm -substitute -version -xml2enc» APACHE2_MPMS=»prefork -event -worker»

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Running pre-merge checks for dev-db/mariadb-10.1.29

>>> Emerging (1 of 8) dev-util/cmake-3.9.6::gentoo

 * cmake-3.9.6.tar.gz BLAKE2B SHA512 size ;-) …                                                                                                                  [ ok ]

>>> Unpacking source…

>>> Unpacking cmake-3.9.6.tar.gz to /var/tmp/portage/dev-util/cmake-3.9.6/work

>>> Source unpacked in /var/tmp/portage/dev-util/cmake-3.9.6/work

>>> Preparing source in /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6 …

 * Applying cmake-3.4.0_rc1-darwin-bundle.patch …                                                                                                                [ ok ]

 * Applying cmake-3.9.0_rc2-prefix-dirs.patch …                                                                                                                  [ ok ]

 * Applying cmake-3.1.0-darwin-isysroot.patch …                                                                                                                  [ ok ]

 * Applying cmake-3.9.0_rc2-FindImageMagick.patch …                                                                                                              [ ok ]

 * Applying cmake-3.0.0-FindBLAS.patch …                                                                                                                         [ ok ]

 * Applying cmake-3.8.0_rc2-FindBoost-python.patch …                                                                                                             [ ok ]

 * Applying cmake-3.0.2-FindLAPACK.patch …                                                                                                                       [ ok ]

 * Applying cmake-3.5.2-FindQt4.patch …                                                                                                                          [ ok ]

 * Applying cmake-2.8.10.2-FindPythonLibs.patch …                                                                                                                [ ok ]

 * Applying cmake-3.9.0_rc2-FindPythonInterp.patch …                                                                                                             [ ok ]

———————————————

CMake 3.9.6, Copyright 2000-2017 Kitware, Inc. and Contributors

C compiler on this system is: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -std=gnu11

———————————————

Error when bootstrapping CMake:

Cannot find appropriate C++ compiler on this system.

Please specify one using environment variable CXX.

See cmake_bootstrap.log for compilers attempted.

———————————————

Log of errors: /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6/Bootstrap.cmk/cmake_bootstrap.log

———————————————

 * ERROR: dev-util/cmake-3.9.6::gentoo failed (prepare phase):

 *   Bootstrap failed

 *

 * Call stack:

 *     ebuild.sh, line  124:  Called src_prepare

 *   environment, line 3451:  Called cmake_src_bootstrap

 *   environment, line 1004:  Called die

 * The specific snippet of code:

 *       ${CONFIG_SHELL:-sh} ./bootstrap —prefix=»${T}/cmakestrap/» ${par_arg} || die «Bootstrap failed»

 *

 * If you need support, post the output of `emerge —info ‘=dev-util/cmake-3.9.6::gentoo’`,

 * the complete build log and the output of `emerge -pqv ‘=dev-util/cmake-3.9.6::gentoo’`.

 * The complete build log is located at ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/environment’.

 * Working directory: ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6’

 * S: ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6’

>>> Failed to emerge dev-util/cmake-3.9.6, Log file:

>>>  ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/build.log’

 * Messages for package dev-util/cmake-3.9.6:

 * ERROR: dev-util/cmake-3.9.6::gentoo failed (prepare phase):

 *   Bootstrap failed

 *

 * Call stack:

 *     ebuild.sh, line  124:  Called src_prepare

 *   environment, line 3451:  Called cmake_src_bootstrap

 *   environment, line 1004:  Called die

 * The specific snippet of code:

 *       ${CONFIG_SHELL:-sh} ./bootstrap —prefix=»${T}/cmakestrap/» ${par_arg} || die «Bootstrap failed»

 *

 * If you need support, post the output of `emerge —info ‘=dev-util/cmake-3.9.6::gentoo’`,

 * the complete build log and the output of `emerge -pqv ‘=dev-util/cmake-3.9.6::gentoo’`.

 * The complete build log is located at ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/environment’.

 * Working directory: ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6’

 * S: ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6’

The emerge —info ‘=dev-util/cmake-3.9.6::gentoo output:

Code:

Portage 2.3.24 (python 3.5.4-final-0, default/linux/amd64/17.0, gcc-6.4.0, glibc-2.25-r10, 4.9.76-gentoo-r1 x86_64)

=================================================================

                         System Settings

=================================================================

System uname: Linux-4.9.76-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6700_@_2.66GHz-with-gentoo-2.4.1

KiB Mem:     8175048 total,   6542056 free

KiB Swap:    1048572 total,   1048572 free

Timestamp of repository gentoo: Sun, 11 Mar 2018 17:00:01 +0000

Head commit of repository gentoo: ddcca142e8aeffdba8a5a40d886f3f8254252be4

sh bash 4.4_p12

ld GNU ld (Gentoo 2.29.1 p3) 2.29.1

app-shells/bash:          4.4_p12::gentoo

dev-lang/perl:            5.24.3::gentoo

dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo

dev-util/pkgconfig:       0.29.2::gentoo

sys-apps/baselayout:      2.4.1-r2::gentoo

sys-apps/openrc:          0.34.11::gentoo

sys-apps/sandbox:         2.12::gentoo

sys-devel/autoconf:       2.69-r4::gentoo

sys-devel/automake:       1.15.1-r1::gentoo

sys-devel/binutils:       2.29.1-r1::gentoo

sys-devel/gcc:            6.4.0-r1::gentoo

sys-devel/gcc-config:     1.8-r1::gentoo

sys-devel/libtool:        2.4.6-r3::gentoo

sys-devel/make:           4.2.1::gentoo

sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)

sys-libs/glibc:           2.25-r10::gentoo

Repositories:

gentoo

    location: /usr/portage

    sync-type: rsync

    sync-uri: rsync://rsync.gentoo.org/gentoo-portage

    priority: -1000

    sync-rsync-verify-metamanifest: no

    sync-rsync-extra-opts:

ACCEPT_KEYWORDS=»amd64″

ACCEPT_LICENSE=»* -@EULA»

CBUILD=»x86_64-pc-linux-gnu»

CFLAGS=»-march=native -O2 -pipe»

CHOST=»x86_64-pc-linux-gnu»

CONFIG_PROTECT=»/etc»

CONFIG_PROTECT_MASK=»/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo»

CXXFLAGS=»{CFLAGS}»

DISTDIR=»/usr/portage/distfiles»

FCFLAGS=»-O2 -pipe»

FEATURES=»assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr»

FFLAGS=»-O2 -pipe»

GENTOO_MIRRORS=»http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/»

LANG=»en_US.utf8″

LDFLAGS=»-Wl,-O1 -Wl,—as-needed»

MAKEOPTS=»-j4″

PKGDIR=»/usr/portage/packages»

PORTAGE_CONFIGROOT=»/»

PORTAGE_RSYNC_OPTS=»—recursive —links —safe-links —perms —times —omit-dir-times —compress —force —whole-file —delete —stats —human-readable —timeout=180 —exclude=/distfiles —exclude=/local —exclude=/packages —exclude=/.git»

PORTAGE_TMPDIR=»/var/tmp»

USE=»acl amd64 apache2 berkdb bzip2 cli crypt ctype cxx dri fortran ftp gd gdbm git iconv intl ipv6 jit modules multilib mysql mysqli ncurses nls nptl openmp pam pcre pdo perl python readline seccomp soap ssl tcpd tokenizer truetype unicode xattr xml xmlreader xmlrpc xsl zip zlib» ABI_X86=»64″ ALSA_CARDS=»ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci» APACHE2_MODULES=»authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias» APACHE2_MPMS=»prefork» CALLIGRA_FEATURES=»kexi words flow plan sheets stage tables krita karbon braindump author» COLLECTD_PLUGINS=»df interface irq load memory rrdtool swap syslog» CPU_FLAGS_X86=»mmx mmxext sse sse2″ ELIBC=»glibc» GPSD_PROTOCOLS=»ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx» INPUT_DEVICES=»libinput keyboard mouse» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» LIBREOFFICE_EXTENSIONS=»presenter-console presenter-minimizer» OFFICE_IMPLEMENTATION=»libreoffice» PHP_TARGETS=»php5-6 php7-0″ POSTGRES_TARGETS=»postgres9_5″ PYTHON_SINGLE_TARGET=»python3_5″ PYTHON_TARGETS=»python2_7 python3_5″ RUBY_TARGETS=»ruby22 ruby23″ USERLAND=»GNU» VIDEO_CARDS=»amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l» XTABLES_ADDONS=»quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account»

Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

The emerge -pqv ‘=dev-util/cmake-3.9.6::gentoo output:

Code:

[ebuild  N    ] dev-util/cmake-3.9.6  USE=»ncurses -doc -emacs -qt5 -server -system-jsoncpp {-test}»

 * IMPORTANT: 11 news items need reading for repository ‘gentoo’.

 * Use eselect news read to view new items.

The build.log

Code:

[32;01m * [39;49;00mPackage:    dev-util/cmake-3.9.6

[32;01m * [39;49;00mRepository: gentoo

[32;01m * [39;49;00mMaintainer: kde@gentoo.org

[32;01m * [39;49;00mUSE:        abi_x86_64 amd64 elibc_glibc kernel_linux ncurses userland_GNU

[32;01m * [39;49;00mFEATURES:   preserve-libs sandbox userpriv usersandbox

>>> Unpacking source…

>>> Unpacking cmake-3.9.6.tar.gz to /var/tmp/portage/dev-util/cmake-3.9.6/work

>>> Source unpacked in /var/tmp/portage/dev-util/cmake-3.9.6/work

>>> Preparing source in /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6 …

 [32;01m*[0m Applying cmake-3.4.0_rc1-darwin-bundle.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.9.0_rc2-prefix-dirs.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.1.0-darwin-isysroot.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.9.0_rc2-FindImageMagick.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.0.0-FindBLAS.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.8.0_rc2-FindBoost-python.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.0.2-FindLAPACK.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.5.2-FindQt4.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-2.8.10.2-FindPythonLibs.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

 [32;01m*[0m Applying cmake-3.9.0_rc2-FindPythonInterp.patch …

[A[162C [34;01m[ [32;01mok[34;01m ][0m

———————————————

CMake 3.9.6, Copyright 2000-2017 Kitware, Inc. and Contributors

C compiler on this system is: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -std=gnu11

———————————————

Error when bootstrapping CMake:

Cannot find appropriate C++ compiler on this system.

Please specify one using environment variable CXX.

See cmake_bootstrap.log for compilers attempted.

———————————————

Log of errors: /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6/Bootstrap.cmk/cmake_bootstrap.log

———————————————

 [31;01m*[0m ERROR: dev-util/cmake-3.9.6::gentoo failed (prepare phase):

 [31;01m*[0m   Bootstrap failed

 [31;01m*[0m

 [31;01m*[0m Call stack:

 [31;01m*[0m     ebuild.sh, line  124:  Called src_prepare

 [31;01m*[0m   environment, line 3451:  Called cmake_src_bootstrap

 [31;01m*[0m   environment, line 1004:  Called die

 [31;01m*[0m The specific snippet of code:

 [31;01m*[0m       ${CONFIG_SHELL:-sh} ./bootstrap —prefix=»${T}/cmakestrap/» ${par_arg} || die «Bootstrap failed»

 [31;01m*[0m

 [31;01m*[0m If you need support, post the output of `emerge —info ‘=dev-util/cmake-3.9.6::gentoo’`,

 [31;01m*[0m the complete build log and the output of `emerge -pqv ‘=dev-util/cmake-3.9.6::gentoo’`.

 [31;01m*[0m The complete build log is located at ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/build.log’.

 [31;01m*[0m The ebuild environment file is located at ‘/var/tmp/portage/dev-util/cmake-3.9.6/temp/environment’.

 [31;01m*[0m Working directory: ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6’

 [31;01m*[0m S: ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6’



As I wrote earlier, thanks a lot in advance.

Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51961
Location: 56N 3W

PostPosted: Mon Mar 12, 2018 12:30 am    Post subject: Reply with quote

unclecristian,

Welcome to Gentoo.

What does

Code:
 gcc-config -l

show.

You probably only have one version.

Select it again to rewrite the symbolic links.

You should have a C++ compiler, you have USE=cxx set.

The parts of your compiler are in /usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0/

I have

Code:
$ ls /usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0/ -l

total 6296

lrwxrwxrwx 1 root root     23 Mar 12 00:12 c++ -> x86_64-pc-linux-gnu-c++

lrwxrwxrwx 1 root root     23 Mar 12 00:12 cpp -> x86_64-pc-linux-gnu-cpp

lrwxrwxrwx 1 root root     23 Mar 12 00:12 g++ -> x86_64-pc-linux-gnu-g++

lrwxrwxrwx 1 root root     23 Mar 12 00:12 gcc -> x86_64-pc-linux-gnu-gcc

-rwxr-xr-x 2 root root  27024 Mar 12 00:12 gcc-ar

-rwxr-xr-x 2 root root  27024 Mar 12 00:12 gcc-nm

-rwxr-xr-x 2 root root  27024 Mar 12 00:12 gcc-ranlib

lrwxrwxrwx 1 root root     24 Mar 12 00:12 gcov -> x86_64-pc-linux-gnu-gcov

-rwxr-xr-x 1 root root 466256 Mar 12 00:12 gcov-dump

-rwxr-xr-x 1 root root 486800 Mar 12 00:12 gcov-tool

lrwxrwxrwx 1 root root     28 Mar 12 00:12 gfortran -> x86_64-pc-linux-gnu-gfortran

-rwxr-xr-x 2 root root 956664 Mar 12 00:12 x86_64-pc-linux-gnu-c++

-rwxr-xr-x 1 root root 956664 Mar 12 00:12 x86_64-pc-linux-gnu-cpp

-rwxr-xr-x 2 root root 956664 Mar 12 00:12 x86_64-pc-linux-gnu-g++

-rwxr-xr-x 1 root root 956664 Mar 12 00:12 x86_64-pc-linux-gnu-gcc

lrwxrwxrwx 1 root root     23 Mar 12 00:12 x86_64-pc-linux-gnu-gcc-6.4.0 -> x86_64-pc-linux-gnu-gcc

-rwxr-xr-x 2 root root  27024 Mar 12 00:12 x86_64-pc-linux-gnu-gcc-ar

-rwxr-xr-x 2 root root  27024 Mar 12 00:12 x86_64-pc-linux-gnu-gcc-nm

-rwxr-xr-x 2 root root  27024 Mar 12 00:12 x86_64-pc-linux-gnu-gcc-ranlib

-rwxr-xr-x 1 root root 527800 Mar 12 00:12 x86_64-pc-linux-gnu-gcov

-rwxr-xr-x 1 root root 956664 Mar 12 00:12 x86_64-pc-linux-gnu-gfortran


_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19773

PostPosted: Mon Mar 12, 2018 12:33 am    Post subject: Re: Emerge fails; cannot find C++ compiler. Reply with quote

unclecristian wrote:
Code:
Error when bootstrapping CMake:

Cannot find appropriate C++ compiler on this system.

Please specify one using environment variable CXX.

This message is misleading to the point of being simply wrong.

unclecristian wrote:
Code:
CFLAGS=»-march=native -O2 -pipe»

CXXFLAGS=»{CFLAGS}»

If you want to set CXXFLAGS to the same as CFLAGS, use ${CFLAGS}, not {CFLAGS}. As is, you set CXXFLAGS to the literal string {CFLAGS}, which no standard compiler will understand. That causes the compilation to fail, which CMake then misleadingly reports as «Compiler not found» rather than the more correct «Compiler found, but not usable» or the even more helpful «Compiler found, unusable with your current configuration, but usable with minimal configuration.»

Solution: change your CXXFLAGS to a valid value.

Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51961
Location: 56N 3W

PostPosted: Mon Mar 12, 2018 12:35 am    Post subject: Reply with quote

Hu,

Well caught!
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

unclecristian
n00b
n00b

Joined: 11 Mar 2018
Posts: 9

PostPosted: Mon Mar 12, 2018 12:08 pm    Post subject: Reply with quote

Wow! It worked! Thank you.

I mean both things worked.

1. Correct setting of the CXXFLAGS variable made things work. It came from /etc/portage/make.conf, and I could swear I never touched that line, but I am not absolutely sure, I messed up a lot with the system. It seems the original file, that came from the installation, had the line:

Code:

CXXFLAGS=»{CFLAGS}»



withe the dollar sign missing. Since I am not sure, I don’t think I should submit a bug report. If anyone installs a new system, they should check their default make.conf for the missing dollar sign.

2. The community support worked. Thanks a lot. Gentoo just won one more convert. :—)

Back to top

View user's profile Send private message

iamben
Apprentice
Apprentice

Joined: 10 May 2004
Posts: 275

PostPosted: Mon Mar 12, 2018 1:48 pm    Post subject: Reply with quote

unclecristian wrote:
Wow! It worked! Thank you.

I mean both things worked.

1. Correct setting of the CXXFLAGS variable made things work. It came from /etc/portage/make.conf, and I could swear I never touched that line, but I am not absolutely sure, I messed up a lot with the system. It seems the original file, that came from the installation, had the line:

Code:

CXXFLAGS=»{CFLAGS}»



withe the dollar sign missing. Since I am not sure, I don’t think I should submit a bug report. If anyone installs a new system, they should check their default make.conf for the missing dollar sign.

2. The community support worked. Thanks a lot. Gentoo just won one more convert. :—)



Since January or so, new stage3s are built with catalyst-3.x, which (currently, for now) doesn’t set CXXFLAGS at all, as far as I know. Which stage3 tarall did you use? Is it possible you tried to add CXXFLAGS since it was missing, and just typoed or got a bad copy/paste?

Back to top

View user's profile Send private message

unclecristian
n00b
n00b

Joined: 11 Mar 2018
Posts: 9

PostPosted: Mon Mar 12, 2018 7:36 pm    Post subject: Reply with quote

The image I used was install-amd64-minimal-20180206T214502Z.iso. Like I said earlier, I don’t think I ever edited that line, but I am not absolutely sure. I might have hit an x by mistake, while in vi, with the cursor on that dollar sign. Or maybe I put it in wrong and I don’t remember. Sorry I cannot help.
Back to top

View user's profile Send private message

John R. Graham
Administrator
Administrator

Joined: 08 Mar 2005
Posts: 10519
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Mar 12, 2018 8:01 pm    Post subject: Reply with quote

make.conf comes from the Stage, not from the install ISO so if it’s anywhere it’s there. You can unpack it to some temporary place on your now-running install & check.

— John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.

Back to top

View user's profile Send private message

unclecristian
n00b
n00b

Joined: 11 Mar 2018
Posts: 9

PostPosted: Mon Mar 12, 2018 11:28 pm    Post subject: Reply with quote

It was my fault. I checked the tarball, and the /etc/portage/make.conf is nice and clean. I must have put the wrong line in there, I just don’t remember. Sorry to bother so many nice people for my own typo. But thanks for the help to get over that mistake.
Back to top

View user's profile Send private message

John R. Graham
Administrator
Administrator

Joined: 08 Mar 2005
Posts: 10519
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Mar 13, 2018 12:42 am    Post subject: Reply with quote

Hey, no problem. Gentoo is definitely the deep end. Just consider us your lifeguards. ;)

— John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19773

PostPosted: Tue Mar 13, 2018 1:41 am    Post subject: Reply with quote

This thread brings up a real problem, though. As I mentioned above, the CMake error message is misleading to the point of being wrong. You might have solved this on your own if the error message actually pointed you in the right direction. This seems like an area that CMake could be improved.
Back to top

View user's profile Send private message

John R. Graham
Administrator
Administrator

Joined: 08 Mar 2005
Posts: 10519
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Mar 13, 2018 3:14 am    Post subject: Reply with quote

Well, yes, but I’m mostly just thinking of it as now having discovered what cmake’s version of «C compiler cannot create executables» is.

— John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.

Back to top

View user's profile Send private message

benchaney
n00b
n00b

Joined: 28 Dec 2017
Posts: 30

PostPosted: Tue Mar 13, 2018 4:51 am    Post subject: Reply with quote

I was attempting to reproduce this and submit a PR upstream. This is the error I got:

Code:
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:45 (message):

  The C++ compiler

    «/usr/bin/x86_64-pc-linux-gnu-g++»

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/CMakeFiles/CMakeTmp

   

    Run Build Command:»/usr/bin/gmake» «cmTC_97230/fast»

    /usr/bin/gmake -f CMakeFiles/cmTC_97230.dir/build.make CMakeFiles/cmTC_97230.dir/build

    gmake[1]: Entering directory ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/CMakeFiles/CMakeTmp’

    Building CXX object CMakeFiles/cmTC_97230.dir/testCXXCompiler.cxx.o

    /usr/bin/x86_64-pc-linux-gnu-g++    -DNDEBUG {CFLAGS}    -o CMakeFiles/cmTC_97230.dir/testCXXCompiler.cxx.o -c /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

    x86_64-pc-linux-gnu-g++: error: {CFLAGS}: No such file or directory

    gmake[1]: *** [CMakeFiles/cmTC_97230.dir/build.make:66: CMakeFiles/cmTC_97230.dir/testCXXCompiler.cxx.o] Error 1

    gmake[1]: Leaving directory ‘/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/CMakeFiles/CMakeTmp’

    gmake: *** [Makefile:126: cmTC_97230/fast] Error 2

   

 

  CMake will not be able to correctly generate this project.

Call Stack (most recent call first):

  CMakeLists.txt:11 (project)

This seems like a much more sensible error, so i’m not sure what caused the issue for OP.

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19773

PostPosted: Wed Mar 14, 2018 2:07 am    Post subject: Reply with quote

benchaney wrote:
I was attempting to reproduce this and submit a PR upstream.

Thank you for taking the initiative on this.

Yes, the error you hit looks much better. Perhaps most people with broken inputs hit the error you saw, and the OP is an outlier. From OP’s output, it looks like the CMake «bootstrap» script is responsible for the misleading error message. It looks like the Gentoo ebuild only calls this if you do not already have a somewhat recent version of CMake installed:

cmake-3.9.6.ebuild:
    67   cmake_src_bootstrap() {

    91      ${CONFIG_SHELL:-sh} ./bootstrap

    92         —prefix=»${T}/cmakestrap/»

    93         ${par_arg}

    94         || die «Bootstrap failed»

   125   src_prepare() {

   133      if ! has_version >=${CATEGORY}/${PN}-3.4.0_rc1 ; then

   134         CMAKE_BINARY=»${S}/Bootstrap.cmk/cmake»

   135         cmake_src_bootstrap

   136      fi

So, you probably already have cmake-3.4.0_rc1 or better, so the ebuild skipped calling bootstrap for you. His system was a fresh install without any working CMake, so he hit the bootstrap code.

Back to top

View user's profile Send private message

benchaney
n00b
n00b

Joined: 28 Dec 2017
Posts: 30

PostPosted: Wed Mar 14, 2018 4:55 am    Post subject: Reply with quote

You appear to be correct. I could have sworn I considered this and ruled it out, but I must have made a mistake somewhere. I have successfully reproduced the issue on upstream’s master branch.

I’ve opened an issue and a merge request with cmake’s upstream.

The issue is here: https://gitlab.kitware.com/cmake/cmake/issues/17826

The merge request is here: https://gitlab.kitware.com/cmake/cmake/merge_requests/1850

Edit: Interestingly the error message has been changed between cmake-3.9.6 and the current master branch, but it is still misleading.

Back to top

View user's profile Send private message

unclecristian
n00b
n00b

Joined: 11 Mar 2018
Posts: 9

PostPosted: Wed Mar 14, 2018 1:22 pm    Post subject: Reply with quote

Trying to help, although I barely know what I am doing: a day or two before the error in the OP I had a similar error while emerging dev-libs/libpcre-8.41-r1

It could be that at the time the CXXFLAGS variable was not set at all, as opposed to being set to the wrong value, I don’t remember. But emerging libpcre worked fine after setting CXXFLAGS to the correct value. Error message was:

configure: error: You need a C++ compiler for C++ support.

Here is the output I saved at the time. Does it help?

Code:

>>> Emerging (5 of 14) dev-libs/libpcre-8.41-r1::gentoo

 * pcre-8.41.tar.bz2 BLAKE2B SHA512 size ;-) …                                                                [ ok ]

>>> Unpacking source…

>>> Unpacking pcre-8.41.tar.bz2 to /var/tmp/portage/dev-libs/libpcre-8.41-r1/work

>>> Source unpacked in /var/tmp/portage/dev-libs/libpcre-8.41-r1/work

>>> Preparing source in /var/tmp/portage/dev-libs/libpcre-8.41-r1/work/pcre-8.41 …

 * Applying libpcre-8.41-sljit_mips-label-statement-fix.patch …                                               [ ok ]

 * Applying libpcre-8.41-fix-stack-size-detection.patch …                                                     [ ok ]

 * Running elibtoolize in: pcre-8.41/

 *   Applying portage/1.2.0 patch …

 *   Applying sed/1.5.6 patch …

 *   Applying as-needed/2.4.3 patch …

 *   Applying ppc64le/2.4.4 patch …

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/dev-libs/libpcre-8.41-r1/work/pcre-8.41 …

 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure

 * econf: updating pcre-8.41/config.sub with /usr/share/gnuconfig/config.sub

 * econf: updating pcre-8.41/config.guess with /usr/share/gnuconfig/config.guess

/var/tmp/portage/dev-libs/libpcre-8.41-r1/work/pcre-8.41/configure —prefix=/usr —build=x86_64-pc-linux-gnu —host=x86_64-pc-linux-gnu —mandir=/usr/share/man —infodir=/usr/share/info —datadir=/usr/share —sysconfdir=/etc —localstatedir=/var/lib —disable-dependency-tracking —disable-silent-rules —libdir=/usr/lib64 —with-match-limit-recursion=8192 —enable-pcregrep-libbz2 —enable-cpp —enable-jit —enable-pcregrep-jit —disable-pcre16 —disable-pcre32 —disable-pcretest-libedit —enable-pcretest-libreadline —disable-static —enable-utf —enable-unicode-properties —enable-pcregrep-libz —enable-pcre8 —enable-shared —htmldir=/usr/share/doc/libpcre-8.41-r1/html —docdir=/usr/share/doc/libpcre-8.41-r1

checking for a BSD-compatible install… /usr/lib/portage/python3.5/ebuild-helpers/xattr/install -c

checking whether build environment is sane… yes

checking for a thread-safe mkdir -p… /bin/mkdir -p

checking for gawk… gawk

checking whether make sets $(MAKE)… yes

checking whether make supports nested variables… yes

checking whether make supports nested variables… (cached) yes

checking for style of include used by make… GNU

checking for x86_64-pc-linux-gnu-gcc… x86_64-pc-linux-gnu-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 x86_64-pc-linux-gnu-gcc accepts -g… yes

checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89… none needed

checking whether x86_64-pc-linux-gnu-gcc understands -c and -o together… yes

checking dependency style of x86_64-pc-linux-gnu-gcc… none

checking for x86_64-pc-linux-gnu-ar… x86_64-pc-linux-gnu-ar

checking the archiver (x86_64-pc-linux-gnu-ar) interface… ar

checking for x86_64-pc-linux-gnu-gcc… (cached) x86_64-pc-linux-gnu-gcc

checking whether we are using the GNU C compiler… (cached) yes

checking whether x86_64-pc-linux-gnu-gcc accepts -g… (cached) yes

checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89… (cached) none needed

checking whether x86_64-pc-linux-gnu-gcc understands -c and -o together… (cached) yes

checking dependency style of x86_64-pc-linux-gnu-gcc… (cached) none

checking for x86_64-pc-linux-gnu-g++… x86_64-pc-linux-gnu-g++

checking whether we are using the GNU C++ compiler… no

checking whether x86_64-pc-linux-gnu-g++ accepts -g… yes

checking dependency style of x86_64-pc-linux-gnu-g++… none

checking how to run the C preprocessor… x86_64-pc-linux-gnu-gcc -E

checking for grep that handles long lines and -e… /bin/grep

checking for egrep… /bin/grep -E

checking for ANSI C header files… yes

checking for sys/types.h… yes

checking for sys/stat.h… yes

checking for stdlib.h… yes

checking for string.h… yes

checking for memory.h… yes

checking for strings.h… yes

checking for inttypes.h… yes

checking for stdint.h… yes

checking for unistd.h… yes

checking for int64_t… yes

checking build system type… x86_64-pc-linux-gnu

checking host system type… x86_64-pc-linux-gnu

checking how to print strings… printf

checking for a sed that does not truncate output… /bin/sed

checking for fgrep… /bin/grep -F

checking for ld used by x86_64-pc-linux-gnu-gcc… /usr/x86_64-pc-linux-gnu/bin/ld

checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld) is GNU ld… yes

checking for BSD- or MS-compatible name lister (nm)… /usr/bin/x86_64-pc-linux-gnu-nm -B

checking the name lister (/usr/bin/x86_64-pc-linux-gnu-nm -B) interface… BSD nm

checking whether ln -s works… yes

checking the maximum length of command line arguments… 1572864

checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format… func_convert_file_noop

checking how to convert x86_64-pc-linux-gnu file names to toolchain format… func_convert_file_noop

checking for /usr/x86_64-pc-linux-gnu/bin/ld option to reload object files… -r

checking for x86_64-pc-linux-gnu-objdump… objdump

checking how to recognize dependent libraries… pass_all

checking for x86_64-pc-linux-gnu-dlltool… dlltool

checking how to associate runtime and link libraries… printf %sn

checking for x86_64-pc-linux-gnu-ar… (cached) x86_64-pc-linux-gnu-ar

checking for archiver @FILE support… @

checking for x86_64-pc-linux-gnu-strip… x86_64-pc-linux-gnu-strip

checking for x86_64-pc-linux-gnu-ranlib… x86_64-pc-linux-gnu-ranlib

checking command to parse /usr/bin/x86_64-pc-linux-gnu-nm -B output from x86_64-pc-linux-gnu-gcc object… ok

checking for sysroot… no

checking for a working dd… /bin/dd

checking how to truncate binary pipes… /bin/dd bs=4096 count=1

checking for x86_64-pc-linux-gnu-mt… no

checking for mt… no

checking if : is a manifest tool… no

checking for dlfcn.h… yes

checking for objdir… .libs

checking if x86_64-pc-linux-gnu-gcc supports -fno-rtti -fno-exceptions… no

checking for x86_64-pc-linux-gnu-gcc option to produce PIC… -fPIC -DPIC

checking if x86_64-pc-linux-gnu-gcc PIC flag -fPIC -DPIC works… yes

checking if x86_64-pc-linux-gnu-gcc static flag -static works… yes

checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o… yes

checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o… (cached) yes

checking whether the x86_64-pc-linux-gnu-gcc linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries… yes

checking whether -lc should be explicitly linked in… no

checking dynamic linker characteristics… GNU/Linux ld.so

checking how to hardcode library paths into programs… immediate

checking whether stripping libraries is possible… yes

checking if libtool supports shared libraries… yes

checking whether to build shared libraries… yes

checking whether to build static libraries… no

checking whether ln -s works… yes

checking whether the -Werror option is usable… yes

checking for simple visibility declarations… yes

checking for ANSI C header files… (cached) yes

checking limits.h usability… yes

checking limits.h presence… yes

checking for limits.h… yes

checking for sys/types.h… (cached) yes

checking for sys/stat.h… (cached) yes

checking dirent.h usability… yes

checking dirent.h presence… yes

checking for dirent.h… yes

checking windows.h usability… no

checking windows.h presence… no

checking for windows.h… no

configure: error: You need a C++ compiler for C++ support.

!!! Please attach the following file when seeking support:

!!! /var/tmp/portage/dev-libs/libpcre-8.41-r1/work/pcre-8.41-abi_x86_64.amd64/config.log

 * ERROR: dev-libs/libpcre-8.41-r1::gentoo failed (configure phase):

 *   econf failed

 *

 * Call stack:

 *               ebuild.sh, line  124:  Called src_configure

 *             environment, line 2635:  Called multilib-minimal_src_configure

 *             environment, line 1836:  Called multilib_foreach_abi ‘multilib-minimal_abi_src_configure’

 *             environment, line 2050:  Called multibuild_foreach_variant ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *             environment, line 1766:  Called _multibuild_run ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *             environment, line 1764:  Called _multilib_multibuild_wrapper ‘multilib-minimal_abi_src_configure’

 *             environment, line  352:  Called multilib-minimal_abi_src_configure

 *             environment, line 1830:  Called multilib_src_configure

 *             environment, line 2267:  Called econf ‘—with-match-limit-recursion=8192’ ‘—enable-pcregrep-libbz2’ ‘—enable-cpp’ ‘—enable-jit’ ‘—enable-pcregrep-jit’ ‘—disable-pcre16’ ‘—disable-pcre32’ ‘—disable-pcretest-libedit’ ‘—enable-pcretest-libreadline’ ‘—disable-static’ ‘—enable-utf’ ‘—enable-unicode-properties’ ‘—enable-pcregrep-libz’ ‘—enable-pcre8’ ‘—enable-shared’ ‘—htmldir=/usr/share/doc/libpcre-8.41-r1/html’ ‘—docdir=/usr/share/doc/libpcre-8.41-r1’

 *        phase-helpers.sh, line  666:  Called __helpers_die ‘econf failed’

 *   isolated-functions.sh, line  117:  Called die

 * The specific snippet of code:

 *         die «$@»

 *

 * If you need support, post the output of `emerge —info ‘=dev-libs/libpcre-8.41-r1::gentoo’`,

 * the complete build log and the output of `emerge -pqv ‘=dev-libs/libpcre-8.41-r1::gentoo’`.

 * The complete build log is located at ‘/var/tmp/portage/dev-libs/libpcre-8.41-r1/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/portage/dev-libs/libpcre-8.41-r1/temp/environment’.

 * Working directory: ‘/var/tmp/portage/dev-libs/libpcre-8.41-r1/work/pcre-8.41-abi_x86_64.amd64’

 * S: ‘/var/tmp/portage/dev-libs/libpcre-8.41-r1/work/pcre-8.41’

>>> Failed to emerge dev-libs/libpcre-8.41-r1, Log file:

>>>  ‘/var/tmp/portage/dev-libs/libpcre-8.41-r1/temp/build.log’

Back to top

View user's profile Send private message

benchaney
n00b
n00b

Joined: 28 Dec 2017
Posts: 30

PostPosted: Thu Mar 15, 2018 12:11 am    Post subject: Reply with quote

I don’t think this error is related, however it is essentially the same issue in a different context.

I have reproduced you issue against the master branch of upstream. It would appear this issue appears when attempting to configure with invalid CXXFLAGS. The issue doesn’t appear for me when CXXFLAGS is empty.

The error message originates from configure.ac line 484.

Maybe we should send the libpcre upstream a pr as well…

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19773

PostPosted: Thu Mar 15, 2018 1:08 am    Post subject: Reply with quote

unclecristian wrote:
Trying to help, although I barely know what I am doing

You did. You made others aware of the problem, and benchaney took the initiative to try to have the problem fixed at its source. That helps future users.

benchaney wrote:
Maybe we should send the libpcre upstream a pr as well…

If libpcre also has a misleading error message, then yes, it too should be fixed. We cannot guarantee which package users will hit first.

Back to top

View user's profile Send private message

benchaney
n00b
n00b

Joined: 28 Dec 2017
Posts: 30

PostPosted: Thu Mar 15, 2018 11:22 am    Post subject: Reply with quote

I sent a patch to pcre. While I was fixing it for CXXFLAGS. I noticed that there is a similar issue when CFLAGS are invalid.

Code:

gentoo% CFLAGS=invalid ./configure

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… gawk

checking whether make sets $(MAKE)… yes

checking whether make supports nested variables… yes

checking whether make supports nested variables… (cached) yes

checking whether make supports the include directive… yes (GNU style)

checking for gcc… gcc

checking whether the C compiler works… no

configure: error: in `/home/bichaney/pcre/repo’:

configure: error: C compiler cannot create executables

See `config.log’ for more details

However this isn’t caused by anything in libpcre, it is true is an error inherent to autonconf. I have a toy build that demonstrates this.

Back to top

View user's profile Send private message

John R. Graham
Administrator
Administrator

Joined: 08 Mar 2005
Posts: 10519
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Mar 15, 2018 11:40 am    Post subject: Reply with quote

That one isn’t really in the same class of misleading, even though it’s so common that it has its own FAQ question on the Forums. You break the compiler and get an error that points you directly to the broken component and config.log shows exactly what’s being run, which fails when tried in a stand-alone test.

I suppose that autoconf test could try the compiler with minimal options and, if that succeeded, report a likely command line argument flaw, but I kind of doubt upstream would be interested.

— John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.

Back to top

View user's profile Send private message

benchaney
n00b
n00b

Joined: 28 Dec 2017
Posts: 30

PostPosted: Thu Mar 15, 2018 1:01 pm    Post subject: Reply with quote

Fair enough. The cmake patch was merged into master, so if the libpcre patch goes the same way, I guess we are done. Thanks everyone.
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

#c #macos #cmake

#c #macos #cmake

Вопрос:

При установке make на Mac OX он показывает:

Ошибка при начальной загрузке CMake: не удается найти подходящий компилятор C в этой системе. Пожалуйста, укажите его, используя переменную окружения CC.

Тем не менее, у меня есть Xcode на моем MacBook, и C / C могут работать.

Как я могу это решить?

Комментарии:

1. Вам также необходимо установить инструменты командной строки. Используйте xcode-select install .

2. Какой пакет вы пытаетесь установить? Как вы его устанавливаете?

Ответ №1:

Я предполагаю, что, как и я, вы делали это с помощью homebrew — и на macOS 10.12 Sierra, которая (на момент написания статьи) технически в настоящее время не поддерживается.

Если вы еще не решили эту проблему, вот что я сделал…

TL; DR- Мораль сказки: при использовании homebrew с предоставленными XCode инструментами компилятора clang всегда убедитесь, что вы обновлены (и установили и приняли T amp; C для использования инструментов командной строки).

Я пытался обновить CMake, и я получил ту же ошибку во время его начальной загрузки:

 Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using environment variable CC
 

Поэтому я понял (как и @Jonathan Leffler), что это, вероятно, необходимо:

 xcode-select --install
 

Который исправил это (я также подозреваю, что предоставление альтернативного компилятора с brew install gcc ** могло бы сработать …)

Но потом я получил:

 ==> ./bootstrap --prefix=/usr/local/Cellar/cmake/3.6.1 --no-system-libs --parallel=4 --datadir=/share/cmake --docdir=/share/doc/cmake --ma
Last 15 lines from /Users/tim/Library/Logs/Homebrew/cmake/01.bootstrap:

     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

 Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.11 or lower.
Call Stack (most recent call first):
 Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:19 (project)
 

Затем, конечно, мне нужно перейти на последнюю версию XCode (8.1), чтобы обновить SDK. Это занимает много времени. Стон.

За которым следует (в командной строке) принятие лицензии:

 sudo xcodebuild -license
 

Но как только это было сделано, все заработало — т.е. brew upgrade cmake !

Ответ №2:

Когда я набрал ./bootstrap , это случилось и со мной.
Это сработало для меня:

 env CC=gcc ./bootstrap
 

Ответ №3:

Не удается найти подходящий компилятор C в этой системе, make

 sudo apt-get install build-essential
 

А чего ты его из гита ставишь? Реп что ли нет?

anonymous

(03.11.17 11:23:10 MSK)

  • Ссылка

Error when bootstrapping CMake: Cannot find a C++ compiler supporting C++11 on this system. Please specify one using environment variable CXX. See cmake_bootstrap.log for compilers attempted.
bootstrapping

apt‐get/rpm сломался?

  • Показать ответ
  • Ссылка

Ответ на:

комментарий
от awesomelackware 03.11.17 12:32:15 MSK

Ответ на:

комментарий
от linux92 03.11.17 13:39:08 MSK

Ответ на:

комментарий
от awesomelackware 03.11.17 13:59:57 MSK

:)

Deleted

(03.11.17 14:00:22 MSK)

  • Ссылка

Ответ на:

комментарий
от linux92 03.11.17 13:39:08 MSK

Тебя спрашивают, зачем ты собираешь cmake руками, а не ставишь из пакета средствами пакетного менеджера

XMs ★★★★★

(03.11.17 17:29:16 MSK)



Последнее исправление: XMs 03.11.17 17:29:24 MSK
(всего

исправлений: 1)

  • Ссылка

Он тебе всё написал. Если туго с английским, то или учишь английский, или забиваешь всё что написано в Google Переводчик, или просто лезешь в биореактор.

  • Ссылка

Ответ на:

комментарий
от peregrine 04.11.17 01:38:47 MSK

Ответ на:

комментарий
от linux92 05.11.17 11:52:46 MSK

Ответ на:

комментарий
от linux92 05.11.17 11:54:39 MSK

Ответ на:

комментарий
от EXL 05.11.17 11:55:33 MSK

Ответ на:

комментарий
от linux92 05.11.17 12:01:56 MSK

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.

Понравилась статья? Поделить с друзьями:
  • Error validate failed migrations have failed validation
  • Error utf8rus was not declared in this scope
  • Error usr bin ppcx64 returned an error exitcode
  • Error using vertcat dimensions of matrices being concatenated are not consistent
  • Error using vertcat dimensions of arrays being concatenated are not consistent матлаб