Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60885 closed defect (fixed)

Unable to build cmake on Lion

Reported by: RobK88 Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: cmake

Description

I am unable to build cmake on Lion.

bash-3.2$ sudo port clean cmake
--->  Cleaning cmake
bash-3.2$ sudo port upgrade cmake
--->  Computing dependencies for cmake
--->  Fetching distfiles for cmake
--->  Verifying checksums for cmake
--->  Extracting cmake
--->  Applying patches to cmake
--->  Configuring cmake
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_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
bash-3.2$ 

Attachments (3)

main.log (230.1 KB) - added by RobK88 4 years ago.
main.log
main-using-clang-9.0.log (232.9 KB) - added by RobK88 4 years ago.
main.log after compiling with clang-9.0
cmake_bootstrap-using-clang-9.0.log (23.9 KB) - added by RobK88 4 years ago.

Download all attachments as: .zip

Change History (26)

Changed 4 years ago by RobK88

Attachment: main.log added

main.log

comment:1 Changed 4 years ago by kencu (Ken)

Looks like I should have tried more systems, Michael :>

It would appear clang-3.4 is too old to build this. That would be unfortunate if so, as our fancy cmake bootstrapping will collapse -- but this was not unanticipated, and we have cmake-bootstrap if needed just for this reason, to get us to a modern clang that can build this.

I was planning on moving most of the macports-clang-* builds, at least up to clang-10 to cmake-bootstrap anyway for ease of dependencies, and maybe this will precipitate that happening.

comment:2 Changed 4 years ago by kencu (Ken)

For the OP here, to get you built, you can do it manually. If you already have clang-9.0 installed, and you probably do, you can do this:

sudo port -v upgrade cmake configure.compiler=macports-clang-9.0

and that gets you back in gear while we sort this out.

comment:3 Changed 4 years ago by RobK88

Ken,

I tried compiling cmake with clang-9.0 but cmake still failed to build.

...
8 errors generated.
gmake: *** [Makefile:358: cmSystemTools.o] Error 1
gmake: *** Waiting for unfinished jobs....
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake
---------------------------------------------
Log of errors: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
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.18.0" && ./bootstrap --prefix=/opt/local --docdir=share/doc/cmake --parallel=4 --init=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/macports.cmake --system-libs --no-system-jsoncpp --no-system-librhash --no-qt-gui -- 
Exit code: 9
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_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

I will attach the main.log for for this compile

Changed 4 years ago by RobK88

Attachment: main-using-clang-9.0.log added

main.log after compiling with clang-9.0

comment:4 Changed 4 years ago by RobK88

I will also attach the cmake_bootstrap.log after using clang-9.0

Changed 4 years ago by RobK88

comment:5 Changed 4 years ago by michaelld (Michael Dickens)

Let me boot into Lion and see what happens for me ...

comment:6 Changed 4 years ago by kencu (Ken)

On 10.6.8, the default clang-3.7 built this through for me:

$ port -v installed cmake
The following ports are currently installed:
  cmake @3.18.0_0+docs+gui+python37+qt4+universal (active) platform='darwin 10' archs='i386 x86_64' date='2020-07-20T19:52:22-0700'
Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:7 Changed 4 years ago by mf2k (Frank Schima)

Cc: michaelld@… removed
Keywords: Lion removed
Owner: set to michaelld
Status: newassigned

comment:8 Changed 4 years ago by michaelld (Michael Dickens)

built for me on 10.9:

% port -v installed cmake
The following ports are currently installed:
  cmake @3.18.0_0 (active) platform='darwin 13' archs='x86_64' date='2020-07-21T15:58:54-0400'

comment:9 Changed 4 years ago by michaelld (Michael Dickens)

that's as far back as I can go right now

comment:10 Changed 4 years ago by kencu (Ken)

This missing function asprintf_l

info:configure /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/locale:1624:20: error: use of undeclared identifier 'asprintf_l'; did you mean 'vsprintf_l'?

seems to be guarded by this:

#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
int	 asprintf_l(char **, locale_t, const char *, ...)
        __DARWIN_LDBL_COMPAT2(asprintf_l) __printflike(3, 4);
int	 vasprintf_l(char **, locale_t, const char *, va_list)
        __DARWIN_LDBL_COMPAT2(vasprintf_l) __printflike(3, 0);
#endif

I'm not sure at this moment why this test is not passing to allow the definitions.

comment:11 Changed 4 years ago by michaelld (Michael Dickens)

Related yet different: on 10.5 PPC the cmake 3.18.0 port builds cleanly and cmake executes cleanly in basic testing ... but ctest does not:

% ctest --version
ctest(10966) malloc: *** error for object 0xa01e13dc: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
ctest(10966) malloc: *** error for object 0xa01e136c: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
ctest version 3.18.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

I'll set the breakpoint & see if anything obvious comes up ....

comment:12 Changed 4 years ago by kencu (Ken)

that ctest error is the same one we see with the other cmake bins when using libgcc 7.5.0+, if we don't wrap them in the legacysupport 1.1 wrapper script to force the dyld_library_path.

ctest probably wasn't added to the list of bins being wrapped in the portfile as it is rarely used...

comment:13 Changed 4 years ago by kencu (Ken)

for lion, I'm wondering if _DARWIN_C_SOURCE is not defined for the build, but needs to be set.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:14 Changed 4 years ago by kencu (Ken)

legacysupport.redirect_bins cmake

needs ctest added too. (and might as well do them all while we're at it...)

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:15 Changed 4 years ago by kencu (Ken)

buildbot shows 10.7 and 10.8 are failing, rest look ok

comment:16 Changed 4 years ago by kencu (Ken)

here's the same build error with another port 60655

comment:17 Changed 4 years ago by kencu (Ken)

adding this at least gets us bootstrapped. Probably best to wrap it in a 10.7-10.8 specific block:

configure.cxxflags-append -D_DARWIN_C_SOURCE

rest of the build ongoing...

comment:18 Changed 4 years ago by kencu (Ken)

that was all it needed for Lion:

$ port -v installed cmake
The following ports are currently installed:
  cmake @3.18.0_0+universal (active) platform='darwin 11' archs='i386 x86_64' date='2020-07-22T07:59:09-0700'

comment:19 Changed 4 years ago by RobK88

Thanks Ken. I tried your suggestion on my Mac running Lion without success.

sudo port clean cmake
--->  Cleaning cmake
bash-3.2$ sudo port upgrade cmake configure.cxxflags-append=-D_DARWIN_C_SOURCE
--->  Computing dependencies for cmake
--->  Fetching distfiles for cmake
--->  Verifying checksums for cmake
--->  Extracting cmake
--->  Applying patches to cmake
--->  Configuring cmake
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_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
bash-3.2$ 

Perhaps the "configure.cxxflags-append" only works inside a port file.

comment:20 Changed 4 years ago by kencu (Ken)

yes, only in a portfile. that one doesn't work on the command line.

See <https://github.com/macports/macports-ports/pull/7811/commits/0be5a030ecf10077b08f0e458a8e9827f3bb63a8> if you want it right away -- otherwise we'll commit this by the end of the day, most likely.

comment:21 Changed 4 years ago by kencu (Ken)

officially, btw, it should be tagged onto configure.cppflags but that did not work when I tried it -- voodoo at work :>

comment:22 Changed 4 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 0907b7fc4b79182f4dcd131364b6fb666694eee2/macports-ports (master):

cmake: use _DARWIN_C_SOURCE when needed

closes: #60885

comment:23 Changed 4 years ago by RobK88

Thanks Ken for finding the fix!

Note: See TracTickets for help on using tickets.