Bug 245467

Summary: math/openblas - fails to build (amd64/12.1-p3)
Product: Ports & Packages Reporter: AS <asharp>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: arrowd, dewayne, phd_kimberlite
Priority: --- Flags: phd_kimberlite: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   

Description AS 2020-04-09 05:24:17 UTC
Output snippet from compilation (gfortran9 / internal compiler error: Illegal Instruction):

ar  -ru ../../libopenblas_nehalemp-r0.3.7.a strtri_UU_single.o strtri_UN_single.o strtri_LU_single.o strtri_LN_single.o strtri_UU_parallel.o strtri_UN_parallel.o strtri_LU_parallel.o strtri_LN_parallel.o dtrtri_UU_single.o dtrtri_UN_single.o dtrtri_LU_single.o dtrtri_LN_single.o dtrtri_UU_parallel.o dtrtri_UN_parallel.o dtrtri_LU_parallel.o dtrtri_LN_parallel.o ctrtri_UU_single.o ctrtri_UN_single.o ctrtri_LU_single.o ctrtri_LN_single.o ctrtri_UU_parallel.o ctrtri_UN_parallel.o ctrtri_LU_parallel.o ctrtri_LN_parallel.o ztrtri_UU_single.o ztrtri_UN_single.o ztrtri_LU_single.o ztrtri_LN_single.o ztrtri_UU_parallel.o ztrtri_UN_parallel.o ztrtri_LU_parallel.o ztrtri_LN_parallel.o qtrtri_UU_single.o qtrtri_UN_single.o qtrtri_LU_single.o qtrtri_LN_single.o qtrtri_UU_parallel.o qtrtri_UN_parallel.o qtrtri_LU_parallel.o qtrtri_LN_parallel.o xtrtri_UU_single.o xtrtri_UN_single.o xtrtri_LU_single.o xtrtri_LN_single.o xtrtri_UU_parallel.o xtrtri_UN_parallel.o xtrtri_LU_parallel.o xtrtri_LN_parallel.o
gmake[4]: Leaving directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7/lapack/trtri'
gmake[3]: Leaving directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7/lapack'
gmake[3]: Entering directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7/lapack-netlib'
gmake -C SRC
gmake[4]: Entering directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7/lapack-netlib/SRC'
gfortran9 -O -Wl,-rpath=/usr/local/lib/gcc9 -O2 -m128bit-long-double -Wall -frecursive -fno-optimize-sibling-calls -m64 -fPIC -c -o sbdsvdx.o sbdsvdx.f
<built-in>: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[4]: *** [Makefile:604: sbdsvdx.o] Error 1
gmake[4]: Leaving directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7/lapack-netlib/SRC'
gmake[3]: *** [Makefile:21: lapacklib] Error 2
gmake[3]: Leaving directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7/lapack-netlib'
gmake[2]: *** [Makefile:229: netlib] Error 2
gmake[2]: Leaving directory '/usr/ports/math/openblas/work/OpenBLAS-0.3.7'
*** Error code 1

FYI - under "make config", no options are selected.
Comment 1 Eijiro Shibusawa 2020-05-02 00:57:43 UTC
Updating math/openblas is in progress (BUG246095).
Could you try to use the updated version?
Although the updated port passed poudriere test it may not solve your problem.
In this case it may be hardware dependent and please contact openblas developers.
Comment 2 dewayne 2020-05-03 08:01:35 UTC
openblas is one of the few ports that you have to fight, sometimes.  It appears to be sensitive to various compiler and linker flags, though by the time it gets to the fortran bits, its made up its own mind.

You should review your settings using:
make -C /usr/ports/math/openblas -DUSE_K8 -VCC -VCFLAGS -VLDFLAGS
(there's a hint if you want more help, you'll need to provide more information, including which FreeBSD version you're on, and whether you're building within a jail etc.)  I'm having some run time problems with all ports built in a jail that run in the jail but not the i386 target??? point being that more information is helpful :) )

There are files in the top layer (under work/) that provide clues.  For me, I have the following in my make.conf, to ensure that it builds for my architecture (using FBSD 12.1S amd64 and gcc 9.3.0 with binutils 2.33.  I completed a rebuild of all ports on April 25, including openblas 3.7_3,1 - so its unlikely to be a problem with the compiler, as the hint of an "illegal instruction" points elsewhere; you might need to revisit your build environment?)

.if (!empty(.CURDIR:M/usr/ports/math/openblas) || !empty(.CURDIR:M/var/ports/usr/ports/math/openblas) )
math_openblas_SET=AVX AVX2
TARGET_CPU_ARCH=HASWELL  # please note I has a haswell cpu

while for i386 I have
math_openblas_UNSET=AVX AVX2

Hope that helps.
Comment 3 Gleb Popov freebsd_committer 2021-03-20 08:19:00 UTC
Closing with "Feedback timeout", the reporter did not reply.