Opened 4 weeks ago

Last modified 4 weeks ago

#57797 assigned defect

OpenBLAS @0.3.4_1 forces system AR and RANLIB but this errors on older systems

Reported by: kencu (Ken) Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard leopard Cc: michaelld (Michael Dickens)
Port: openblas

Description (last modified by kencu (Ken))

The Portfile does this:

# Using system ones as default is set to bin/gcc-ar which does not
# exist, and using gcc-mp ones end up in an error about a missing
# plugin. (see ticket #38551 for example)
build.args          "AR=/usr/bin/ar RANLIB=/usr/bin/ranlib"

but on some systems, that results in the following, because the system cctools are too old to understand the objects coming out of the newer compilers (usually clang-3.9+):

ar: creating archive ../libopenblas-r1.a
/usr/bin/ranlib: object: ../libopenblas-r1.a(comatcopy.o) malformed object (unknown load command 2)
/usr/bin/ar: internal ranlib command failed
make[1]: *** [libs] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/OpenBLAS-0.3.4/interface'

I don't presently have a well-thought-out plan for what to do with this issue. This force went into the Portfile a long time ago for a gcc related issue. Probably need to have a dependency on cctools and then force the build to use those, but which systems crossed with which compilers has not been fully worked out yet.

Change History (4)

comment:1 Changed 4 weeks ago by kencu (Ken)

Description: modified (diff)

comment:2 Changed 4 weeks ago by kencu (Ken)

OpenBLAS builds on all the builders it seems. It's only when newer compilers are defaulted on older systems that this comes up. Fix is:

depends_build-append port:cctools
build.args           "AR=${prefix}/bin/ar RANLIB=${prefix}/bin/ranlib"

for anyone who stumbles upon this.

comment:3 Changed 4 weeks ago by NicosPavlov

Thanks for the comment. I did not notice, but it indeed seems that forcing the use of system's ar and ranlib is not needed anymore in several cases.

I tried on Mojave, and several combinations of compilers build properly even without that line in the Portfile.

comment:4 Changed 4 weeks ago by kencu (Ken)

I was going to suggest just removing the line, but in fact I got an error. I didn't record it -- something like /opt/local/bin/mp-ar not found, IIRC.

So ... dunno. Probably could fix it with a combo of system < 10 and configure.compiler matches *clang* tests, if we wanted to .

I can do that sometime in the next while if you like.

Last edited 4 weeks ago by kencu (Ken) (previous) (diff)
Note: See TracTickets for help on using tickets.