-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
While trying to build OpenBLAS with ROCm, I've encountered this build failure:
clang: error: no such file or directory: '/data/EasyBuild-develop/software/ROCm-LLVM/22.0.0-GCCcore-14.3.0-rpath%OCm-7.2.0/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a'
clang: error: no such file or directory: '/data/EasyBuild-develop/software/ROCm-LLVM/22.0.0-GCCcore-14.3.0-rpath%OCm-7.2.0/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a'
A close look shows that we're trying to link static libraries, but the path was changed to include -rpath% instead of -R.
This comes from FEXTRALIB=, created by f_check.
Looking at the f_check code, it first does a few replacements in the link command:
link=`echo "$link" | sed 's/\-Y[[:space:]]P\,/\-Y/g'`
link=`echo "$link" | sed 's/\-R[[:space:]]*/\-rpath\%/g'`
link=`echo "$link" | sed 's/\-rpath[[:space:]]+/\-rpath\%/g'`
link=`echo "$link" | sed 's/\-rpath-link[[:space:]]+/\-rpath-link\%/g'`only after that, it is checked if the linker flags are actually paths to static libraries.
case "$flag" in *.a) linker_a="$linker_a $flag" ;; esacThis breaks any build where the link command includes static libraries, with the path including -R.
To reproduce, one can e.g. and try to run f_check with this:
$ ./f_check Makefile config "gfortran /path-with-R/library.a" && tail -n 5 Makefile
@echo Done.
F_COMPILER=GFORTRAN
FC=gfortran /path-with-R/library.a
BU=_
FEXTRALIB= -L/usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/../../.. -L/lib -L/usr/lib -lgfortran -lm -lquadmath -lm -lc /path-with-rpath%/library.a /path-with-rpath%/library.aReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels