#71080 closed defect (invalid)
libpng @1.6.44: Undefined symbols _png_do_expand_palette_rgb8_neon _png_do_expand_palette_rgba8_neon _png_init_filter_functions_neon _png_riffle_palette_neon
Reported by: | mbassalbioinformatics (Mahmoud A. Bassal) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.10.2 |
Keywords: | arm64 | Cc: | |
Port: | libpng |
Description
Unable to install libpng on macos sonoma 15.0 on AS M3 Max
---> Computing dependencies for libpng ---> Fetching archive for libpng ---> Attempting to fetch libpng-1.6.44_0.darwin_24.arm64.tbz2 from https://packages.macports.org/libpng ---> Attempting to fetch libpng-1.6.44_0.darwin_24.arm64.tbz2 from https://kmq.jp.packages.macports.org/libpng ---> Attempting to fetch libpng-1.6.44_0.darwin_24.arm64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/libpng ---> Fetching distfiles for libpng ---> Verifying checksums for libpng ---> Extracting libpng ---> Configuring libpng ---> Building libpng Error: Failed to build libpng: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_libpng/libpng/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port libpng failed
Attachments (1)
Change History (11)
Changed 5 weeks ago by mbassalbioinformatics (Mahmoud A. Bassal)
comment:1 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | arm64 added; libpng removed |
---|---|
Port: | libpng added |
Summary: | error installing libpng @libpng-1.6.44_0.darwin_24.arm64 → libpng @1.6.44: Undefined symbols _png_do_expand_palette_rgb8_neon _png_do_expand_palette_rgba8_neon _png_init_filter_functions_neon _png_riffle_palette_neon |
Your log shows missing ARM NEON symbols:
:info:build Undefined symbols for architecture arm64: :info:build "_png_do_expand_palette_rgb8_neon", referenced from: :info:build _png_do_read_transformations in pngrtran.o :info:build "_png_do_expand_palette_rgba8_neon", referenced from: :info:build _png_do_read_transformations in pngrtran.o :info:build "_png_init_filter_functions_neon", referenced from: :info:build _png_read_filter_row in pngrutil.o :info:build "_png_riffle_palette_neon", referenced from: :info:build _png_do_read_transformations in pngrtran.o :info:build ld: symbol(s) not found for architecture arm64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation) :info:build make[1]: *** [libpng16.la] Error 1 :info:build make[1]: *** Waiting for unfinished jobs....
These symbols are supposed to be created from ARM NEON-specific libpng code files filter_neon_intrinsics.c and palette_neon_intrinsics.c but your log shows these didn't get compiled.
I believe the cause is shown on line 3 of your log:
:debug:sysinfo macOS 15.0 (darwin/24.0.0) arch i386
Although you are trying to build for arm64, and you state you are using an Apple Silicon Mac, MacPorts thinks you are on an Intel Mac.
The usual reason for this to happen is if you are running the MacPorts port
command from within an Intel shell. And the usual reason why you might be running an Intel shell is if you are running an Intel terminal program.
The solution is to use an Apple Silicon terminal program, such as the Terminal app that Apple includes with macOS.
comment:2 Changed 5 weeks ago by mbassalbioinformatics (Mahmoud A. Bassal)
I’m using the built-in Terminal program as suggested.
I have also deactivated conda entirely and attempted to install but still get the same error trying to install libpng. Is there any particular command to ensure the architecture for install?
comment:3 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)
Open a new Terminal window and type arch
. On an Apple Silicon Mac it should say arm64
. If it says i386
you are running an Intel shell.
If so, check your Terminal app in the Finder. Navigate to /Applications/Utilities, click Terminal, and choose Get Info from the File menu. Is the Open in Rosetta checkbox checked? If so, uncheck it and quit and reopen Terminal.
comment:4 Changed 5 weeks ago by mbassalbioinformatics (Mahmoud A. Bassal)
yep that sorted it out. terminal was set to rosetta. Thanks!
comment:5 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)
I'm glad that worked! But I'm curious. You're not the first person who has had this issue, but I'm having trouble understanding how it comes about. Had you deliberately changed Terminal to open in Rosetta before? If so, what was the reason? Or is this checkbox getting checked on some people's systems without their knowledge?
comment:6 Changed 5 weeks ago by mbassalbioinformatics (Mahmoud A. Bassal)
While i dont remember making this change, i wouldnt put it past me as having done so. Reason being that for my work, a lot of packages and tools still arent compiled or are usable natively on AS macs and are required to run through rosetta to actually work. The sad state of things is that im sure the packages installed on my system are a mix of both native and translated. As noted earlier, i use conda to manage different development environments and so ive noticed that different developers will use different way to test whether its an intel or AS mac and install whichever version is required/is compatible that way. Even the software i was trying to install, which requires libpng, has packages that are installed some native, some translated. Some packages failed and i had to install using brew or other means then continue the macports install. Its just messy.
I do appreciate your prompt help to try to get this sorted out!! Keep up the great work please!!!
comment:7 follow-up: 9 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → invalid |
---|---|
Status: | new → closed |
Ok, I'll try to keep that Open in Rosetta checkbox in mind when diagnosing similar problems in the future.
If you need software installed for both x86_64 and arm64 you can use the +universal variant (e.g. sudo port install libpng +universal
). This is less well tested than the usual single native arch build so you might run into problems, but it is at least something that we intend to have work correctly. On the other hand, running MacPorts through Rosetta emulation is not something we ever imagined users would do and it can lead to surprising problems, like the one you encountered here with libpng, that I'm not even sure how to fix.
You mentioned Homebrew. Hopefully, since you're using MacPorts, you no longer have Homebrew installed. Having both Homebrew and MacPorts installed usually causes problems so we ask you to choose one and uninstall the other.
comment:8 follow-up: 10 Changed 5 weeks ago by mbassalbioinformatics (Mahmoud A. Bassal)
Unfortunately for bioinformatics tools, you need both macports and homebrew as you sometimes need packages from one thats not available in the other. This is in addition to also running conda and using that for even a 3rd set of packages and tools. As noted, it is messy and its very frustrating to diagnose and figure out how to get things to work but thats bioinformatics atm. Its a field that needs massive overhaul and consistency in terms of software tools and development. But that is well beyond the scope of any single package.
Again, much appreciated for all your help.
comment:9 Changed 4 weeks ago by jmroot (Joshua Root)
Replying to ryandesign:
On the other hand, running MacPorts through Rosetta emulation is not something we ever imagined users would do and it can lead to surprising problems, like the one you encountered here with libpng, that I'm not even sure how to fix.
I've been thinking about how to mitigate these kinds of issues for a while, and I just pushed a change that should help: [eee437c415b4e1d17eeb57fecff633f1d3846ffd/macports-base]
comment:10 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)
Replying to mbassalbioinformatics:
Unfortunately for bioinformatics tools, you need both macports and homebrew as you sometimes need packages from one thats not available in the other.
This will cause problems so we do not support this. If software you need is missing from MacPorts (or Homebrew) you can request or supply ports (or formulas) for that software.
install main.log file