1

我正在尝试在 Ubuntu 20.04 上为 Nvidia PTX 安装 GCC 10,以便我可以将 openACC 负载卸载到 Nvidia GPU。

我正在按照此链接中给出的步骤进行操作

  1. 安装 nvptx 工具
git clone https://github.com/MentorEmbedded/nvptx-tools.git
./configure
make -j  #Generates nvptx-none-as, nvptx-none-ld
make install DESTDIR=/install

导出路径,export PATH=/install/usr/local/bin:$PATH

  1. 克隆 newlib-cygwin, git clone git://sourceware.org/git/newlib-cygwin.git

  2. 下载 GCC 10 源文件

wget https://ftpmirror.gnu.org/gcc/gcc-10.1.0/gcc-10.1.0.tar.xz
tar xf gcc-10.1.0.tar.xz
cd gcc-10.1.0
./contrib/download_prerequisites
  1. 在 gcc 源文件夹中添加了来自 newlib 的符号链接 ln -s /home/newlib-cygwin/newlib newlib

  2. 然后,我已经完成了源代码构建(推荐)

cd ..
mkdir build_gcc10 && cd build_gcc10
../gcc-10.1.0/configure --target=nvptx-none --enable-as-accelerator-for=x86_64-pc-linux-gnu --with-build-time-tools=/install/usr/local/nvptx-none/bin --disable-sjlj-exceptions --enable-newlib-io-long-long
  1. 我还导出了 gmp、mpfr、mpc 的 lib 运行时路径 export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

我收到以下错误

错误:

checking for suffix of object files... configure: error: in `/home/gcc-10.1.0/build/nvptx-none/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make[1]: *** [Makefile:13187: configure-target-libgcc] Error 1
make[1]: Leaving directory '/home/gcc-10.1.0/build'
make: *** [Makefile:947: all] Error 2

当我检查 /home/gcc-10.1.0/build/nvptx-none/libgcc/config.log 文件时,错误是因为这个

configure:3535: /home/build_gcc10/./gcc/xgcc -B/home/build_gcc10/./gcc/ -nostdinc -B/home/build_gcc10/nvptx-none/newlib/ -isystem /home/build_gcc10/nvptx-none/newlib/targ-include -isystem /home/gcc-10.1.0/newlib/libc/include -B/usr/local/nvptx-none/bin/ -B/usr/local/nvptx-none/lib/ -isystem /usr/local/nvptx-none/include -isystem /usr/local/nvptx-none/sys-include    -V >&5
xgcc: error: unrecognized command-line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3546: $? = 1
configure:3535: /home/build_gcc10/./gcc/xgcc -B/home/build_gcc10/./gcc/ -nostdinc -B/home/build_gcc10/nvptx-none/newlib/ -isystem /home/build_gcc10/nvptx-none/newlib/targ-include -isystem /home/gcc-10.1.0/newlib/libc/include -B/usr/local/nvptx-none/bin/ -B/usr/local/nvptx-none/lib/ -isystem /usr/local/nvptx-none/include -isystem /usr/local/nvptx-none/sys-include    -qversion >&5
xgcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
xgcc: fatal error: no input files
compilation terminated.

请建议我如何进行。

4

0 回答 0