On 29/03/2023 19:18, Wileam Yonatan Phan wrote:
Hi Andrew,
I just built GCC 12.2.0 with AMDGCN offloading successfully with Spack!
However, when I tried to test it with an OpenACC test code that I have, I
encountered the following error message:
wyp@basecamp:~/work/testcodes/f90-acc-ddot$ gfortran -fopenacc
-foffload=amdgcn-unknown-amdhsa="-march=gfx900" ddot.f90
as: unrecognized option '-triple=amdgcn--amdhsa'
mkoffload: fatal error: x86_64-pc-linux-gnu-accel-amdgcn-unknown-amdhsa-gcc
returned 1 exit status
compilation terminated.
lto-wrapper: fatal error:
/home/wyp/work/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-12.2.0/gcc-12.2.0-w7lclfarefmge3uegn2a5vw37bnwhwto/libexec/gcc/x86_64-pc-linux-gnu/12.2.0//accel/amdgcn-unknown-amdhsa/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
My guess is that it's trying to use the wrong assembler. Usually this
means there is a problem with your installation procedure and/or your
PATH. I think you should be able to investigate further using -v and/or
strace. The correct one should be named
$DESTDIR/usr/local/amdgcn-amdhsa/bin/as, but this will be different if
you configured GCC with a custom --prefix location. If you have
relocated the toolchain since installation then the toolchain will
attempt to locate libraries and tools relative to the gcc binary. If it
does not find them there then it looks in the "usual places", and those
usually contain an "as" suitable only for the host system.
If you find an error on the Wiki instructions please let me know and I
will correct them.
Andrew