Opened 3 years ago

Last modified 2 years ago

#63630 assigned defect

OpenBLAS @0.3.18_0+gcc7+lapack+native: Builds ppc7400 on a G3

Reported by: evanmiller (Evan Miller) Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: powerpc g3 Cc: michaelld (Michael Dickens), cooljeanius (Eric Gallager)
Port: OpenBLAS

Description

$ lipo -info /opt/local/lib/libopenblas.1.dylib
Non-fat file: /opt/local/lib/libopenblas.1.dylib is architecture: ppc7400
$ sysctl hw.model
hw.model: PowerMac4,1

The Portfile and Makefiles look like they want to support G3 via -force_cpusubtype_ALL but this doesn't seem to be sticking for some reason.

Let me know if I can provide any other information.

Attachments (1)

openblas-g3-main.log (4.6 MB) - added by evanmiller (Evan Miller) 3 years ago.

Change History (8)

comment:1 Changed 3 years ago by NicosPavlov

A build log would definitely be helpful, but they are automatically deleted upon successful install. You can force them to stay around by setting "keeplogs yes" in /opt/local/etc/macports.conf, then uninstall OpenBLAS, and install again with "sudo port -v install openblas +native". The log will be kept in the folder /opt/local/var/macports/logs.

Just in case you did not already, did you try to build with the +native variant? It ensures that you actually build the port, instead of downloading a pre-built binary, which may help in that case.

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

As noted in the title it is indeed +native. I will rebuild and supply a log.

Changed 3 years ago by evanmiller (Evan Miller)

Attachment: openblas-g3-main.log added

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

Build log attached. It appears that -force_cpusubtype_ALL is passed to the C compiler but not to the Fortran compiler.

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

I've done a little more research here. Adding -force_cpusubtype_ALL to the Fortran flags results in libopenblas-r1.a being built as ppc, which is good. However, the final link phase that converts the static archive to a dylib results in the creation of a ppc7400 dylib file, even though -force_cpusubtype_ALL is explicitly passed. So maybe it's a compiler issue - I'm not sure.

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

Removing -all_load from the final link stage seems to fix it. This approach needs testing (not sure why -all_load is being added when there is an explicit export list?) but I will prepare a patch for further discussion.

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

After some further tinkering, I was able to compile and link on the G3, but running several of the tests I am encountering SIGILL (Illegal instruction). I have not confirmed but this is consistent with a scenario where the ppc7400 is still being compiled and executed - -force_cpusubtype_ALL is just relabeling the dylib as ppc.

If there is ever a revival of interest in G3s this would be a good candidate (perhaps the only candidate) for my opt-in Altivec architecture proposal:

https://github.com/macports/macports-base/pull/245

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

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