Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing bitbake errors with Yocto Jethro #2171

Closed
jaymindabhi opened this issue Jun 28, 2019 · 12 comments
Closed

Facing bitbake errors with Yocto Jethro #2171

jaymindabhi opened this issue Jun 28, 2019 · 12 comments

Comments

@jaymindabhi
Copy link

jaymindabhi commented Jun 28, 2019

Hi Team,

Facing error while integrating opeblas in Yocto Jethro (BB version - 1.28.0), aarch64-oe-linux target system.
Using "openblas_0.2.20.bb" recipe taken from - https://layers.openembedded.org/layerindex/recipe/68888/

Added "openblas" in local.conf.

Following is the error log:

arm-oemllib32-linux-gnueabi-ar  -ru ../../libopenblas_armv8p-r0.2.20.a memory.o xerbla.o c_abs.o z_abs.o openblas_set_num_threads.o openblas_get_num_threads.o openblas_get_num_procs.o openblas_get_config.o openblas_get_parallel.o openblas_error_handle.o openblas_env.o blas_server.o divtable.o blasL1thread.o parameter.o
| make[1]: Leaving directory ' poky/build/tmp-glibc/work/armv7a-vfp-neon-oemllib32-linux-gnueabi/lib32-openblas/0.2.20-r0/OpenBLAS-0.2.20/driver/others'
| make[1]: Entering directory ' poky/build/tmp-glibc/work/armv7a-vfp-neon-oemllib32-linux-gnueabi/lib32-openblas/0.2.20-r0/OpenBLAS-0.2.20/kernel'
| make[1]: *** No rule to make target '../kernel/arm/amax.S', needed by 'samax_k.o'.  Stop.
| make[1]: Leaving directory ' poky/build/tmp-glibc/work/armv7a-vfp-neon-oemllib32-linux-gnueabi/lib32-openblas/0.2.20-r0/OpenBLAS-0.2.20/kernel'
| Makefile:138: recipe for target 'libs' failed
| make: *** [libs] Error 1
| WARNING:  poky/build/tmp-glibc/work/armv7a-vfp-neon-oemllib32-linux-gnueabi/lib32-openblas/0.2.20-r0/temp/run.do_compile.18035:1 exit 1 from
|   exit 1
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (log file is located at  poky/build/tmp-glibc/work/armv7a-vfp-neon-oemllib32-linux-gnueabi/lib32-openblas/0.2.20-r0/temp/log.do_compile.18035)
ERROR: Task 7338 (virtual:multilib:lib32: poky/meta/recipes-devtools/openblas/openblas_0.2.20.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 9358 tasks of which 9344 didn't need to be rerun and 2 failed.
Waiting for 0 running tasks to finish:

Please provide the solution/fix.

Regards,
Jaymin

@martin-frbg
Copy link
Collaborator

Somehow this looks like a mix of 64bit armv8 and 32bit armv7, perhaps the autodetection failed.
But 0.2.20 is quite old anyway,could you try with current 0.3.6 instead ?
(I must admit I am not familiar with yocto)

@jaymindabhi
Copy link
Author

I have tried with 0.3.6 version with following compilation configuration:

oe_runmake HOSTCC="${BUILD_CC}" CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" CROSS_SUFFIX=${HOST_PREFIX} ONLY_CBLAS=1 HOSTCC="${BUILD_CC}" NOFORTRAN=1 USE_THREAD=0 NO_LAPACK=1 TARGET=ARMV8 ARCH=arm64

Still facing error, different one, described as below:

| :0:0: warning: "ASMNAME" redefined
| :0:0: note: this is the location of the previous definition
| :0:0: warning: "ASMFNAME" redefined
| :0:0: note: this is the location of the previous definition
| :0:0: warning: "NAME" redefined
| :0:0: note: this is the location of the previous definition
| :0:0: warning: "CNAME" redefined
| :0:0: note: this is the location of the previous definition
| :0:0: warning: "CHAR_NAME" redefined
| :0:0: note: this is the location of the previous definition
| :0:0: warning: "CHAR_CNAME" redefined
| :0:0: note: this is the location of the previous definition
| ../kernel/arm64/amax.S: Assembler messages:
| ../kernel/arm64/amax.S:162: Error: ARM register expected -- cmp x0,xzr' | ../kernel/arm64/amax.S:164: Error: ARM register expected -- cmp x2,xzr'
| ../kernel/arm64/amax.S:167: Error: ARM register expected -- cmp x2,#1' | ../kernel/arm64/amax.S:172: Error: ARM register expected -- asr x5,x0,#2'
| ../kernel/arm64/amax.S:173: Error: ARM register expected -- cmp x5,xzr' | ../kernel/arm64/amax.S:176: Error: bad instruction ld1 {v0.4s},[x1],#16'
| ../kernel/arm64/amax.S:176: Error: bad instruction fabs v0.4s,v0.4s' | ../kernel/arm64/amax.S:176: Error: bad instruction fmaxv s0,v0.4s'
| ../kernel/arm64/amax.S:177: Error: ARM register expected -- subs x5,x5,#1' | ../kernel/arm64/amax.S:182: Error: bad instruction ld1 {v1.4s},[x1],#16'
| ../kernel/arm64/amax.S:182: Error: bad instruction fabs v1.4s,v1.4s' | ../kernel/arm64/amax.S:182: Error: bad instruction fmaxv s1,v1.4s'
| ../kernel/arm64/amax.S:182: Error: bad instruction fcmp s0,s1' | ../kernel/arm64/amax.S:182: Error: bad instruction fcsel s0,s0,s1,ge'
| ../kernel/arm64/amax.S:184: Error: ARM register expected -- subs x5,x5,#1' | ../kernel/arm64/amax.S:189: Error: ARM register expected -- ands x5,x0,#3'
| ../kernel/arm64/amax.S:194: Error: ARM register expected -- ldr s1,[x1],#4' | ../kernel/arm64/amax.S:194: Error: bad instruction fabs s1,s1'
| ../kernel/arm64/amax.S:194: Error: bad instruction fcmp s0,s1' | ../kernel/arm64/amax.S:194: Error: bad instruction fcsel s0,s0,s1,ge'
| ../kernel/arm64/amax.S:196: Error: ARM register expected -- subs x5,x5,#1' | ../kernel/arm64/amax.S:199: Error: bad instruction ret'
| ../kernel/arm64/amax.S:203: Error: ARM register expected -- ldr s0,[x1],#4' | ../kernel/arm64/amax.S:203: Error: bad instruction fabs s0,s0'
| ../kernel/arm64/amax.S:204: Error: ARM register expected -- subs x0,x0,#1' | ../kernel/arm64/amax.S:209: Error: ARM register expected -- lsl x2,x2,#2'
| ../kernel/arm64/amax.S:209: Error: bad instruction ld1 {v0.s}[0],[x1],x2' | ../kernel/arm64/amax.S:209: Error: bad instruction fabs s0,s0'
| ../kernel/arm64/amax.S:211: Error: ARM register expected -- subs x0,x0,#1' | ../kernel/arm64/amax.S:214: Error: ARM register expected -- asr x5,x0,#2'
| ../kernel/arm64/amax.S:215: Error: ARM register expected -- cmp x5,xzr' | ../kernel/arm64/amax.S:220: Error: bad instruction ld1 {v1.s}[0],[x1],x2'
| ../kernel/arm64/amax.S:220: Error: bad instruction fabs s1,s1' | ../kernel/arm64/amax.S:220: Error: bad instruction fcmp s0,s1'
| ../kernel/arm64/amax.S:220: Error: bad instruction fcsel s0,s0,s1,ge' | ../kernel/arm64/amax.S:221: Error: bad instruction ld1 {v1.s}[0],[x1],x2'
| ../kernel/arm64/amax.S:221: Error: bad instruction fabs s1,s1' | ../kernel/arm64/amax.S:221: Error: bad instruction fcmp s0,s1'
| ../kernel/arm64/amax.S:221: Error: bad instruction fcsel s0,s0,s1,ge' | ../kernel/arm64/amax.S:222: Error: bad instruction ld1 {v1.s}[0],[x1],x2'
| ../kernel/arm64/amax.S:222: Error: bad instruction fabs s1,s1' | ../kernel/arm64/amax.S:222: Error: bad instruction fcmp s0,s1'
| ../kernel/arm64/amax.S:222: Error: bad instruction fcsel s0,s0,s1,ge' | ../kernel/arm64/amax.S:223: Error: bad instruction ld1 {v1.s}[0],[x1],x2'
| ../kernel/arm64/amax.S:223: Error: bad instruction fabs s1,s1' | ../kernel/arm64/amax.S:223: Error: bad instruction fcmp s0,s1'
| ../kernel/arm64/amax.S:223: Error: bad instruction fcsel s0,s0,s1,ge' | ../kernel/arm64/amax.S:225: Error: ARM register expected -- subs x5,x5,#1'
| ../kernel/arm64/amax.S:230: Error: ARM register expected -- ands x5,x0,#3' | ../kernel/arm64/amax.S:235: Error: bad instruction ld1 {v1.s}[0],[x1],x2'
| ../kernel/arm64/amax.S:235: Error: bad instruction fabs s1,s1' | ../kernel/arm64/amax.S:235: Error: bad instruction fcmp s0,s1'
| ../kernel/arm64/amax.S:235: Error: bad instruction fcsel s0,s0,s1,ge' | ../kernel/arm64/amax.S:237: Error: ARM register expected -- subs x5,x5,#1'
| ../kernel/arm64/amax.S:242: Error: bad instruction ret' | ../kernel/arm64/amax.S:246: Error: bad instruction fmov s0,wzr'
| ../kernel/arm64/amax.S:247: Error: bad instruction `ret'
| Makefile.L1:525: recipe for target 'samax_k.o' failed
| make[1]: *** [samax_k.o] Error 1

Is my compilation configuration command is correct or I am missing anything?
As I am cross compiling with Yocto, my architecture is arm64 (ARMV8).

Please suggest.

@martin-frbg
Copy link
Collaborator

martin-frbg commented Jun 29, 2019

I am not sure i understand the cross-compiling - do you intend to build an ArmV7 binary on ArmV8, or the other way round ?(Or is the actual compilation running on non-ARM hardware?)

@jaymindabhi
Copy link
Author

I want to build binary for aarch64 architecture.

@martin-frbg
Copy link
Collaborator

martin-frbg commented Jun 29, 2019

The "ASMNAME redefined" is probably harmless (the partly recursive makefile structure does this when one supplies CFLAGS or similar).
The assembler error seems to suggest you are trying to use the wrong toolchain (32bit) to compile arm64 assembly according to
https://community.arm.com/developer/tools-software/oss-platforms/f/dev-platforms-forum/5274/issue-compiling-armv8-assembly

@brada4
Copy link
Contributor

brada4 commented Jun 29, 2019

It bails out on aarch64 instructions. Looks like 32bit AS is in the way somehow.
Could you expand the build variables, like adding 'set' after failed build?

@brada4
Copy link
Contributor

brada4 commented Jun 30, 2019

I found answer in your initial post, it is a 32bt compiler, ARMv7 is a 32bit arch.

-oemllib32-linux-gnueabi-

@jaymindabhi
Copy link
Author

jaymindabhi commented Jul 1, 2019

Let me try with ARMV7 architecture option.
Will update here with outcomes.

Thanks

@brada4
Copy link
Contributor

brada4 commented Jul 1, 2019

Iit should be done by bb file already. The arch override does not work like you tried, you need full target toolchain

@jaymindabhi
Copy link
Author

Below is my current openblas_0.3.6.bb file. Will set TARGET=ARMV7 BINARY=32 and update here. Meanwhile can you please let me know if I am missing any parameters in existing configuration? Do I need to add any other parameters during compilation?

DESCRIPTION = "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version."
SUMMARY = "OpenBLAS : An optimized BLAS library"
AUTHOR = "Alexander Leiva <norxander@gmail.com>"
HOMEPAGE = "http://www.openblas.net/"
SECTION = "libs"
LICENSE = "BSD-3-Clause"

DEPENDS = "make"

LIC_FILES_CHKSUM = "file://LICENSE;md5=5adf4792c949a00013ce25d476a2abc0"

SRC_URI = "https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz"
SRC_URI[md5sum] = "8a110a25b819a4b94e8a9580702b6495"
SRC_URI[sha256sum] = "e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f"

S = "${WORKDIR}/OpenBLAS-${PV}"

do_compile () {
        oe_runmake HOSTCC="${BUILD_CC}" \
        CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" \
        CROSS_SUFFIX=${HOST_PREFIX} \
        ONLY_CBLAS=1 USE_THREAD=0 \
        HOSTCC="${BUILD_CC}" \
        TARGET=ARMV8 BINARY=64
}

do_install() {
        oe_runmake HOSTCC="${BUILD_CC}" \
        CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" \
        CROSS_SUFFIX=${HOST_PREFIX} \
        ONLY_CBLAS=1 USE_THREAD=0 \
        HOSTCC="${BUILD_CC}" \
        TARGET=ARMV8 BINARY=64 \
        PREFIX="${D}/opt/${PN}" \
        install  	

        rm -rf ${D}${bindir}
        rm -rf ${D}${libdir}/cmake
} 

FILES_${PN}     += "/opt/${PN}"
FILES_${PN}-dev += "/opt/${PN}/lib/lib${PN}.so"
#FILES_${PN}-dbg += "/opt/${PN}/lib/.debug"

INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

INSANE_SKIP_${PN} += "staticdev"

@brada4
Copy link
Contributor

brada4 commented Jul 1, 2019

Basic cross-compilation would be
make CC=target-arch-gcc FC=target-arch-gcc HOSTCC=cc
With particular build commands in your file it is designed to build only aarch64 version, so that aarch64 should be visible in build logs prominently.

@martin-frbg
Copy link
Collaborator

Did you get any further with this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants