Opened 3 years ago

Closed 2 years ago

#65002 closed defect (fixed)

inkscape @1.1.2_2: error: no matching function for call to 'isnan'

Reported by: ngwood Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: cooljeanius (Eric Gallager)
Port: inkscape

Description

macOS 10.13.6 inkscape @1.1.2_2 +x11

Things go wrong around this point; complete log attached.

:info:build [538/1033] /usr/bin/clang++ -DHAVE_CONFIG_H -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DWITH_CSSBLEND -DWITH_CSSCOMPOSITE -DWITH_MESH -DWITH_SVG2 -Dinkscape_base_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/build/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src/3rdparty/adaptagrams -isystem /opt/local/include/pango-1.0 -isystem /opt/local/include/harfbuzz -isystem /opt/local/include/fribidi -isystem /opt/local/include/cairo -isystem /opt/local/include/pixman-1 -isystem /opt/local/include/ossp -isystem /opt/local/include/freetype2 -isystem /opt/local/include/libpng16 -isystem /opt/local/include/libsoup-2.4 -isystem /opt/local/include/libxml2 -isystem /opt/local/include/glib-2.0 -isystem /opt/local/lib/glib-2.0/include -isystem /opt/local/include -isystem /opt/local/include/poppler -isystem /opt/local/include/libwpg-0.3 -isystem /opt/local/include/libwpd-0.10 -isystem /opt/local/include/librevenge-0.0 -isystem /opt/local/include/libvisio-0.1 -isystem /opt/local/include/libcdr-0.1 -isystem /opt/local/include/dbus-1.0 -isystem /opt/local/lib/dbus-1.0/include -isystem /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/build/src/extension/dbus -isystem /opt/local/include/gtkmm-3.0 -isystem /opt/local/lib/gtkmm-3.0/include -isystem /opt/local/include/atkmm-1.6 -isystem /opt/local/include/gtk-3.0/unix-print -isystem /opt/local/include/gdkmm-3.0 -isystem /opt/local/lib/gdkmm-3.0/include -isystem /opt/local/include/giomm-2.4 -isystem /opt/local/lib/giomm-2.4/include -isystem /opt/local/include/pangomm-1.4 -isystem /opt/local/lib/pangomm-1.4/include -isystem /opt/local/include/glibmm-2.4 -isystem /opt/local/lib/glibmm-2.4/include -isystem /opt/local/include/cairomm-1.0 -isystem /opt/local/lib/cairomm-1.0/include -isystem /opt/local/include/sigc++-2.0 -isystem /opt/local/lib/sigc++-2.0/include -isystem /opt/local/include/gtk-3.0 -isystem /opt/local/include/at-spi2-atk/2.0 -isystem /opt/local/include/at-spi-2.0 -isystem /opt/local/include/atk-1.0 -isystem /opt/local/include/gio-unix-2.0 -isystem /opt/local/include/gdk-pixbuf-2.0 -isystem /opt/local/include/gspell-1 -isystem /opt/local/include/enchant-2 -isystem /opt/local/libexec/boost/1.76/include -isystem /opt/local/include/ImageMagick-6 -isystem /opt/local/include/2geom-1.1.0 -pipe -I/opt/local/libexec/boost/1.76/include -Os -DNDEBUG -I/opt/local/libexec/boost/1.76/include -I/opt/local/include -stdlib=libc++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Werror=format -Werror=format-security -Wno-switch -arch x86_64 -mmacosx-version-min=10.13 -fPIC   -fPIC -fdiagnostics-color -std=gnu++17 -MD -MT src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o -MF src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o.d -o src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src/display/cairo-utils.cpp
:info:build FAILED: src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o 
:info:build /usr/bin/clang++ -DHAVE_CONFIG_H -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DWITH_CSSBLEND -DWITH_CSSCOMPOSITE -DWITH_MESH -DWITH_SVG2 -Dinkscape_base_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/build/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src/3rdparty/adaptagrams -isystem /opt/local/include/pango-1.0 -isystem /opt/local/include/harfbuzz -isystem /opt/local/include/fribidi -isystem /opt/local/include/cairo -isystem /opt/local/include/pixman-1 -isystem /opt/local/include/ossp -isystem /opt/local/include/freetype2 -isystem /opt/local/include/libpng16 -isystem /opt/local/include/libsoup-2.4 -isystem /opt/local/include/libxml2 -isystem /opt/local/include/glib-2.0 -isystem /opt/local/lib/glib-2.0/include -isystem /opt/local/include -isystem /opt/local/include/poppler -isystem /opt/local/include/libwpg-0.3 -isystem /opt/local/include/libwpd-0.10 -isystem /opt/local/include/librevenge-0.0 -isystem /opt/local/include/libvisio-0.1 -isystem /opt/local/include/libcdr-0.1 -isystem /opt/local/include/dbus-1.0 -isystem /opt/local/lib/dbus-1.0/include -isystem /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/build/src/extension/dbus -isystem /opt/local/include/gtkmm-3.0 -isystem /opt/local/lib/gtkmm-3.0/include -isystem /opt/local/include/atkmm-1.6 -isystem /opt/local/include/gtk-3.0/unix-print -isystem /opt/local/include/gdkmm-3.0 -isystem /opt/local/lib/gdkmm-3.0/include -isystem /opt/local/include/giomm-2.4 -isystem /opt/local/lib/giomm-2.4/include -isystem /opt/local/include/pangomm-1.4 -isystem /opt/local/lib/pangomm-1.4/include -isystem /opt/local/include/glibmm-2.4 -isystem /opt/local/lib/glibmm-2.4/include -isystem /opt/local/include/cairomm-1.0 -isystem /opt/local/lib/cairomm-1.0/include -isystem /opt/local/include/sigc++-2.0 -isystem /opt/local/lib/sigc++-2.0/include -isystem /opt/local/include/gtk-3.0 -isystem /opt/local/include/at-spi2-atk/2.0 -isystem /opt/local/include/at-spi-2.0 -isystem /opt/local/include/atk-1.0 -isystem /opt/local/include/gio-unix-2.0 -isystem /opt/local/include/gdk-pixbuf-2.0 -isystem /opt/local/include/gspell-1 -isystem /opt/local/include/enchant-2 -isystem /opt/local/libexec/boost/1.76/include -isystem /opt/local/include/ImageMagick-6 -isystem /opt/local/include/2geom-1.1.0 -pipe -I/opt/local/libexec/boost/1.76/include -Os -DNDEBUG -I/opt/local/libexec/boost/1.76/include -I/opt/local/include -stdlib=libc++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Werror=format -Werror=format-security -Wno-switch -arch x86_64 -mmacosx-version-min=10.13 -fPIC   -fPIC -fdiagnostics-color -std=gnu++17 -MD -MT src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o -MF src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o.d -o src/CMakeFiles/inkscape_base.dir/display/cairo-utils.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src/display/cairo-utils.cpp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src/display/cairo-utils.cpp:775:20: error: no matching function for call to 'isnan'
:info:build                 if(std::isnan(arc->initialAngle()) || std::isnan(arc->finalAngle())) {
:info:build                    ^~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:505:1: note: candidate template ignored: requirement 'std::is_floating_point<Angle>::value' was not satisfied [with _A1 = Geom::Angle]
:info:build isnan(_A1 __lcpp_x) _NOEXCEPT
:info:build ^
:info:build /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:513:1: note: candidate template ignored: requirement 'std::is_integral<Angle>::value' was not satisfied [with _A1 = Geom::Angle]
:info:build isnan(_A1) _NOEXCEPT
:info:build ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_inkscape/inkscape/work/inkscape-1.1.2/src/display/cairo-utils.cpp:775:55: error: no matching function for call to 'isnan'
:info:build                 if(std::isnan(arc->initialAngle()) || std::isnan(arc->finalAngle())) {
:info:build                                                       ^~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:505:1: note: candidate template ignored: requirement 'std::is_floating_point<Angle>::value' was not satisfied [with _A1 = Geom::Angle]
:info:build isnan(_A1 __lcpp_x) _NOEXCEPT
:info:build ^
:info:build /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:513:1: note: candidate template ignored: requirement 'std::is_integral<Angle>::value' was not satisfied [with _A1 = Geom::Angle]
:info:build isnan(_A1) _NOEXCEPT
:info:build ^
:info:build 2 errors generated.

Attachments (2)

main.log (2.2 MB) - added by ngwood 3 years ago.
patch-src_display_cairo-utils_cpp.diff (638 bytes) - added by detlevd (Detlev Droege) 2 years ago.
Patch to resolve std::isnan problem

Change History (13)

Changed 3 years ago by ngwood

Attachment: main.log added

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

This was previously reported in #64711 but it was closed as invalid for some reason.

I see from your log that you have Xcode 10.1 and Apple Clang 1000.11.45.5, which are the latest version for High Sierra.

std::isnan is a C++11 feature. I see from your log that the -std=gnu++17 flag is present, so that should be sufficient.

Maybe a required header isn't being included? std::isnan is defined in <cmath>. If #include <cmath> doesn't appear in the affected source file, try adding that.

We don't see the problem on the High Sierra buildbot worker but it has Xcode 9.4.1 which I guess isn't new enough to support C++17 so the build is using MacPorts Clang 13 instead.

I didn't see an issue reported about this upstream: https://gitlab.com/inkscape/inkscape/-/issues; maybe someone could file one.

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 in reply to:  1 ; Changed 3 years ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

This was previously reported in #64711 but it was closed as invalid for some reason.

The previous ticket was closed, as the issue did not occur after the user re-installed MacPorts.

@ngwood, was MacPorts installed fresh on 10.13? Or did you have a pre-existing MacPorts installation from an earlier macOS release, which was then upgraded to 10.13?

comment:3 in reply to:  2 Changed 3 years ago by ngwood

Replying to mascguy:

The previous ticket was closed, as the issue did not occur after the user re-installed MacPorts.

@ngwood, was MacPorts installed fresh on 10.13? Or did you have a pre-existing MacPorts installation from an earlier macOS release, which was then upgraded to 10.13?

Thank you for your help.

It's interesting that this problem disappeared for githubbjs after a reinstallation of MacPorts.

I believe that I originally installed MacPort on a fresh installation of macOS 10.13.6 using MacPorts-2.7.1-10.13-HighSierra.pkg. I installed Xcode via Xcode_10.1.xip and Command Line Tools via Command_Line_Tools_macOS_10.13_for_Xcode_10.1.dmg. I do recall requiring to restore from a TimeMachine backup at one point, but I do not believe that would be problematic. I can certainly try reinstalling MacPort if that is worth doing; if you would prefer I hold off doing so please let me know.

comment:4 in reply to:  1 Changed 3 years ago by ngwood

Replying to ryandesign:

Maybe a required header isn't being included? std::isnan is defined in <cmath>. If #include <cmath> doesn't appear in the affected source file, try adding that.

Directly including cmath in the offending file did not resolve the issue.

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

it appears geom::Angle does not match any of the inputs accepted by std::isnan on that compiler in that mode.

So, not sure why not, perhaps a cast would fix it.

But just forcing a newer compiler might be much simpler, as that appears to work, and life is often too short to spend hours to make stuff work with relic compilers for no good reason.

comment:6 Changed 3 years ago by evanmiller (Evan Miller)

You might also want to try out the inkscape-devel port. This is the Inkscape 1.2 beta version, which will graduate to a stable release soon. It's possible the issue is already fixed in there, and if not any fix will need to end up there.

comment:7 Changed 3 years ago by ngwood

For completeness I did try re-installing MacPorts, but it did not resolve the issue.

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

Cc: cooljeanius added

comment:9 Changed 2 years ago by detlevd (Detlev Droege)

Same here, with inkscape 1.1.2 as well as with v1.2.0, on High Sierra (10.13.6) with XCode 10.1. Apparrently, the compiler isn't able to derive the base type 'Coord' (aka double) and thus fails. This can be resolved by explicitly accessing the stored value, that is by changing the line in src/display/cairo-utils.cpp

                if(std::isnan(arc->initialAngle()) || std::isnan(arc->finalAngle())) {

to

                if(std::isnan(arc->initialAngle().radians0()) || std::isnan(arc->finalAngle().radians0())) {

I'll attach a diff file.

This part compiles fine now for me, but now v1.2.0 seems to have another issue in src/ui/dialog/objects.cpp where it doesn't compile a call to extract() although gnu++17 is switched on, but that's for another ticket.

Changed 2 years ago by detlevd (Detlev Droege)

Patch to resolve std::isnan problem

comment:10 in reply to:  9 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to detlevd:

Same here, with inkscape 1.1.2 as well as with v1.2.0, on High Sierra (10.13.6) with XCode 10.1.

[...]

This part compiles fine now for me, but now v1.2.0 seems to have another issue in src/ui/dialog/objects.cpp where it doesn't compile a call to extract() although gnu++17 is switched on, but that's for another ticket.

Confirmed, I'm also seeing these issues on 10.13. Building with a newer version of Clang solves both, and I'll push a fix momentarily.

comment:11 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In bcf9aa4b895075858413b214e5da204dc92ac987/macports-ports (master):

inkscape/inkscape-devel: blacklist older clang versions
Fixes: #65002

Note: See TracTickets for help on using tickets.