Opened 5 months ago

Last modified 4 months ago

#68868 new defect

OpenBLAS, OpenBLAS-devel now broken on PowerPC [FIXED]

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: powerpc Cc: catap (Kirill A. Korinsky), szhorvat (Szabolcs Horvát), Dave-Allured (Dave Allured)
Port: OpenBLAS, OpenBLAS-devel

Description

There seems to be two issues:

  1. Wrong upstream code for bitness in system_check.cmake, which forces -m64 flag with ppc (32 bit). Trivially fixable, either with bringing the source to sanity or by passing -DBINARY=32.
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS-devel/work/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_d8baf/fast && /usr/bin/make  -f CMakeFiles/cmTC_d8baf.dir/build.make CMakeFiles/cmTC_d8baf.dir/build
Building C object CMakeFiles/cmTC_d8baf.dir/src.c.o
/opt/local/bin/gcc-mp-13 -DCMAKE_HAVE_LIBC_PTHREAD  -pipe -O3 -DNDEBUG -I/opt/local/include -arch ppc  -DHAVE_C11 -Wall -m64 -fPIC -DNO_AVX -DNO_AVX2 -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -DMAX_PARALLEL_NUMBER=1 -DMAX_STACK_ALLOC=2048 -DNO_AFFINITY -DVERSION="\"0.3.25.dev\"" -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16  -arch ppc -mmacosx-version-min=10.6 -o CMakeFiles/cmTC_d8baf.dir/src.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS-devel/work/build/CMakeFiles/CMakeTmp/src.c
gcc-mp-13: warning: '-m64' conflicts with '-arch ppc' ('-m64' ignored)
{standard input}:1:invalid .machine argument: ppc7400
make[1]: *** [CMakeFiles/cmTC_d8baf.dir/src.c.o] Error 1
make: *** [cmTC_d8baf/fast] Error 2

Here is the bug, and apparently it was never tested on ppc even on Linux:

if (NOT BINARY)
  if (X86_64 OR ARM64 OR POWER OR MIPS64 OR LOONGARCH64 OR RISCV64)
    set(BINARY 64)
  else ()
    set(BINARY 32)
  endif ()
endif()
  1. Something broken further with number of arguments; not sure if it is upstream issue or something in our patches messes it up. Or another bug in CMake.
-- Reading vars from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_OpenBLAS/OpenBLAS-devel/work/OpenBLAS-864c65b526945604597ef9da1571a2f36b408054/kernel/power/KERNEL...
-- Reading vars from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_OpenBLAS/OpenBLAS-devel/work/OpenBLAS-864c65b526945604597ef9da1571a2f36b408054/kernel/power/KERNEL.PPC970...
CMake Error at cmake/utils.cmake:106 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  kernel/CMakeLists.txt:13 (ParseMakefileVars)
  kernel/CMakeLists.txt:1371 (build_core)


CMake Error at cmake/utils.cmake:106 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  kernel/CMakeLists.txt:13 (ParseMakefileVars)
  kernel/CMakeLists.txt:1371 (build_core)


CMake Error at cmake/utils.cmake:106 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  kernel/CMakeLists.txt:13 (ParseMakefileVars)
  kernel/CMakeLists.txt:1371 (build_core)


CMake Error at cmake/utils.cmake:106 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  kernel/CMakeLists.txt:13 (ParseMakefileVars)
  kernel/CMakeLists.txt:1371 (build_core)

I will make a PR to fix arch detection, but first need to understand what is breaking configure. No time today, will return to this tomorrow. Broken OpenBLAS is a disaster :(

Change History (7)

comment:1 Changed 5 months ago by catap (Kirill A. Korinsky)

I suggest to fix it at upstream and backport patch.

comment:2 in reply to:  1 Changed 5 months ago by barracuda156

Replying to catap:

I suggest to fix it at upstream and backport patch.

Do you have an idea why this args number mismatch?

Bitness I can fix for upstream.

comment:3 Changed 5 months ago by catap (Kirill A. Korinsky)

I never saw anything like this, and outside of PPC it works fine.

comment:4 in reply to:  3 Changed 5 months ago by barracuda156

Replying to catap:

I never saw anything like this, and outside of PPC it works fine.

This fixes it: https://github.com/OpenMathLib/OpenBLAS/pull/4370 https://github.com/macports/macports-ports/pull/21777

comment:5 Changed 4 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:6 Changed 4 months ago by barracuda156

This ticket should be closed, I have fixed the issue in the master (here and upstream).

comment:7 Changed 4 months ago by barracuda156

Summary: OpenBLAS, OpenBLAS-devel now broken on PowerPCOpenBLAS, OpenBLAS-devel now broken on PowerPC [FIXED]
Note: See TracTickets for help on using tickets.