Hi,
My goal is to build Gcc to use openacc offloading on AMD instinct GPUs.
I built it successfully for Nvidia GPUs some weeks ago.
I have followed the documentation provided by
https://gcc.gnu.org/wiki/Offloading#Building_host_and_accel_compilers
- building llvm and renaming the tools,
- building gfortran for the device:
../configure --prefix=$DEST --target=amdgcn-amdhsa
--enable-languages=c,c++,lto,fortran --disable-sjlj-exceptions
--with-newlib \
--enable-as-accelerator-for=$target
--with-build-time-tools=$DEST/bin --disable-libquadmath
- building gfortran for the host:
../configure --prefix=$DEST --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --disable-multilib \
--enable-offload-targets=nvptx-none=$DEST/nvptx-none,amdgcn-amdhsa=$DEST/amdgcn-amdhsa
Compilation is successful but using this new compiler I have an error
when calling it:
$ make
gfortran -c -fopenacc -foffload='-march=gfx90a' -cpp
-foffload=-lgfortran tab.f90 -o tab.o
as: Unknown command line argument '--64'. Try: 'as --help'
as: Did you mean '-I'?
make: *** [Makefile:26: tab.o] Error 1
Of course the newly installer 'as' binary from llvm do not accept "--64"
option.
versions:
- gcc: latest git master branch (24/07/2023)
- llvm: 13.0.1 or 15.0.6
Thanks for you advices.
Patrick