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

openblas: compiling issue if using ccache #20596

Closed
trippleflux opened this issue Mar 5, 2023 · 11 comments · Fixed by #20624
Closed

openblas: compiling issue if using ccache #20596

trippleflux opened this issue Mar 5, 2023 · 11 comments · Fixed by #20624

Comments

@trippleflux
Copy link

trippleflux commented Mar 5, 2023

Maintainer: @commodo
Environment: x86_64 , snapshot

Description:

Looks like the recent OpenWrt 5a1eb3b commit causing this openblas compiling issues :

Y=x86_64-openwrt-linux-gnu-objcopy OBJDUMP=x86_64-openwrt-linux-gnu-objdump SIZE=x86_64-openwrt-linux-gnu-size CROSS="x86_64-openwrt-linux-gnu-" ARCH="x86_64" CROSS=1 HOSTCC=gcc CROSS_SUFFIX=x86_64-openwrt-linux-gnu- BINARY=64 MAKE_NB_JOBS=-1 NUM_THREADS=2 PREFIX=/usr COMMON_OPT="" TARGET=GENERIC NOFORTRAN=1 ;
make[3]: Entering directory '/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/OpenBLAS-0.3.21'
ccache: invalid option -- 'm'
C Compiler (ccache -m64) is something wrong.
ccache: invalid option -- 'm'
C Compiler (ccache -m64) is something wrong.
/usr/bin/ld: warning: /home/username/works/openwrt/tmp/ccDwe54L.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
ccache: invalid option -- 'm'
C Compiler (ccache -m64) is something wrong.
make[3]: *** [Makefile.prebuild:63: config.h] Error 1
Makefile.system:284: Makefile.conf: No such file or directory
make[3]: *** No rule to make target 'Makefile.conf'.  Stop.
make[3]: Leaving directory '/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/OpenBLAS-0.3.21'
make[2]: *** [Makefile:108: /home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/OpenBLAS-0.3.21/.built] Error 2
make[2]: Leaving directory '/home/username/works/openwrt/feeds/packages/libs/openblas'
time: package/feeds/packages/openblas/compile#0.72#1.06#1.67
    ERROR: package/feeds/packages/openblas failed to build.
make[1]: *** [package/Makefile:116: package/feeds/packages/openblas/compile] Error 1
make[1]: Leaving directory '/home/username/works/openwrt'
make: *** [/home/username/works/openwrt/include/toplevel.mk:231: package/openblas/compile] Error 2

[EDIT]
env variables :

CFLAGS="-mtune=tigerlake -march=tigerlake -O3 -funsafe-math-optimizations -ftree-vectorize"
FORCE_UNSAFE_CONFIGURE=1

OpenWrt .config :
config.zip

@brada4
Copy link

brada4 commented Mar 5, 2023

HOSTCC=$(HOSTCC_NOCACHE) \

How did you manage to use ccache?

@trippleflux
Copy link
Author

Already tried to changing HOSTCC into either TARGET_CC & HOSTCC doesn't help

@brada4
Copy link

brada4 commented Mar 6, 2023

Your gcc command somehow gets using ccache.

@trippleflux
Copy link
Author

trippleflux commented Mar 6, 2023

Don't know because the openblas OpenWrt Makefile is 'weird' for me as in the openblas package there are cmakelist.txt or using cmake, but on OpenWrt Makefile is not using it.

Also tried the following :

HOSTCC="ccache gcc"
HOSTCC=ccache

Another strange thing is currently compilation for others OpenWrt package is unaffected when using ccache.

Currently trying to recompile with OpenWrt 5a1eb3b commit reverted.

@brada4
Copy link

brada4 commented Mar 6, 2023

Being small time contributor to OpenBLAS I can tell for certain that you absolutely should not use ccache.
Single source file is supposed to emit different binary objects depending on -D/-U variables like whether input is meant to be single/double/complex or output being minimum or maximum, where ccache will just drop cached copy and make broken resulting library.
Please sanity-check your environment like CC variables, or /usr/bin/gcc being a link to ccache etc.

@trippleflux
Copy link
Author

trippleflux commented Mar 6, 2023

I am not an OpenBLAS user but in my OpenWrt config it was being selected as module/m. Didn't realize that, I thought that it was forced selected by another OpenWrt package.
Hmm, getting the same result with reverted OpenWrt 5a1eb3b commit. Already tried to starting new ssh connection into my build VM with only CFLAGS and FORCE_UNSAFE_CONFIGURE=1 variable, tried to nuke the openwrt build dir and starting from scratch but both giving the same error result.

Should I close this issue?

@brada4
Copy link

brada4 commented Mar 6, 2023

Better wait for @commodo - sort of ipk builds perfectly fine all the time. in the meantime post exactly variables you override and edit OP to have complete output of "failed build", it misses "CC"

@commodo
Copy link
Contributor

commodo commented Mar 6, 2023

Will take a look

@trippleflux
Copy link
Author

trippleflux commented Mar 6, 2023

@commodo
Thanks, recent OpenWrt commits perhaps broke compilation, especially for x86_64 glibc, my build VM environment doesn't changed but somehow it's hard to do a successful compile currently.

I am currently eyeing at recent OpenWrt's binuntils update into version 2.40

@trippleflux trippleflux changed the title openblas: compiling issue openblas: compiling issue if using ccache Mar 7, 2023
commodo added a commit to commodo/packages that referenced this issue Mar 9, 2023
Fixes openwrt#20596

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
@commodo
Copy link
Contributor

commodo commented Mar 9, 2023

should be fixed with #20624

it took me a while to get that .config building

@trippleflux
Copy link
Author

@commodo
Thanks a lot, testing it right now

neheb pushed a commit that referenced this issue Mar 9, 2023
Fixes #20596

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
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

Successfully merging a pull request may close this issue.

3 participants