Opened 3 years ago

Last modified 13 months ago

#58578 assigned defect

cmake fails to compile on Leopard (lround)

Reported by: rmottola (Riccardo) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard i386 legacy-os Cc: michaelld (Michael Dickens), kencu (Ken), cjones051073 (Chris Jones), cooljeanius (Eric Gallager)
Port: cmake

Description (last modified by ryandesign (Ryan Schmidt))

Build log attached, it fails with clang 3.9 clang 5.0 and gcc 6.5 (even my patched gcc6 which has fixed math headers).

Lots of warnings, but the issues seems to be:

opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.14.5/Source/cmFileCommand.cxx:2615:66: error: call of overloaded 'lround(double)' is ambiguous
       this->CurrentPercentage = std::lround(value / total * 100.0);
In file included from /opt/local/include/LegacySupport/cmath:54:0,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.14.5/Source/cmFileCommand.cxx:13:
/opt/local/include/gcc6/c++/cmath:1662:3: note: candidate: constexpr long int std::lround(float)
   lround(float __x)
/opt/local/include/gcc6/c++/cmath:1666:3: note: candidate: constexpr long int std::lround(long double)
   lround(long double __x)
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/cmFileCommand.cxx.o] Error 1

An issue with legacy support?

Attachments (1)

main.log (4.1 MB) - added by rmottola (Riccardo) 3 years ago.

Change History (11)

Changed 3 years ago by rmottola (Riccardo)

Attachment: main.log added

comment:1 Changed 3 years ago by cjones051073 (Chris Jones)

This doesn't look like an issue with LegacySupport to me. Its only mentioned above because /opt/local/include/LegacySupport/cmath happens to wrap the 'system' cmath file. Also note the legacy support header does nothing to the 'lround' methods, it only adds the 'll' versions.

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

Description: modified (diff)
Owner: set to michaelld
Status: newassigned

comment:3 Changed 3 years ago by michaelld (Michael Dickens)

@kencu: Are you around your older build machines where you can see what's going on? I'm away at a conference for the week & won't have access to mine until Monday June 17.

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

terrible terrible terrible few weeks for me too. Looks like the issue is the compiler can't decide whether to use the float or the double of lround. presumable we need to force it with a d or and f, but I have no idea why it's showing up there.

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

In my read it looks like the compiler is having to choose between "float" and "long double", and can't find a "double" version ... but I'm still parsing through the headers to figure that out. I think I'll put this on hold until I'm back in the office with a 10.5 boot computer to do testing / evaluation on. I thought I had cmake working on that computer, but maybe not?

comment:6 Changed 3 years ago by michaelld (Michael Dickens)

@rmottola we'll get to this soon-ish, once we have access to a suitable computer for testing / fixing. In the meantime ... can you try the "cmake-devel" port & see if it works? Maybe this code has been tweaked in that port to be more cross-compatible.

comment:7 Changed 3 years ago by rmottola (Riccardo)

I didn't try cmake-devel, but today I tried an upgrade of my ports again and bumped into this issue again (just reported on the mailing list) @kencu how is it for you?

comment:8 Changed 2 years ago by mf2k (Frank Schima)

Keywords: legacy-os added; legacy removed

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

Is this still an issue for CMake 3.18.0? I find it builds cleanly for me on 10.5 PPC(32).

comment:10 Changed 13 months ago by cooljeanius (Eric Gallager)

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