Bug 263575 - math/openblas: 0.3.20 CPU detected failed
Summary: math/openblas: 0.3.20 CPU detected failed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-26 07:38 UTC by Boris Tassou
Modified: 2022-06-01 06:53 UTC (History)
3 users (show)

See Also:
phd_kimberlite: maintainer-feedback+


Attachments
build_openblas (16.84 KB, text/plain)
2022-04-27 12:30 UTC, Boris Tassou
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Tassou 2022-04-26 07:38:19 UTC
Hi,

With FreeBSD 13.0-RELEASE-p11 and poudriere 3.3.7.

I have some packages with dependancies OpenBlas but when poudriere try to compile it i have this error :

Makefile:160: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
gmake[1]: Leaving directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.3.20'


I tried to add to make.conf (like it's said in log file):
MAKE_JOBS_UNSAFE = yes

But same error.

The cpu view by FreeBSD :
sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: amd64
hw.model: Common KVM processor
hw.ncpu: 6
hw.machine_arch: amd64

The host have two L5640 so i tried to add :
TARGET = WESTMERE

Same error, so i tried :
TARGET = -

Same error.

I tried to add DYNAMIC_ARCH option, but same error.

The options file:
# This file is auto-generated by 'make config'.
# Options for openblas-0.3.20,1
_OPTIONS_READ=openblas-0.3.20,1
_FILE_COMPLETE_OPTIONS_LIST=AVX AVX2 DYNAMIC_ARCH INTERFACE64 OPENMP
OPTIONS_FILE_UNSET+=AVX
OPTIONS_FILE_UNSET+=AVX2
OPTIONS_FILE_SET+=DYNAMIC_ARCH
OPTIONS_FILE_UNSET+=INTERFACE64
OPTIONS_FILE_SET+=OPENMP

I don't know what to try at this point.

Thanks for the help.
Comment 1 Eijiro Shibusawa 2022-04-27 12:05:16 UTC
Hi, would you please try TARGET=NEHALEM ?
I think your problem is similar to the following.
https://github.com/xianyi/openblas/issues/5

"WESTMERE" is not exists supported TARGET value.
https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt"
Comment 2 Boris Tassou 2022-04-27 12:15:47 UTC
Hi,

I put in make.conf :
TARGET=NEHALEM

but i still have this error :
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[1]: *** [Makefile.prebuild:78: getarch_2nd] Error 1
Makefile:160: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
gmake[1]: Leaving directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.3.20'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

My make.conf :
cat make.conf 
WITH_PKGNG = yes
DISABLE_LICENSES = yes
WITHOUT_X11 = yes
OPTIONS_UNSET += X11
OPTIONS_UNSET += GTK2
TARGET=NEHALEM

The make.conf is here :
/usr/local/etc/poudriere.d/make.conf

and i launch the compilation with poudriere like that :
/usr/local/bin/poudriere bulk -j F130 -z mine math/openblas

Thanks for the help
Comment 3 Boris Tassou 2022-04-27 12:30:30 UTC
Created attachment 233535 [details]
build_openblas
Comment 4 Boris Tassou 2022-04-27 12:30:51 UTC
I tried with TARGET=SANDYBRIDGE but same error.
Comment 5 dewayne 2022-04-28 03:04:03 UTC
(In reply to Boris Tassou from comment #4)
This reply pertains to an earlier openblas, but I've been down the road of using TARGET and other incantations for our target destinations.  Unfortunately some port maintainers adjust various settings, so I decided to be explicit and force things. What we use might provide a clue to help get you going again:  :)

# make -C  /usr/ports/math/openblas -DUSE_K8 -VCC -VCFLAGS -VLDFLAGS
/usr/local/libexec/ccache/gcc10 -march=haswell

-O2 -pipe -g0 -ggdb0 -DSTRIP_FBSDID -fno-math-errno -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3 -Wl,--strip-debug -Wl,--build-id=md5 -Wl,--hash-style=sysv -Wl,-m,elf_x86_64_fbsd -fPIC -DPIC -fPIE -pie -fomit-frame-pointer -fno-asynchronous-unwind-tables -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-clash-protection -fno-signaling-nans -Wl,-rpath=/usr/local/lib/gcc10 -fno-common -march=haswell -march=haswell  -fstack-protector-strong

-Wl,--strip-debug -Wl,--build-id=md5 -Wl,--hash-style=sysv -pie -Wl,-z,notext -z notext -z relro -z now -z noexecstack -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10 -Wl,-rpath=/usr/local/lib/gcc10  -L/usr/local/lib/gcc10 -B/usr/local/bin -fstack-protector

I insert my adjustments via make.conf.  As I recall openblas was one of the more complex (ie difficult) ports to build. (PS I probably should revisit my CFLAGS, but...)
Comment 6 Boris Tassou 2022-05-11 07:18:33 UTC
How do you apply those modifications with a poudriere?

via a specific make.conf?
Comment 7 geraud 2022-05-18 00:14:29 UTC
Hello, I run a poudriere on a FreeBSD 13.1 VM running on Proxmox/KVM and I witnessed the same problem with my build this morning.

Based on the suggestion from Shibusawa san, I added :


.if ${.CURDIR:M*/math/openblas*}
WITH_TARGET_CPU_ARCH=NEHALEM
.endif


to my make.conf file in poudriere.d. Worked just fine.

Hope this helps.

-- 
G.
Comment 8 Boris Tassou 2022-05-19 08:01:10 UTC
This is my /usr/local/etc/poudriere.d/make.conf :
WITH_PKGNG = yes
DISABLE_LICENSES = yes
WITHOUT_X11 = yes
OPTIONS_UNSET += X11
OPTIONS_UNSET += GTK2
.if ${.CURDIR:M*/ports/math/openblas*}
WITH_TARGET_CPU_ARCH=NEHALEM
.endif

I tried with those path :
CURDIR:M*/ports/math/openblas*
CURDIR:M*/math/openblas*

But same.

But i still have the error :
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[1]: *** [Makefile.prebuild:78: getarch_2nd] Error 1
Makefile:160: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
gmake[1]: Leaving directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.3.20'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
Comment 9 Boris Tassou 2022-05-19 08:57:37 UTC
I changed the cpu type on proxmox side from kvm64 to nehalem and the compilation worked.
Comment 10 dewayne 2022-05-19 20:53:01 UTC
(In reply to Boris Tassou from comment #6)
Apologies for delay. My make.conf files include:

TARGET=amd64
TARGET_ARCH=amd64
CPUTYPE=core2  # or haswell as I use different machines.
CFLAGS+= -march=${CPUTYPE}
COPTFLAGS+= -march=${CPUTYPE} -O2
CXXFLAGS+= -march=${CPUTYPE}
COPTFLAGS+= -march=${CPUTYPE}

I do not use poudriere.