Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#68474 closed defect (fixed)

Unable to install cmake on macOS Sonoma

Reported by: sacredbanana (Cameron Armstrong (Nightfox)) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: sonoma Cc: mascguy (Christopher Nielsen), cjones051073 (Chris Jones)
Port: cmake

Description

I have done a clean and then did a fresh install of Macports on my macOS Sonoma M1 MacBook Pro.

When I try to install cmake with Macports

sudo port install cmake

it fails with the error:

Error: Failed to configure cmake: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4-arm64/CMakeFiles/CMakeError.log
Error: Failed to configure cmake: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

The log it references says the following:

'Determining if the environ exist failed with the following output:
Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_2d4eb/fast && make  -f CMakeFiles/cmTC_2d4eb.dir/build.make CMakeFiles/cmTC_2d4eb.dir/build
Building C object CMakeFiles/cmTC_2d4eb.dir/CheckSymbolExists.c.o
/Library/Developer/CommandLineTools/usr/bin/clang   -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -std=gnu11 -MD -MT CMakeFiles/cmTC_2d4eb.dir/CheckSymbolExists.c.o -MF CMakeFiles/cmTC_2d4eb.dir/CheckSymbolExists.c.o.d -o CMakeFiles/cmTC_2d4eb.dir/CheckSymbolExists.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: use of undeclared identifier 'environ'
  return ((int*)(&environ))[argc];
                  ^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_2d4eb.dir/CheckSymbolExists.c.o] Error 1
make: *** [cmTC_2d4eb/fast] Error 2


File /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <stdlib.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef environ
  return ((int*)(&environ))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Checking whether CXX compiler has environ in stdlib.h failed to compile with the following output:
Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_e940c/fast && make  -f CMakeFiles/cmTC_e940c.dir/build.make CMakeFiles/cmTC_e940c.dir/build
Building CXX object CMakeFiles/cmTC_e940c.dir/kwsysPlatformTestsCXX.cxx.o
/Library/Developer/CommandLineTools/usr/bin/clang++ -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -std=gnu++17 -MD -MT CMakeFiles/cmTC_e940c.dir/kwsysPlatformTestsCXX.cxx.o -MF CMakeFiles/cmTC_e940c.dir/kwsysPlatformTestsCXX.cxx.o.d -o CMakeFiles/cmTC_e940c.dir/kwsysPlatformTestsCXX.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx:53:13: error: use of undeclared identifier 'environ'
  char* e = environ[0];
            ^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_e940c.dir/kwsysPlatformTestsCXX.cxx.o] Error 1
make: *** [cmTC_e940c/fast] Error 2



Checking whether CXX compiler struct stat has st_mtim member failed to compile with the following output:
Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_b29f8/fast && make  -f CMakeFiles/cmTC_b29f8.dir/build.make CMakeFiles/cmTC_b29f8.dir/build
Building CXX object CMakeFiles/cmTC_b29f8.dir/kwsysPlatformTestsCXX.cxx.o
/Library/Developer/CommandLineTools/usr/bin/clang++ -DTEST_KWSYS_CXX_STAT_HAS_ST_MTIM  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -std=gnu++17 -MD -MT CMakeFiles/cmTC_b29f8.dir/kwsysPlatformTestsCXX.cxx.o -MF CMakeFiles/cmTC_b29f8.dir/kwsysPlatformTestsCXX.cxx.o.d -o CMakeFiles/cmTC_b29f8.dir/kwsysPlatformTestsCXX.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx:12:15: error: no member named 'st_mtim' in 'stat'
  (void)stat1.st_mtim.tv_sec;
        ~~~~~ ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx:13:15: error: no member named 'st_mtim' in 'stat'
  (void)stat1.st_mtim.tv_nsec;
        ~~~~~ ^
2 errors generated.
make[1]: *** [CMakeFiles/cmTC_b29f8.dir/kwsysPlatformTestsCXX.cxx.o] Error 1
make: *** [cmTC_b29f8/fast] Error 2



Checking whether CXX compiler has rlimit64 failed to compile with the following output:
Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_42105/fast && make  -f CMakeFiles/cmTC_42105.dir/build.make CMakeFiles/cmTC_42105.dir/build
Building CXX object CMakeFiles/cmTC_42105.dir/kwsysPlatformTestsCXX.cxx.o
/Library/Developer/CommandLineTools/usr/bin/clang++ -DTEST_KWSYS_CXX_HAS_RLIMIT64  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -std=gnu++17 -MD -MT CMakeFiles/cmTC_42105.dir/kwsysPlatformTestsCXX.cxx.o -MF CMakeFiles/cmTC_42105.dir/kwsysPlatformTestsCXX.cxx.o.d -o CMakeFiles/cmTC_42105.dir/kwsysPlatformTestsCXX.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx:75:19: error: variable has incomplete type 'struct rlimit64'
  struct rlimit64 rlim;
                  ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx:75:10: note: forward declaration of 'rlimit64'
  struct rlimit64 rlim;
         ^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_42105.dir/kwsysPlatformTestsCXX.cxx.o] Error 1
make: *** [cmTC_42105/fast] Error 2



Checking whether <ext/stdio_filebuf.h> is available failed to compile with the following output:
Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_9e078/fast && make  -f CMakeFiles/cmTC_9e078.dir/build.make CMakeFiles/cmTC_9e078.dir/build
Building CXX object CMakeFiles/cmTC_9e078.dir/kwsysPlatformTestsCXX.cxx.o
/Library/Developer/CommandLineTools/usr/bin/clang++ -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -std=gnu++17 -MD -MT CMakeFiles/cmTC_9e078.dir/kwsysPlatformTestsCXX.cxx.o -MF CMakeFiles/cmTC_9e078.dir/kwsysPlatformTestsCXX.cxx.o.d -o CMakeFiles/cmTC_9e078.dir/kwsysPlatformTestsCXX.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Source/kwsys/kwsysPlatformTestsCXX.cxx:169:12: fatal error: 'ext/stdio_filebuf.h' file not found
#  include <ext/stdio_filebuf.h>
           ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_9e078.dir/kwsysPlatformTestsCXX.cxx.o] Error 1
make: *** [cmTC_9e078/fast] Error 2



Looking for a Fortran compiler failed with the following output:
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
-- The Fortran compiler identification is unknown
sh: /bin/ps: Operation not permitted
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_Fortran_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Tests/CMakeFiles/CheckFortran/CMakeFiles/CMakeOutput.log".
See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/Tests/CMakeFiles/CheckFortran/CMakeFiles/CMakeError.log".

Attachments (1)

main.log (427.7 KB) - added by sacredbanana (Cameron Armstrong (Nightfox)) 11 months ago.
Main log file

Download all attachments as: .zip

Change History (13)

comment:1 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: mascguy added
Keywords: sonoma added
Owner: set to michaelld
Status: newassigned

comment:2 Changed 11 months ago by kencu (Ken)

cmake and cmake-devel build and install without issue on an arn64 mac running Sonoma.

please include your full log therefore, as the build failure message requests, so someone might help you.

The most common issue we’re seeing on Sonoma at present is people update to Sonoma, update Xcode, but forget to update the command line tools. So you might check that.

Version 0, edited 11 months ago by kencu (Ken) (next)

comment:3 Changed 11 months ago by sacredbanana (Cameron Armstrong (Nightfox))

I have the latest Xcode, and command line tools are updated too.

I checked by running xcode-select --install and also softwareupdate -l to list any updates and there are none

The full log of the install is:

--->  Computing dependencies for cmake
--->  Fetching archive for cmake
--->  Attempting to fetch cmake-3.24.4_0.darwin_23.arm64.tbz2 from https://packages.macports.org/cmake
--->  Attempting to fetch cmake-3.24.4_0.darwin_23.arm64.tbz2 from http://jog.id.packages.macports.org/macports/packages/cmake
--->  Attempting to fetch cmake-3.24.4_0.darwin_23.arm64.tbz2 from https://kmq.jp.packages.macports.org/cmake
--->  Fetching distfiles for cmake
--->  Verifying checksums for cmake
--->  Extracting cmake
--->  Applying patches to cmake
--->  Configuring cmake
Error: Failed to configure cmake: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/CMakeFiles/CMakeError.log
Error: Failed to configure cmake: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port cmake failed

And the full log of the other log file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.24.4/CMakeFiles/CMakeError.log ive already posted

Last edited 11 months ago by sacredbanana (Cameron Armstrong (Nightfox)) (previous) (diff)

comment:4 Changed 11 months ago by cjones051073 (Chris Jones)

You need to attach the full log file

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log

From a clean build attempt. Without it we cannot help.

comment:5 Changed 11 months ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:6 in reply to:  3 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to sacredbanana:

I checked by running xcode-select --install and also softwareupdate -l to list any updates and there are none

That does not necessarily mean your CLT are up to date. See ProblemHotlist#reinstall-clt.

Changed 11 months ago by sacredbanana (Cameron Armstrong (Nightfox))

Attachment: main.log added

Main log file

comment:7 Changed 11 months ago by sacredbanana (Cameron Armstrong (Nightfox))

My Xcode command line utils version is 15.0.0.0.1.1694021235

I have attached the requested log file to the ticket

comment:8 Changed 11 months ago by cjones051073 (Chris Jones)

Your problem is you are mixing homebrew with macports. Check your log more carefully and you will see

:info:configure CMake Error at /opt/homebrew/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:14 (message):
1262	:info:configure   The imported target "Qt5::Core" references the file
1263	:info:configure      "/opt/homebrew/.//mkspecs/macx-clang"
1264	:info:configure   but this file does not exist.  Possible reasons include:
1265	:info:configure   * The file was deleted, renamed, or moved to another location.
1266	:info:configure   * An install or uninstall procedure did not complete successfully.
1267	:info:configure   * The installation package was faulty and contained
1268	:info:configure      "/opt/homebrew/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"

You must have something in your environment that is causing /opt/homebrew to be found and used. Remove this.

From the Macports side, we do not support or recommend mixing homebrew and macports as you are doing above.

comment:9 Changed 11 months ago by sacredbanana (Cameron Armstrong (Nightfox))

ah cool thanks ill clean out the homebrew cmake packages

comment:10 Changed 11 months ago by sacredbanana (Cameron Armstrong (Nightfox))

ok I didn't realise I still had an old cmake installed via homebrew. Issue now fixed. Thanks all

comment:11 Changed 11 months ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed

comment:12 Changed 11 months ago by kencu (Ken)

BTW, I have already patched cmake-devel to prevent this opportunistic pickup of files from /opt/homebrew from happening, but not the cmake port, which is about to be updated.

It’s unfortunately hard-coded into cmake to look there first.

Note: See TracTickets for help on using tickets.