[MacPorts] #71061: Cmake-boostrap is not finding proper compiler on system -> LLVM Clang cmake failind to build

MacPorts noreply at macports.org
Tue Oct 8 15:11:53 UTC 2024


#71061: Cmake-boostrap is not finding proper compiler on system -> LLVM Clang cmake
failind to build
------------------------------+--------------------
  Reporter:  Behinder         |      Owner:  (none)
      Type:  defect           |     Status:  new
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.10.2
Resolution:                   |   Keywords:  sonoma
      Port:  cmake-bootstrap  |
------------------------------+--------------------
Changes (by ryandesign):

 * keywords:   => sonoma
 * priority:  High => Normal


Old description:

> Trying to build cmake I encountered lot of errors as the compiler was not
> able to find includes. I used
> [https://cmichel.io/fixing-cpp-compilation-bugs-for-the-mac-os-catalina-
> upgrade/] trying to solve the problem and I added necessary paths however
> without llvm because I don't have it installed yet and I cannot install
> it because cmake build is failing.
>
> I am attaching debug.log for reference. Key parts are IMO:
> ```
> cmake-bootstrap has no conflicts
> DEBUG: Executing org.macports.main (cmake-bootstrap)
> DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
> DEBUG: Privilege de-escalation not attempted as not running as root.
> DEBUG: archivefetch phase started at Tue Oct  8 15:29:52 CEST 2024
> ```
> how can I run something not as root if I did `sudo`? Misleading.. AND
> ```
> CMake 3.9.6, Copyright 2000-2017 Kitware, Inc. and Contributors
> C compiler on this system is: /usr/bin/clang -pipe -Os
> -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch
> arm64 -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.
> ```
>
> How can it not find proper C++ compiler on this system if in the log
> variable is set
> CXX='/usr/bin/clang++'
>
> and `clang++ --version` gives:
> ```
> /usr/bin/clang++ --version
> Apple clang version 15.0.0 (clang-1500.3.9.4)
> Target: arm64-apple-darwin23.6.0
> Thread model: posix
> InstalledDir:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> ```
>
> I set up MacPorts to always compile from source everything. And I was
> able to install few packages without problems. Here the list:
> apr @1.7.4_0 (active)
>   argon2 @20190702_1 (active)
>   autoconf @2.72_0 (active)
>   automake @1.17_0 (active)
>   bison @3.8.2_2 (active)
>   bison-runtime @3.8.2_0 (active)
>   bzip2 @1.0.8_0 (active)
>   cctools @949.0.1_3+xcode (active)
>   clang_select @2.4_0 (active)
>   curl-ca-bundle @8.10.1_0 (active)
>   expat @2.6.3_0 (active)
>   fzf @0.55.0_0 (active)
>   gdbm @1.24_0 (active)
>   gettext @0.22.5_0 (active)
>   gettext-runtime @0.22.5_0 (active)
>   gettext-tools-libs @0.22.5_0 (active)
>   go @1.23.1_0
>   go @1.23.2_0 (active)
>   gperf @3.1_0 (active)
>   ld64 @3_6+ld64_xcode (active)
>   ld64-xcode @2_6 (active)
>   libcxx @5.0.1_5 (active)
>   libedit @20240808-3.1_0 (active)
>   libffi @3.4.6_1 (active)
>   libiconv @1.17_0 (active)
>   libtextstyle @0.22.5_0 (active)
>   libtool @2.4.7_4
>   libtool @2.5.3_0 (active)
>   llvm_select @2_1 (active)
>   lzo2 @2.10_0 (active)
>   m4 @1.4.19_1 (active)
>   mhash @0.9.9.9_1 (active)
>   nasm @2.16.03_0 (active)
>   ncurses @6.5_0 (active)
>   nghttp2 @1.63.0_0 (active)
>   openssl @3_20 (active)
>   openssl3 @3.3.2_0 (active)
>   pcre2 @10.44_0 (active)
>   php_select @1.0_1 (active)
>   pkgconfig @0.29.2_0 (active)
>   python3_select @0.1_0 (active)
>   python3_select-312 @0.1_1 (active)
>   python312 @3.12.6_0+lto+optimizations
>   python312 @3.12.7_0+lto+optimizations (active)
>   python_select @0.3_10 (active)
>   python_select-312 @0.3_1 (active)
>   readline @8.2.013_0 (active)
>   sqlite3 @3.46.1_0 (active)
>   vim @9.1.0000_0+huge (active)
>   x264 @20191217_0 (active)
>   xz @5.4.7_0 (active)
>   zlib @1.3.1_0 (active)
>   zsh @5.9_3 (active

New description:

 Trying to build cmake I encountered lot of errors as the compiler was not
 able to find includes. I used
 [https://cmichel.io/fixing-cpp-compilation-bugs-for-the-mac-os-catalina-
 upgrade/] trying to solve the problem and I added necessary paths however
 without llvm because I don't have it installed yet and I cannot install it
 because cmake build is failing.

 I am attaching debug.log for reference. Key parts are IMO:
 {{{
 cmake-bootstrap has no conflicts
 DEBUG: Executing org.macports.main (cmake-bootstrap)
 DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
 DEBUG: Privilege de-escalation not attempted as not running as root.
 DEBUG: archivefetch phase started at Tue Oct  8 15:29:52 CEST 2024
 }}}
 how can I run something not as root if I did `sudo`? Misleading.. AND
 {{{
 CMake 3.9.6, Copyright 2000-2017 Kitware, Inc. and Contributors
 C compiler on this system is: /usr/bin/clang -pipe -Os
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64
 -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.
 }}}

 How can it not find proper C++ compiler on this system if in the log
 variable is set
 CXX='/usr/bin/clang++'

 and `clang++ --version` gives:
 {{{
 /usr/bin/clang++ --version
 Apple clang version 15.0.0 (clang-1500.3.9.4)
 Target: arm64-apple-darwin23.6.0
 Thread model: posix
 InstalledDir:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 }}}

 I set up MacPorts to always compile from source everything. And I was able
 to install few packages without problems. Here the list:
 {{{
   apr @1.7.4_0 (active)
   argon2 @20190702_1 (active)
   autoconf @2.72_0 (active)
   automake @1.17_0 (active)
   bison @3.8.2_2 (active)
   bison-runtime @3.8.2_0 (active)
   bzip2 @1.0.8_0 (active)
   cctools @949.0.1_3+xcode (active)
   clang_select @2.4_0 (active)
   curl-ca-bundle @8.10.1_0 (active)
   expat @2.6.3_0 (active)
   fzf @0.55.0_0 (active)
   gdbm @1.24_0 (active)
   gettext @0.22.5_0 (active)
   gettext-runtime @0.22.5_0 (active)
   gettext-tools-libs @0.22.5_0 (active)
   go @1.23.1_0
   go @1.23.2_0 (active)
   gperf @3.1_0 (active)
   ld64 @3_6+ld64_xcode (active)
   ld64-xcode @2_6 (active)
   libcxx @5.0.1_5 (active)
   libedit @20240808-3.1_0 (active)
   libffi @3.4.6_1 (active)
   libiconv @1.17_0 (active)
   libtextstyle @0.22.5_0 (active)
   libtool @2.4.7_4
   libtool @2.5.3_0 (active)
   llvm_select @2_1 (active)
   lzo2 @2.10_0 (active)
   m4 @1.4.19_1 (active)
   mhash @0.9.9.9_1 (active)
   nasm @2.16.03_0 (active)
   ncurses @6.5_0 (active)
   nghttp2 @1.63.0_0 (active)
   openssl @3_20 (active)
   openssl3 @3.3.2_0 (active)
   pcre2 @10.44_0 (active)
   php_select @1.0_1 (active)
   pkgconfig @0.29.2_0 (active)
   python3_select @0.1_0 (active)
   python3_select-312 @0.1_1 (active)
   python312 @3.12.6_0+lto+optimizations
   python312 @3.12.7_0+lto+optimizations (active)
   python_select @0.3_10 (active)
   python_select-312 @0.3_1 (active)
   readline @8.2.013_0 (active)
   sqlite3 @3.46.1_0 (active)
   vim @9.1.0000_0+huge (active)
   x264 @20191217_0 (active)
   xz @5.4.7_0 (active)
   zlib @1.3.1_0 (active)
   zsh @5.9_3 (active
 }}}

--

Comment:

 The log shows you have command line tools 16 so this sounds like #70750.
 Try the solution at ProblemHotlist#clts16.

-- 
Ticket URL: <https://trac.macports.org/ticket/71061#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list