Opened 14 months ago

Last modified 3 months ago

#62445 assigned defect

hugin-app @2019.2.0_3 fails to build due to implicit declaration

Reported by: petrvokac Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: catalina bigsur monterey Cc: bal-agates
Port: hugin-app

Description (last modified by jmroot (Joshua Root))

pmm:~ pet$ sudo port install hugin-app
Warning: The macOS 11.2 SDK does not appear to be installed. Ports may not build correctly.
Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Computing dependencies for hugin-app
--->  Fetching archive for hugin-app
--->  Attempting to fetch hugin-app-2019.2.0_3+accelerate+python38.darwin_20.arm64.tbz2 from https://packages.macports.org/hugin-app
--->  Attempting to fetch hugin-app-2019.2.0_3+accelerate+python38.darwin_20.arm64.tbz2 from https://cph.dk.packages.macports.org/hugin-app
--->  Attempting to fetch hugin-app-2019.2.0_3+accelerate+python38.darwin_20.arm64.tbz2 from https://lil.fr.packages.macports.org/hugin-app
--->  Fetching distfiles for hugin-app
--->  Verifying checksums for hugin-app
--->  Extracting hugin-app
--->  Applying patches to hugin-app
--->  Configuring hugin-app
--->  Building hugin-app
Error: Failed to build hugin-app: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_hugin-app/hugin-app/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port hugin-app failed

pmm:~ pet$ uname -a
Darwin pmm.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64

Attachments (2)

main.log (358.2 KB) - added by petrvokac 14 months ago.
build log file
patch-compiler.h.diff (809 bytes) - added by bal-agates 3 months ago.
patch file for levmar compiler.h changing finite() to isfinite().

Download all attachments as: .zip

Change History (7)

Changed 14 months ago by petrvokac

Attachment: main.log added

build log file

comment:1 Changed 14 months ago by jmroot (Joshua Root)

Description: modified (diff)
Keywords: catalina bigsur added
Owner: set to MarcusCalhoun-Lopez
Port: hugin-app added
Status: newassigned
Summary: hugin-app build failed on M1hugin-app @2019.2.0_3 fails to build due to implicit declaration
: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/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

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

Cc: bal-agates added
Keywords: monterey added

Has duplicate #64593.

comment:3 Changed 3 months ago by bal-agates

Sorry for creating duplicate. I saw this Trac issue but only looked at submission text and didn't see it correlated with my problem.

I agree with assessment of finite() vs isfinite() in #64593. The code in hugin-2019.2.0/src/foreign/levmar seems ancient. Two things help obscure this.

  • "man finite" on my macOS 12.2 system does return FINITE(3) referencing #include <math.h> and finite().
  • On my system (Xcode 13.2.1) the math.h header file has the following BUT it is guarded by #if defined __i386__ || defined __x86_64__
    /* Legacy BSD API; use the C99 `isfinite( )` macro instead.                   */
    extern int finite(double)
    __API_DEPRECATED("Use `isfinite((double)x)` instead.", macos(10.0, 10.9))
    

I am using an arm64 system so I saw no deprecation message. Apparently Apple has not gotten around to updating the man pages nor updated the guard for arm64.

I applied patch patch-compiler.h.diff (attached) that changes compiler.h with

  • added #include <math.h>
  • changed finite to isfinite in two places

This did allow the project to build on my system and mostly ran but I ran into several some new apparently problems with paths. I will submit separate Trac issue for those.

On a side note I checked the most currently released sources (2021.0) for hugin and compiler.h still references finite().

My question is, what is the right way to change the hugin-app Portfile. Should this patch be applied to all MacPort builds with the risk that it might not work with some very old macOS or old compiler, letting someone else deal with issues it causes on old systems? Or should some check be done on the compiler version and selectively apply the patch for newer compilers? What check? Or should the project just require C99 (or newer) compiler? It is impossible for me to test on most other macOS or compiler versions. Is there a general philosophy to approaching problems like this in MacPorts?

Another curiosity question is why does the port health at https://ports.macports.org/port/hugin-app/details/ show that the build is working for Monterey (x64_64), Big Sur (x64_64),... Why wouldn't those have the same problem I am seeing? Is it only arm64 systems that have finite() removed? Would all of these other systems have isfinite()?

Changed 3 months ago by bal-agates

Attachment: patch-compiler.h.diff added

patch file for levmar compiler.h changing finite() to isfinite().

comment:4 Changed 3 months ago by reneeotten (Renee Otten)

I would recommend to first update the port to the latest upstream version, it's possible that the issues you're seeing are already resolved upstream.

comment:5 Changed 3 months ago by bal-agates

See prior comment

"On a side note I checked the most currently released sources (2021.0) for hugin and compiler.h still references finite()."

I suppose they could have fixed the problem with a configuration patch or some other means.

Before upgrading the sources I wanted to see how a presumable working version worked. Hugin 2020 and 2021 sources had no macOS release. Apparently they had no Mac developer. I am expecting many new problems. Also see #64601 for additional problems I have found with build using the sources in the current hugin-app port. If this port worked at one time these problems are probably related to macOS or compiler changes? At some point I will try latest Hugin sources.

Note: See TracTickets for help on using tickets.