Opened 10 years ago

Last modified 2 years ago

#44237 new defect

CMake @3.0.0_2: configure and build pick up local frameworks

Reported by: luc-j-bourhis (Luc J. Bourhis) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mojca (Mojca Miklavec), philip@…, jmgc, yannis1962@…, lonelymoonxweng@…, tombombadil@…, cooljeanius (Eric Gallager)
Port: cmake

Description

The error is

:info:configure CMake Error at Modules/FindGTK2.cmake:181 (file):
:info:configure   file STRINGS file
:info:configure   "/Library/Frameworks/Gtk.framework/Headers/gtk/gtk/gtkversion.h" cannot be
:info:configure   read.
:info:configure Call Stack (most recent call first):
:info:configure   Modules/FindGTK2.cmake:796 (_GTK2_GET_VERSION)
:info:configure   Tests/CMakeLists.txt:1197 (find_package)

There is a file /Library/Frameworks/Gtk.framework/Headers/gtk/gtkversion.h on my system. This is the first time Macports fails to update CMake which I have installed with macports for the first time years ago.

Change History (19)

comment:1 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:2 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: philip@… added; css removed
Owner: changed from macports-tickets@… to css@…
Summary: CMake 3.0.0_2 fails to configureCMake @3.0.0_2: fails to configure when Gtk.framework exists (bug in FindGTK2.cmake)
Version: 2.3.1

This has to be reported upstream. Can you please open a ticket at http://www.cmake.org/Bug?

(I wonder why CMake even searches for GTK during installation.)

This most probably failed because of a bug in FindGTK.cmake. You could try two things. After "port patch cmake", edit FindGTK.cmake. The first thing you could try is to replace gtk/gtkversion.h with gtkversion.h in the following chunks of code:

        _GTK2_GET_VERSION(GTK2_MAJOR_VERSION
                          GTK2_MINOR_VERSION
                          GTK2_PATCH_VERSION
                          ${GTK2_GTK_INCLUDE_DIR}/gtk/gtkversion.h)
...
if(NOT GTK2_FIND_VERSION AND GTK2_GTK_INCLUDE_DIR)
    _GTK2_GET_VERSION(GTK2_MAJOR_VERSION
                      GTK2_MINOR_VERSION
                      GTK2_PATCH_VERSION
                      ${GTK2_GTK_INCLUDE_DIR}/gtk/gtkversion.h)
    set(GTK2_VERSION ${GTK2_MAJOR_VERSION}.${GTK2_MINOR_VERSION}.${GTK2_PATCH_VERSION})
endif()

The second option would be to modify GTK2_GTK_INCLUDE_DIR, but I'm not yet sure how.

(Oh, and the third thing to try would be to uninstall Gtk.framework. ;)

comment:3 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Installing frameworks into /Library/Frameworks is just as bad for MacPorts as installing libraries into /usr/local, so you should remove them.

comment:4 Changed 10 years ago by luc-j-bourhis (Luc J. Bourhis)

Ok, thanks guys, the GTK in /Library/Frameworks was a remnant from long ago, before I used MacPorts, and that I had forgotten about. Simply, until now, it had not caused any issue. Anyway, I remove it and we can close this ticket I reckon.

comment:5 Changed 10 years ago by mojca (Mojca Miklavec)

My request still stands: can you please file an upstream ticket?

comment:6 Changed 10 years ago by luc-j-bourhis (Luc J. Bourhis)

I have filed a ticket upstream: 0015027

Version 0, edited 10 years ago by luc-j-bourhis (Luc J. Bourhis) (next)

comment:7 in reply to:  3 ; Changed 10 years ago by air_drummer@…

Replying to ryandesign@…:

Installing frameworks into /Library/Frameworks is just as bad for MacPorts as installing libraries into /usr/local, so you should remove them.

tried that, still fails:

:info:configure sh: /bin/ps: Operation not permitted
:info:configure CMake Error at Modules/FindGTK2.cmake:181 (file):
:info:configure   file STRINGS file
:info:configure   "/Library/Frameworks/Gtk.framework/Headers/gtk/gtk/gtkversion.h" cannot be
:info:configure   read.
:info:configure Call Stack (most recent call first):
:info:configure   Modules/FindGTK2.cmake:796 (_GTK2_GET_VERSION)
:info:configure   Tests/CMakeLists.txt:1197 (find_package)
:info:configure
:info:configure
:info:configure CMake Error at Modules/FindGTK2.cmake:181 (file):
:info:configure   file STRINGS file
:info:configure   "/Library/Frameworks/Gtk.framework/Headers/gtk/gtk/gtkversion.h" cannot be
:info:configure   read.
:info:configure Call Stack (most recent call first):
:info:configure   Modules/FindGTK2.cmake:796 (_GTK2_GET_VERSION)
:info:configure   Tests/FindGTK2/CMakeLists.txt:1 (find_package)
:info:configure
:info:configure
:info:configure -- Configuring incomplete, errors occurred!
:info:configure See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.0.0/CMakeFiles/CMakeOutput.log".
:info:configure See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.0.0/CMakeFiles/CMakeError.log".
:info:configure ---------------------------------------------
:info:configure Error when bootstrapping CMake:
:info:configure Problem while running initial CMake
:info:configure ---------------------------------------------
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.0.0" && ./configure --prefix=/opt/local --mandir=/share/man --docdir=/share/doc/cmake --parallel=8 --init=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.0.0/macports.cmake --system-libs
:info:configure Exit code: 11
:error:configure org.macports.configure for port cmake returned: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
    while executing
"portconfigure::configure_main org.macports.configure"
    ("eval" body line 1)
    invoked from within
"eval $procedure $targetname"
:info:configure Warning: targets not executed for cmake: org.macports.install org.macports.configure org.macports.build org.macports.destroot

grep failed CMakeError.log:

Determining if the environ exist failed with the following output:
CMakeFiles/cmTryCompileExec3205897583.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec3205897583.dir/CheckSymbolExists.c.o' failed
Makefile:118: recipe for target 'cmTryCompileExec3205897583/fast' failed
Checking for non-standard argument to stl allocator<>::max_size failed to compile with the following output:
CMakeFiles/cmTryCompileExec523936053.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec523936053.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec523936053/fast' failed
Checking whether "<>" is needed for template friends failed to compile with the following output:
CMakeFiles/cmTryCompileExec2652163577.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec2652163577.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec2652163577/fast' failed
Checking whether struct stat has st_mtim member failed to compile with the following output:
CMakeFiles/cmTryCompileExec213791245.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec213791245.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec213791245/fast' failed
Checking whether C++ compiler has '__int64' failed to compile with the following output:
CMakeFiles/cmTryCompileExec584674518.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec584674518.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec584674518/fast' failed
Determining size of __int64 failed with the following output:
CMakeFiles/cmTryCompileExec3806989364.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec3806989364.dir/KWSYS_SIZEOF___INT64.c.o' failed
Makefile:118: recipe for target 'cmTryCompileExec3806989364/fast' failed
Checking whether CXX compiler has environ in stdlib.h failed to compile with the following output:
CMakeFiles/cmTryCompileExec1218546850.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec1218546850.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec1218546850/fast' failed
Checking whether CXX compiler has utimensat failed to compile with the following output:
CMakeFiles/cmTryCompileExec1043313326.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec1043313326.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec1043313326/fast' failed
Checking whether CXX compiler has rlimit64 failed to compile with the following output:
CMakeFiles/cmTryCompileExec1529502388.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec1529502388.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec1529502388/fast' failed
Checking whether CXX compiler has _atoi64 failed to compile with the following output:
CMakeFiles/cmTryCompileExec3432745787.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec3432745787.dir/kwsysPlatformTestsCXX.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec3432745787/fast' failed
Determining if the include file elf.h exists failed with the following output:
CMakeFiles/cmTryCompileExec2461896199.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec2461896199.dir/CheckIncludeFile.c.o' failed
Makefile:118: recipe for target 'cmTryCompileExec2461896199/fast' failed
Looking for a Fortran compiler failed with the following output:
Determining if the Q_WS_X11 exist failed with the following output:
CMakeFiles/cmTryCompileExec3171869217.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec3171869217.dir/CheckSymbolExists.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec3171869217/fast' failed
Determining if the Q_WS_WIN exist failed with the following output:
CMakeFiles/cmTryCompileExec3060508948.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec3060508948.dir/CheckSymbolExists.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec3060508948/fast' failed
Determining if the Q_WS_QWS exist failed with the following output:
CMakeFiles/cmTryCompileExec1354015479.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec1354015479.dir/CheckSymbolExists.cxx.o' failed
Makefile:118: recipe for target 'cmTryCompileExec1354015479/fast' failed
Last edited 10 years ago by air_drummer@… (previous) (diff)

comment:8 in reply to:  7 Changed 10 years ago by neverpanic (Clemens Lang)

Replying to air_drummer@…:

tried that, still fails:

If you removed Gtk.framework from /Library/Frameworks, how come cmake thinks it is still there? Did you clean and re-try?

comment:9 Changed 9 years ago by razzfazz (Daniel Becker)

Cc: razzfazz@… added

Cc Me!

comment:10 Changed 9 years ago by razzfazz (Daniel Becker)

Cc: razzfazz@… removed

Cc Me!

comment:11 Changed 9 years ago by gthb (Gunnlaugur Thor Briem)

Removing /Library/Frameworks/Gtk.framework worked around this for me.

comment:12 Changed 9 years ago by larryv (Lawrence Velázquez)

Cc: jm.gomez@… yannis1962@… added
Summary: CMake @3.0.0_2: fails to configure when Gtk.framework exists (bug in FindGTK2.cmake)CMake @3.0.0_2: configure and build pick up local frameworks

Consolidating similar tickets #45729 and #45846.

comment:13 Changed 9 years ago by larryv (Lawrence Velázquez)

Cc: lonelymoonxweng@… added

Has duplicate #45859.

comment:14 Changed 9 years ago by mojca (Mojca Miklavec)

The upstream bug report about Gtk.framework has been closed as "unable to reproduce":

(I agree that it was probably difficult to figure out how to reproduce it, but I don't agree with not doing anything to fix that specific problem.)

In a way CMake is somewhat "broken by design" when it comes to searching the libraries on Mac in a way that wouldn't interfere with MP.

in #45846 yannis mentioned the existence of the following libraries:

libMagick++.framework
libMagick.framework
libWand.framework
libbz2.framework
libcharset.framework
libcurl.framework
libiconv.framework
libjasper.framework
libjpeg.framework
libpng.framework
libtiff.framework
libxml2.framework
libz.framework

Any single one of them could cause problems and every single problematic one should be fixed separately.

I would start hunting for the sloppy mac installer that has put all those libraries there and try to convince them to fix the installer.

I don't know if there is any way to prevent searching for libraries inside /Library/Frameworks on a "global level". I'm afraid that every CMake module would need to be fixed separately. And it might get difficult to fix them. (CMake developers probably want to keep supporting searching for frameworks in /Library/Frameworks.)

comment:15 in reply to:  14 Changed 9 years ago by luc-j-bourhis (Luc J. Bourhis)

Replying to mojca@…:

I don't know if there is any way to prevent searching for libraries inside /Library/Frameworks on a "global level". I'm afraid that every CMake module would need to be fixed separately. And it might get difficult to fix them. (CMake developers probably want to keep supporting searching for frameworks in /Library/Frameworks.)

May I suggest making use of the environment variable CMAKE_LIBRARY_PATH?

comment:16 Changed 9 years ago by tombombadil@…

Cc: tombombadil@… added

Cc Me!

comment:17 Changed 8 years ago by kurthindenburg (Kurt Hindenburg)

Owner: changed from css@… to michaelld@…

comment:18 Changed 2 years ago by cooljeanius (Eric Gallager)

In r101544, the cmake portgroup started setting -DCMAKE_FIND_FRAMEWORK=LAST due to the similar issue of #37341; does that help with this at all?

comment:19 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.