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

For reference, the target options that are recognized by llvm-mc are the 
following:

yp@basecamp:~/work/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-12.2.0/llvm-13.0.1-6zvbqlbev3wiqihvz2god7pzcptnoxu3/bin$
 llvm-mc -version
LLVM (http://llvm.org/):
  LLVM version 13.0.1
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: znver2

  Registered Targets:
    amdgcn - AMD GCN GPUs
    r600   - AMD GPUs HD2XXX-HD6XXX
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64

Please advise,
Wil

From: Wileam Yonatan Phan <wilea...@outlook.com>
Sent: Tuesday, March 7, 2023 13:42
To: Andrew Stubbs <a...@codesourcery.com>; gcc@gcc.gnu.org <gcc@gcc.gnu.org>
Subject: Re: Clarification on newlib version for building AMDGCN offloading 
backend 
 
Hi Andrew,

Thanks! I've created the first draft as a GitHub PR here:
<https://github.com/spack/spack/pull/35919>

I think it still needs some work on the part where it builds LLVM utilities 
with CMake.
As much as I want supporting only the newest GCC version, Spack currently 
supports building all stable versions of GCC from the tarballs, as well as 
latest develop branch, so I've enabled all versions >= 10.

Thanks,
Wil

From: Andrew Stubbs <a...@codesourcery.com>
Sent: Tuesday, March 7, 2023 10:38
To: Wileam Yonatan Phan <wilea...@outlook.com>; gcc@gcc.gnu.org 
<gcc@gcc.gnu.org>
Subject: Re: Clarification on newlib version for building AMDGCN offloading 
backend 
 
On 06/03/2023 19:23, Wileam Yonatan Phan via Gcc wrote:
> Hi,
> 
> I'm working on adding a build recipe for GCC with AMDGCN offloading backend 
> in Spack. Can anyone clarify the following sentence listed on the wiki?
> 
>> The Newlib version needs to be contemporaeous with GCC, at least until the 
>> ABI is finalized.
> <https://gcc.gnu.org/wiki/Offloading#How_to_build_an_offloading-enabled_GCC>
> 
> What are the correct contemporaneous versions for each version of GCC >= 10?

Just match the dates and you'll probably be fine. We've mostly 
synchronised the ABI changes across the GCC mainline and the development 
branch precisely because the Newlib dependency is shared.

Right now the required version of Newlib is 4.3.0.20230120. Prior to the 
ABI change a month or so ago you would have to use a Newlib snapshot.

I wouldn't recommend spending very much of your valuable time on 
enabling old versions of these toolchains.

Andrew

Reply via email to