Opened 3 years ago

Closed 3 years ago

#64593 closed defect (duplicate)

hugin-app-2019.2.0_4+accelerate+python39: error: implicitly declaring library function 'finite' with type 'int (double)'

Reported by: bal-agates Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: catalina bigsur monterey Cc:
Port: hugin-app

Description

Attempt to build hugin-app failed on macOS 12.2 arm64. See enclosed main.log.

If I am interpreting the log correctly it looks like an error generated by implicitly used function finite() from lm_core.c and compiler.h.

_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_hugin-app/hugin-app/work/hugin-2019.2.0/src/foreign/levmar/lm_core.c:182:7: error: implicitly declaring library function 'finite' with type 'int (double)' [-Werror,-Wimplicit-function-declaration]
:info:build   if(!LM_FINITE(p_eL2)) stop=7;
:info:build       ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_hugin-app/hugin-app/work/hugin-2019.2.0/src/foreign/levmar/compiler.h:36:19: note: expanded from macro 'LM_FINITE'
:info:build #define LM_FINITE finite // ICC, GCC
:info:build                   ^

In compiler.h it seems to be selecting conditional

#elif defined(__ICC) || defined(__INTEL_COMPILER) || defined(__GNUC__)
#define LM_FINITE finite // ICC, GCC

The #else clause is the same so different set of compiler #define's would still produce the same error.

From the build log on my system it seems to be selecting "clang 1300.0.29.30".

Possible fixes I can think of are

  • Turn off implicit function errors.
  • See if adding "#include <math.h>" fixes the problem without creating new problems.
  • Add a prototype for finite() in compiler.h.

Not sure which one would be better or it finite() is actually in standard library.

This port uses a pretty outdated version of hugin sources. Possible fixed in newer sources? I wanted to get existing Portfile working before trying to upgrade sources.

Attachments (1)

main.log (259.9 KB) - added by bal-agates 3 years ago.
hugin-app build main.log

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by bal-agates

Attachment: main.log added

hugin-app build main.log

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

Keywords: catalina bigsur monterey added; hugin build finite removed
Resolution: duplicate
Status: newclosed
Summary: hugin-app-2019.2.0_4+accelerate+python39: build failure on macOS 12.2 arm64hugin-app-2019.2.0_4+accelerate+python39: error: implicitly declaring library function 'finite' with type 'int (double)'

finite is an ancient (pre-C99) system function. It was replaced in C99 with isfinite. Whichever hugin wants to use, it should include the system header that defines it. Defining your own prototypes for system functions doesn't seem like a good idea to me, besides being more work than just including the right header.

Duplicate of #62445.

Note: See TracTickets for help on using tickets.